simpleheat
A super-tiny JavaScript library for drawing heatmaps with Canvas. Inspired by heatmap.js, but with focus on simplicity and performance.
Powers Leaflet.heat, a heatmap plugin for Leaflet.
Demo: http://mourner.github.io/simpleheat/demo
datadata;
Reference
Constructor
// create a simpleheat object given an id or canvas referencevar heat = ;
Data
// set data of [[x, y, value], ...] formatheatdatadata; // set max data value (1 by default)heat; // add a data pointheat; // clear dataheatclear;
Appearance
// set point radius and blur radius (25 and 15 by default)heat; // set gradient colors as {<stop>: '<color>'}, e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'}heat; // call in case Canvas size changedheat;
Rendering
// draw the heatmap with optional minimum point opacity (0.05 by default)heat;