šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

heatmap-gl

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heatmap-gl

WebGL2 powered fast heatmaps for spectrograms and more

1.0.2
latest
Source
npm
Version published
Maintainers
1
Created
Source

Heatmap-GL

WebGL2 powered fast heatmaps for spectrograms, analytics, scientific computing and more

Install

Just fetch this from npm via command line

npm install heatmap-gl

How to use


import { HeatmapGL } from "heatmap-gl";

var heatmapGL = new HeatmapGL(someDomElement)

// specify gradient
heatmapGL.gradient = [
    {
        color: [84, 33, 119, 1],
        offset: 0
    }, {
        color: [253, 29, 29, 1],
        offset: 100
    }, {
        color: [255, 166, 0, 1],
        offset: 200
    }, {
        color: [224, 249, 18, 1],
        offset: 300
    }
];

// make random data
var width = 512;
var height = 512;

var data = Array(width * height);

var i = 0;
for (var y = 0; y < height; y++) {
    for (var x = 0; x < width; x++) {
        data[i++] = Math.random() * 300; // set your values here
    }
}

// set data and render
heatmapGL.width = width;
heatmapGL.height = height;
heatmapGL.data = data;
heatmapGL.render();

Explore the examples directory for demos that you can run on your browser.

Purpose

There are lots of heatmaps for javascript. Almost all of them are just for user tracking (they only support drawing circles). I created a general purpose heatmap library that can accept raw data and be used for all sort of scientific and medical applications.

Stay In Touch

For latest releases and announcements, check out my site: aliashraf.net

License

This software is released under the MIT License. Please read LICENSE for information on the software availability and distribution.

Copyright (c) 2022 Ali Ashraf

Keywords

heatmap

FAQs

Package last updated on 06 Feb 2022

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