File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed
Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import ReactDom from 'react-dom' ;
3- import PropTypes from 'prop-types' ;
43import ReactHeatmap from 'react-heatmap' ;
54
65class ReactHeatmapExample extends React . Component {
7- render ( ) {
6+ render ( ) {
7+ var points = [ ] ;
8+ var max = 0 ;
9+ var width = 840 ;
10+ var height = 400 ;
11+ var len = 300 ;
12+
13+ while ( len -- ) {
14+ var val = Math . floor ( Math . random ( ) * 100 ) ;
15+ // now also with custom radius
16+ var radius = Math . floor ( Math . random ( ) * 70 ) ;
17+
18+ max = Math . max ( max , val ) ;
19+ var point = {
20+ x : Math . floor ( Math . random ( ) * width ) ,
21+ y : Math . floor ( Math . random ( ) * height ) ,
22+ value : val ,
23+ // radius configuration on point basis
24+ radius : radius
25+ } ;
26+ points . push ( point ) ;
27+ }
28+
829 return (
9- < div > < ReactHeatmap /> </ div >
30+ < div style = { { width : '840px' , height : '400px' } } >
31+ < ReactHeatmap max = { max } data = { points } unit = "notPercent" />
32+ </ div >
1033 ) ;
1134 }
1235}
1336
14- ReactDom . render ( < ReactHeatmapExample /> , document . querySelector ( '#app' ) ) ;
37+ ReactDom . render ( < ReactHeatmapExample /> , document . querySelector ( '#app' ) ) ;
Original file line number Diff line number Diff line change 1919 "webpack-dev-server" : " ^2.4.2"
2020 },
2121 "dependencies" : {
22+ "heatmap.js" : " ^2.0.5" ,
2223 "prop-types" : " ^15.5.8" ,
2324 "react" : " ^15.5.4" ,
2425 "react-dom" : " ^15.5.4" ,
Original file line number Diff line number Diff line change @@ -2645,10 +2645,12 @@ react-dom@^15.5.4:
26452645
26462646" react-heatmap@https://github.com/benweizhu/react-heatmap.git " :
26472647 version "1.0.0"
2648- resolved "https://github.com/benweizhu/react-heatmap.git#0ce333cb85839ee514d3ac459e7f470627bd44ff "
2648+ resolved "https://github.com/benweizhu/react-heatmap.git#e0caa82f6604884820185f577fef1cc5cfc2cfea "
26492649 dependencies :
26502650 heatmap.js "^2.0.5"
2651- prop-types "^15.5.7"
2651+ prop-types "^15.5.8"
2652+ react "^15.5.4"
2653+ react-dom "^15.5.4"
26522654
26532655react@^15.5.4 :
26542656 version "15.5.4"
You can’t perform that action at this time.
0 commit comments