PerspectiveExamples

Superstore (Workspace)

3-panel dashboard of Y Bar, Datagrid and Treemap: Y Bar chart of Sales, grouped by Sub-Category, split by Segment, sorted by Sales; Data grid of Sales and Profit, grouped by Region and State, split by Category and Sub-Category, sorted by Profit; Treemap chart of Sales and Profit, grouped by Region and State, sorted by Profit.

Sales by sub-category, profit over time, and the grouped grid underneath.

Superstore (Workspace): 3-panel dashboard of Y Bar, Datagrid and Treemap: Y Bar chart of Sales, grouped by Sub-Category, split by Segment, sorted by Sales; Data grid of Sales and Profit, grouped by Region and State, split by Category and Sub-Category, sorted by Profit; Treemap chart of Sales and Profit, grouped by Region and State, sorted by Profit.

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:

{
    "active": "PERSPECTIVE_GENERATED_ID_1",
    "layout": {
        "type": "split-layout",
        "children": [
            {
                "type": "split-layout",
                "children": [
                    {
                        "type": "tab-layout",
                        "tabs": [
                            "PERSPECTIVE_GENERATED_ID_0"
                        ],
                        "selected": 0
                    },
                    {
                        "type": "tab-layout",
                        "tabs": [
                            "PERSPECTIVE_GENERATED_ID_2"
                        ],
                        "selected": 0
                    }
                ],
                "sizes": [
                    0.5,
                    0.5
                ],
                "orientation": "horizontal"
            },
            {
                "type": "tab-layout",
                "tabs": [
                    "PERSPECTIVE_GENERATED_ID_1"
                ],
                "selected": 0
            }
        ],
        "sizes": [
            0.55,
            0.45
        ],
        "orientation": "vertical"
    },
    "panels": {
        "PERSPECTIVE_GENERATED_ID_0": {
            "columns_config": {},
            "plugin": "Y Bar",
            "plugin_config": {},
            "table": "superstore",
            "title": "Y Bar",
            "group_by": [
                "Sub-Category"
            ],
            "split_by": [
                "Segment"
            ],
            "sort": [
                [
                    "Sales",
                    "desc"
                ]
            ],
            "filter": [],
            "group_rollup_mode": "flat",
            "split_rollup_mode": "flat",
            "expressions": {},
            "columns": [
                "Sales"
            ],
            "aggregates": {}
        },
        "PERSPECTIVE_GENERATED_ID_1": {
            "columns_config": {
                "Profit": {
                    "fg_mode": "label-bar",
                    "fg_gradient": 17320
                }
            },
            "plugin": "Datagrid",
            "plugin_config": {},
            "table": "superstore",
            "title": "Group By 2",
            "group_by": [
                "Region",
                "State"
            ],
            "split_by": [
                "Category",
                "Sub-Category"
            ],
            "sort": [
                [
                    "Profit",
                    "asc"
                ]
            ],
            "filter": [],
            "group_rollup_mode": "rollup",
            "split_rollup_mode": "rollup",
            "expressions": {},
            "columns": [
                "Sales",
                "Profit"
            ],
            "aggregates": {}
        },
        "PERSPECTIVE_GENERATED_ID_2": {
            "columns_config": {},
            "plugin": "Treemap",
            "plugin_config": {},
            "table": "superstore",
            "title": "Y Line - Datetime Axis",
            "group_by": [
                "Region",
                "State"
            ],
            "split_by": [],
            "sort": [
                [
                    "Profit",
                    "desc"
                ]
            ],
            "filter": [],
            "group_rollup_mode": "flat",
            "split_rollup_mode": "flat",
            "expressions": {},
            "columns": [
                "Sales",
                "Profit",
                null
            ],
            "aggregates": {}
        }
    }
}

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