pyalot / webgl-heatmap

A high performance WebGL/JS heatmap display library
906 stars 149 forks source link

WebGL Heatmap

webgl-heatmap.js is a JavaScript library for high performance heatmap display.

Demo

Live Demo at codeflow.org

How to use it

Instantiate a new heatmap, errors can be one of:

try{
    var heatmap = createWebGLHeatmap({canvas: yourCanvas});
}
catch(error){
    // handle the error
}

creation arguments

Add a data point.

heatmap.addPoint(x, y, size, intensity);

Add a list of data points.

heatmap.addPoints([{x:x, y:y, size:size, intensity:intensity}]);

Draw queued data points:

heatmap.update()

Display the heatmap

heatmap.display()

Multiply all values in the heatmap by a number (useful for decay)

heatmap.multiply(0.995)

Clamp all values in the heatmap to between two values:

heatmap.clamp(0.0, 1.0)

Blur all values a little:

heatmap.blur()

License

Copyright (c) 2013, Florian Boesch pyalot@gmail.com http://codeflow.org/

WebGL Heatmap is licensed under any of the following licenses at your choosing: