finds.dev← search

// the find

mourner/simpleheat

★ 954 · JavaScript · BSD-2-Clause · updated Jul 2024

A tiny JavaScript library for drawing heatmaps with Canvas

A 200-line Canvas-based heatmap renderer by Vladimir Agafonkin (Leaflet author). It blurs radial gradients onto an offscreen canvas then composites them with a color gradient — the classic approach. It's a building block, not a finished product.

No dependencies, zero build step — just drop in the JS file. The algorithm is solid: uses 'lighter' compositing for additive density then remaps through a gradient lookup table, which is efficient. Source is readable in one sitting; you can understand and fork it in an hour. Powers Leaflet.heat, so it's battle-tested on real mapping workloads.

No TypeScript types or ESM export — you're hand-rolling declarations or using a community @types package. No support for WebGL fallback, so performance caps out at a few thousand points before the Canvas API becomes the bottleneck. Value normalization is global (one max for the whole dataset), which makes sparse high-value outliers wash out everything else — common but painful. Last meaningful commit was years ago; the repo is maintained in maintenance-only mode at best.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →