Giter Site home page Giter Site logo

alihesari / simpleheat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mourner/simpleheat

0.0 1.0 0.0 34 KB

A tiny JavaScript library for drawing heatmaps with Canvas

Home Page: http://mourner.github.io/simpleheat/demo

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%

simpleheat's Introduction

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

simpleheat('canvas').data(data).draw();

Reference

Constructor

// create a simpleheat object given an id or canvas reference
var heat = simpleheat(canvas);

Data

// set data of [[x, y, value], ...] format
heat.data(data);

// set max data value (1 by default)
heat.max(max);

// add a data point
heat.add(point);

// clear data
heat.clear();

Appearance

// set point radius and blur radius (25 and 15 by default)
heat.radius(r, r2);

// set gradient colors as {<stop>: '<color>'}, e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'}
heat.gradient(grad);

// call in case Canvas size changed
heat.resize();

Rendering

// draw the heatmap with optional minimum point opacity (0.05 by default)
heat.draw(minOpacity);

simpleheat's People

Contributors

mourner avatar fuzhenn avatar marcelhohn avatar kiu avatar leorohr avatar

Watchers

James Cloos 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.