mourner / simpleheat

A tiny JavaScript library for drawing heatmaps with Canvas
http://mourner.github.io/simpleheat/demo
BSD 2-Clause "Simplified" License
928 stars 185 forks source link

Large optimizations so updated work is only relative to newly added points, not the total number of points #13

Closed danielgjackson closed 8 years ago

danielgjackson commented 9 years ago
  1. Only newly-added data points need to be drawn to the canvas.
  2. Only the "dirty rectangle" around the newly added points has to be re-colorized and drawn on to the canvas
  3. Some changes (e.g. radius/blur/resize) will still trigger a full redraw.
mourner commented 9 years ago

This is cool, but I don't feel good about merging. The performance benefits only cover a very rare use case where you're animating a heatmap where points are added one by one (and not removed), but increases code complexity considerably. I'd want to keep this module as small and simple as possible.

For great performance on tons of changing points, you'd still have to employ a more sophisticated technique like gridding (as done in https://github.com/Leaflet/Leaflet.heat).