Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some information on JSON input formats #2856

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions rust/perspective-client/docs/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,35 @@ table.replace(df)
</div>

<div class="warning">`limit` cannot be used in conjunction with `index`.</div>

# JSON Input Data

Perspective supports many kinds of input data, including two formats of JSON
data: row-oriented and column-oriented data.

## Row Oriented JSON

Row-oriented JSON is in the form of a list of objects. Each object in the list
Copy link
Contributor

@aszenz aszenz Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is important to mention that every object in the list should have the same no of keys since psp doesn't support dynamic columns per row

corresponds to a row in the table. For example:

```json
[
{ "a": 86, "b": false, "c": "words" },
{ "a": 0, "b": true, "c": "" },
{ "a": 12345, "b": false, "c": "here" }
]
```

## Column Oriented JSON

Column-Oriented JSON comes in the form of an object of lists. Each key of the
object is a column name, and each element of the list is the corresponding value
in the row.

```json
{
"a": [86, 0, 12345],
"b": [false, true, false],
"c": ["words", "", "here"]
}
```
Loading