Skip to content
项目

mourner/simpleheat has 958 GitHub stars and 185 forks. GitHot measured 0 stars in 24 hours and -1 in 7 days. Last checked 2026-11-25 01:04 UTC. Last push 2026-10-26.

这些数字如何统计

实测星标增长

24小时
0
7天
-1
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

一个用于通过 Canvas 绘制热力图的轻量级 JavaScript 库。

创作与媒体

README.md

原文

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.

import SimpleHeat from 'simpleheat';

new SimpleHeat('canvas').data(data).draw();

Build Status Simply Awesome

Demo

Reference

Constructor

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

Data

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

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

// add a data point
heat.add([10, 10, 5.3]);

// clear data
heat.clear();

Appearance

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

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

Rendering

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

探索相关项目

加载中…