Getting started — Dash
-
Install the package (Python 3.12+):
Terminal window pip install dash-tensor-grid# optional pandas ingestion path:pip install "dash-tensor-grid[pandas]" -
Build a payload from any data source with the declarative config, and drop the component into your layout:
from dash import Dashfrom dash_tensor_grid import TensorGrid, build_gridsales = [{"region": "EMEA", "country": "Germany", "revenue": 100, "cost": 60},{"region": "AMER", "country": "USA", "revenue": 200, "cost": 120},# …a list[dict], pandas/Polars DataFrame, or JSON string]payload = build_grid(sales, {"rows": ["region", "country"],"measures": {"revenue": "sum", "cost": "sum"},"formats": {"revenue": "currency:USD", "cost": "currency:USD"},"grand_total": True,})app = Dash(__name__)app.layout = TensorGrid(id="grid",row_data=payload["row_data"],column_defs=payload["column_defs"],)if __name__ == "__main__":app.run(debug=True) -
Run it —
python app.py— and you have a live, expandable OLAP grid.
That’s the whole thing. The result looks like this (rendered here with the vanilla adapter — same engine, same numbers):
Where to next
Section titled “Where to next”- Turn a dimension into columns for a pivot / cross-tab.
- Add calculated measures (
margin = (revenue - cost) / revenue). - Wire drill-through and editing.
- Scale up with lazy server mode for billion-row sources.
- See every prop in the Dash component reference.