GithubHelp home page GithubHelp logo

no2key / webgl-heatmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyalot/webgl-heatmap

0.0 2.0 0.0 192 KB

A high performance WebGL/JS heatmap display library

CoffeeScript 47.61% JavaScript 52.39%

webgl-heatmap's Introduction

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:

  • Webgl is not supported
  • No floating point texture support
  • Floating point render target not supported
  • Shader Compile Error: ...
  • Shader Link Error: ...
try{
    var heatmap = createWebGLHeatmap({canvas: yourCanvas});
}
catch(error){
    // handle the error
}

creation arguments

  • canvas: the canvas you wish to draw on
  • width: explicit width
  • height: explicit height
  • intensityToAlpha: defaults to true
  • gradientTexture: texture used instead of color calculation, can be path or an image

Add a data point.

  • x and y relative to the canvas in pixels
  • size in pixels (radius)
  • intensity between 0 and 1
heatmap.addPoint(x, y, size, intensity);

Add a list of data points.

  • x and y relative to the canvas in pixels
  • size in pixels (radius)
  • intensity between 0 and 1
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 [email protected] http://codeflow.org/

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

  • MIT: see mit-license
  • GPL: see gplv*-license
  • BSD: see bsd-license

webgl-heatmap's People

Contributors

jasondavies avatar pyalot avatar thijsdezoete avatar thinker0 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.