@perspective-dev/client
Perspective is an open-source data grid, pivot table and charting component for large, real-time and streaming datasets.
@perspective-dev/client is the JavaScript and TypeScript API for
Perspective's streaming query engine. The same Client connects to an engine
running in a Web Worker (WebAssembly), in-process in Node.js, or remotely over
WebSocket to a Python, Node.js or Rust server. It provides:
Table, a columnar, optionally indexed store which accepts Apache Arrow, CSV and JSON, and streamsupdate()andremove()calls in real time. Withpage_to_disk, aTablepages its columns to disk (OPFS in the browser) to exceed memory.View, an incrementally-maintained query over aTable:group_by,split_bypivots, aggregates, filters, sorts and columnar expressions.- Reactive joins across tables.
- Virtual servers for DuckDB and ClickHouse, which translate
Viewconfigurations into native SQL.
Installation
Usage
import perspective from "@perspective-dev/client";
import SERVER_WASM from "@perspective-dev/server/dist/wasm/perspective-server.wasm";
await perspective.;
const worker = await perspective.;
const table = await worker.;
const view = await table.;
view.;
await table.;
In Node.js the engine runs in-process, and the module exports the API directly:
const perspective = require;
const table = await perspective.;
To render a Table as a data grid, pivot table or chart, see
@perspective-dev/viewer.