Skip to content

Packages ​

vizcrush has nine core and algorithm packages plus two integration packages, so you only install what you use. Algorithm packages expose small TypeScript APIs backed by WebAssembly and JavaScript implementations.

At a glance ​

PackageOne-linerBackends
@vizcrush/coreInitialize the library, detect capabilities, select the backendJS
@vizcrush/downsampleLTTB, MinMax-LTTB, M4, LTOB time-series downsamplingWASM, JS
@vizcrush/aggregateWelford stats, exact percentiles, sketches, streaming windowsWASM, JS
@vizcrush/transformRadix sort, min-max normalize, range filter on typed arraysWASM, JS
@vizcrush/bin1D histograms, 2D density grids, hexagonal binningWASM, JS
@vizcrush/bin3d3D voxel grids for volumetric heatmapsWASM, JS
@vizcrush/spatial2D quadtree + range, k-NN queriesWASM, JS
@vizcrush/spatial3d3D octree + range, k-NN, frustum cullingWASM, JS
@vizcrush/aiAnomaly + changepoint detection, auto-config, shape similarityJS

There are also two integration packages (covered in the User Guide):

Common conventions ​

Inputs and outputs are typed arrays. Almost everything takes Float64Array (data) or Uint32Array (indices). The WASM path bulk-copies typed-array input into linear memory; typed arrays avoid per-element boxing and keep the boundary cost predictable.

APIs are async by default. WASM module loading is inherently async. Sync variants exist where they're trivially safe — e.g. lttbSync() runs the JS fallback inline.

Paired results use separate arrays. Downsampling and range-filter APIs return { x: Float64Array, y: Float64Array }. Adapt those arrays to the input shape expected by your renderer.

Backend can be overridden per call. Most functions accept an options.backend of "auto" | "wasm" | "js". The default is "auto" (use the capability preference from init(), subject to per-call thresholds and availability).

What's a "package" in the source ​

Every package lives under packages/<name>/:

packages/<name>/
├── package.json
├── tsconfig.json
├── src/
│   ├── index.ts        # public exports — what you import
│   ├── wasm.ts         # WASM loader (async)
│   └── shaders/        # *.wgsl compute shaders (bin2d wired as opt-in, ADR 0004; rest are drafts)
└── wasm/               # generated wasm-bindgen output (gitignored, built locally)

The corresponding Rust crate is at crates/vizcrush-<name>/. See the Architecture page for the full build pipeline.

Released under the MIT License.