PerspectiveExamples

Market — Heatmap (Closed)

Heatmap chart of if("side"=='buy'){-1}else{1}, grouped by bucket("timestamp", 'm'), split by bucket("price", 0.25), filtered to status == closed, with 3 computed expression columns.

Simulated real-time order flow: a stateful matching engine on a private worker, view-mirrored to the UI.

Market — Heatmap (Closed): Heatmap chart of if("side"=='buy'){-1}else{1}, grouped by bucket("timestamp", 'm'), split by bucket("price", 0.25), filtered to status == closed, with 3 computed expression columns.

Data

A simulated order book streaming into a Perspective table in real time: orders are created, filled, cancelled and expired continuously, and every data grid, pivot and chart updates incrementally as they arrive.

Generated continuously in the browser by a JavaScript simulation streaming into a Perspective Table.

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": "",
            "theme": null,
            "plugin": "Heatmap",
            "plugin_config": {},
            "title": "Heatmap (Closed)",
            "group_by": [
                "bucket(\"timestamp\", 'm')"
            ],
            "split_by": [
                "bucket(\"price\", 0.25)"
            ],
            "columns": [
                "if(\"side\"=='buy'){-1}else{1}"
            ],
            "filter": [
                [
                    "status",
                    "==",
                    "closed"
                ]
            ],
            "sort": [],
            "expressions": {
                "bucket(\"timestamp\", 'm')": "bucket(\"timestamp\", 'm')",
                "bucket(\"price\", 0.25)": "bucket(\"price\", 0.25)",
                "if(\"side\"=='buy'){-1}else{1}": "if(\"side\"=='buy'){-1}else{1}"
            },
            "aggregates": {}
        }
    },
    "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