From 23f8fd5f6f4c5a19f850daa283fb183f6d1bc33a Mon Sep 17 00:00:00 2001 From: Davis Silverman Date: Mon, 18 Nov 2024 16:38:20 -0500 Subject: [PATCH] Add some information on JSON input formats Signed-off-by: Davis Silverman --- rust/perspective-client/docs/table.md | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/rust/perspective-client/docs/table.md b/rust/perspective-client/docs/table.md index 2217a0abe6..06f8cc5c15 100644 --- a/rust/perspective-client/docs/table.md +++ b/rust/perspective-client/docs/table.md @@ -279,3 +279,35 @@ table.replace(df)
`limit` cannot be used in conjunction with `index`.
+ +# 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 +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"] +} +```