Skip to content

Packages

vizcrush is split into nine independent packages so you only install (and ship) what you actually use. Every package has the same shape: a small async TypeScript API that delegates to a WebAssembly core, with a synchronous JavaScript fallback for environments without WebAssembly.

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 + t-digest percentiles, 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). This is intentional — typed arrays are zero-copy across the JS↔WASM boundary, while plain number[] requires a per-element conversion that dominates runtime for any non-trivial input.

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.

Results are interleaved when paired. XY-pair functions return [x0, y0, x1, y1, …] in a single Float64Array, not { x: Float64Array, y: Float64Array }. This matches what most charting libraries consume directly.

Backend can be overridden per call. Most functions accept an options.backend of "auto" | "wasm" | "js". The default is "auto" (use whatever init() selected).

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.