PerspectiveExamples

Gradient Colors — Data grid with 6 categories. 3 categories have custom, gradient color conditional formatting.

Data grid of Category, Sales, Discount and Profit, sorted by Sub-Category.

Gradient Colors — Data grid with 6 categories. 3 categories have custom, gradient color conditional formatting.: Data grid of Category, Sales, Discount and Profit, sorted by Sub-Category.

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": "Gradient Colors",
            "columns": [
                "Category",
                "Sales",
                "Discount",
                "Profit",
                "Sub-Category",
                "Order Date"
            ],
            "columns_config": {
                "Profit": {
                    "bg_mode": "gradient",
                    "bg_gradient": 600,
                    "pos_bg_color": "#32cd82",
                    "neg_bg_color": "#f50fed"
                },
                "Sales": {
                    "bg_mode": "gradient",
                    "bg_gradient": 2268,
                    "pos_bg_color": "#780aff",
                    "neg_bg_color": "#f5ac0f"
                },
                "Discount": {
                    "bg_mode": "gradient",
                    "bg_gradient": 0.8,
                    "pos_bg_color": "#f5ac0f",
                    "neg_bg_color": "#780aff"
                }
            },
            "sort": [
                [
                    "Sub-Category",
                    "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