Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webgl-heatmap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webgl-heatmap

A commonJS compatible version of pyalot's webgl-heatmap

  • 0.2.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
373
decreased by-4.6%
Maintainers
1
Weekly downloads
 
Created
Source

WebGL Heatmap

This is a fork of Florian Boesch's excellent WebGL Heatmap to support CommonJS and and to make it available from NPM. To install it run:

npm install webgl-heatmap

webgl-heatmap 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 = new WebGLHeatmap({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()

Keywords

FAQs

Package last updated on 19 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc