Skip to content
The logoThe logo

Hagrid

Removes overlaps in scatterplots by snapping points onto a grid.

When a scatterplot uses glyphs or images instead of points, they overlap, and the plot stops being readable. hagrid moves each point to its own cell on a grid, keeping it as close to where it started as the grid allows.

Data

Technique

Vis

Colour
Show

Seven techniques

Three built on space filling curves — Hilbert, Gilbert, Gosper — and four reimplementations of published methods: DGrid, CMDS, NMap, GridFit.

One entry point

gridify(data, method, parameters) for all of them, or call a method directly to skip the parameter defaulting.

Honest about limits

Each technique page says what the method refuses and what it gets wrong, with a demo you can make fail.

No framework

ESM, CommonJS and a browser build, TypeScript types included, one runtime dependency.