@vizcrush/spatial
v1.0.0
Published
Quadtree, hash grid, and Morton-order spatial indexing
Maintainers
Readme
@vizcrush/spatial
Quadtree, spatial hash grid, Morton ordering — range and kNN queries over 2D points.
Part of vizcrush — high-performance data primitives for browser visualization, written in Rust, compiled to WebAssembly, with a pure-JS fallback.
Install
npm install @vizcrush/spatialExample
import { buildQuadtree, queryRange, queryNearest } from "@vizcrush/spatial";
const tree = await buildQuadtree(x, y);
const visible = queryRange(tree, { xMin, xMax, yMin, yMax });
const nearest = queryNearest(tree, cursorX, cursorY, 5);Documentation
Full guides and API reference: debug-diary-1.github.io/vizcrush · The vizcrush Book
License
MIT
