File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed
Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -60,20 +60,24 @@ function Contour(scene, uid) {
6060var proto = Contour . prototype ;
6161
6262proto . handlePick = function ( pickResult ) {
63- var index = pickResult . pointId ,
64- options = this . heatmapOptions ,
65- shape = options . shape ;
63+ var options = this . heatmapOptions ,
64+ shape = options . shape ,
65+ index = pickResult . pointId ,
66+ xIndex = index % shape [ 0 ] ,
67+ yIndex = Math . floor ( index / shape [ 0 ] ) ,
68+ zIndex = index ;
6669
6770 return {
6871 trace : this ,
6972 dataCoord : pickResult . dataCoord ,
7073 traceCoord : [
71- options . x [ index % shape [ 0 ] ] ,
72- options . y [ Math . floor ( index / shape [ 0 ] ) ] ,
73- options . z [ index ]
74+ options . x [ xIndex ] ,
75+ options . y [ yIndex ] ,
76+ options . z [ zIndex ]
7477 ] ,
7578 textLabel : this . textLabels [ index ] ,
7679 name : this . name ,
80+ pointIndex : [ xIndex , yIndex , zIndex ] ,
7781 hoverinfo : this . hoverinfo
7882 } ;
7983} ;
Original file line number Diff line number Diff line change @@ -46,19 +46,24 @@ function Heatmap(scene, uid) {
4646var proto = Heatmap . prototype ;
4747
4848proto . handlePick = function ( pickResult ) {
49- var index = pickResult . pointId ,
50- shape = this . options . shape ;
49+ var options = this . options ,
50+ shape = options . shape ,
51+ index = pickResult . pointId ,
52+ xIndex = index % shape [ 0 ] ,
53+ yIndex = Math . floor ( index / shape [ 0 ] ) ,
54+ zIndex = index ;
5155
5256 return {
5357 trace : this ,
5458 dataCoord : pickResult . dataCoord ,
5559 traceCoord : [
56- this . options . x [ index % shape [ 0 ] ] ,
57- this . options . y [ Math . floor ( index / shape [ 0 ] ) ] ,
58- this . options . z [ index ]
60+ options . x [ xIndex ] ,
61+ options . y [ yIndex ] ,
62+ options . z [ zIndex ]
5963 ] ,
6064 textLabel : this . textLabels [ index ] ,
6165 name : this . name ,
66+ pointIndex : [ xIndex , yIndex , zIndex ] ,
6267 hoverinfo : this . hoverinfo
6368 } ;
6469} ;
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ proto.handlePick = function(pickResult) {
6363 this . textLabels ,
6464 color : this . color ,
6565 name : this . name ,
66+ pointIndex : index ,
6667 hoverinfo : this . hoverinfo
6768 } ;
6869} ;
You can’t perform that action at this time.
0 commit comments