File tree Expand file tree Collapse file tree 1 file changed +46
-1
lines changed
Expand file tree Collapse file tree 1 file changed +46
-1
lines changed Original file line number Diff line number Diff line change 1- # react-heatmap
1+ # react-heatmap
2+
3+ A React Component based on [ heatmap.js] [ b7fa289f ] .
4+
5+ [ b7fa289f ] : https://www.patrick-wied.at/static/heatmapjs/ " heatmap.js "
6+
7+ ```
8+ import React from 'react';
9+ import ReactDom from 'react-dom';
10+ import ReactHeatmap from 'react-heatmap';
11+
12+ class ReactHeatmapExample extends React.Component {
13+ render() {
14+ var points = [];
15+ var max = 0;
16+ var width = 840;
17+ var height = 400;
18+ var len = 300;
19+
20+ while (len--) {
21+ var val = Math.floor(Math.random() * 100);
22+ // now also with custom radius
23+ var radius = Math.floor(Math.random() * 70);
24+
25+ max = Math.max(max, val);
26+ var point = {
27+ x: Math.floor(Math.random() * width),
28+ y: Math.floor(Math.random() * height),
29+ value: val,
30+ // radius configuration on point basis
31+ radius: radius
32+ };
33+ points.push(point);
34+ }
35+
36+ return (
37+ <div style={{ width: '840px', height: '400px' }}>
38+ < ReactHeatmap max= { max } data= { points } unit= "notPercent" />
39+ </div >
40+ );
41+ }
42+ }
43+
44+ ReactDom.render(<ReactHeatmapExample />, document.querySelector('#app'));
45+
46+ ```
You can’t perform that action at this time.
0 commit comments