Perspective › Examples
Y Bar - Group By 2 And 2 Split By Sorted 2 — Bar chart. X is 'State', Y is 'Profit'. Each state has, when applicable, 2 bars: Profit and Loss. States are sorted by Net.
Y Bar chart of Profit, grouped by State, split by Profit (-/+), sorted by Profit, with 1 computed expression column.

Data
Programmatic variations on the Superstore retail sales dataset, showing the flexibility of Perspective's configuration: the same table re-queried as data grids, pivot tables and charts by changing only the viewer's JSON config.
Loaded from /data/superstore.lz4.arrow as arrow into the perspective-server engine.
Configuration
This example is a saved <perspective-viewer> workspace. Pass this JSON to viewer.restoreWorkspace() to reproduce it over the same table:
{
"layout": {
"type": "tab-layout",
"tabs": [
"p0"
],
"selected": 0
},
"panels": {
"p0": {
"table": "",
"title": "Y Bar - Group By 2 And 2 Split By Sorted 2",
"plugin": "Y Bar",
"group_by": [
"State"
],
"split_by": [
"Profit (-/+)"
],
"columns": [
"Profit"
],
"expressions": {
"Profit (-/+)": "if(\"Profit\"<0){1}else{0}"
},
"sort": [
[
"Profit",
"desc"
]
],
"theme": null
}
},
"active": "p0"
}
About Perspective
Perspective is an open-source, WebAssembly-powered data grid, pivot table and charting component for large, real-time and streaming datasets — in the browser, Python, Jupyter, Node.js and Rust.
Documentation