File tree 3 files changed +19
-11
lines changed
3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -60,20 +60,23 @@ function Contour(scene, uid) {
60
60
var proto = Contour . prototype ;
61
61
62
62
proto . handlePick = function ( pickResult ) {
63
- var index = pickResult . pointId ,
64
- options = this . heatmapOptions ,
65
- shape = options . shape ;
63
+ var shape = this . options . shape ,
64
+ index = pickResult . pointId ,
65
+ xIndex = index % shape [ 0 ] ,
66
+ yIndex = Math . floor ( index / shape [ 0 ] ) ,
67
+ zIndex = index ;
66
68
67
69
return {
68
70
trace : this ,
69
71
dataCoord : pickResult . dataCoord ,
70
72
traceCoord : [
71
- options . x [ index % shape [ 0 ] ] ,
72
- options . y [ Math . floor ( index / shape [ 0 ] ) ] ,
73
- options . z [ index ]
73
+ this . options . x [ xIndex ] ,
74
+ this . options . y [ yIndex ] ,
75
+ this . options . z [ zIndex ]
74
76
] ,
75
77
textLabel : this . textLabels [ index ] ,
76
78
name : this . name ,
79
+ pointIndex : [ xIndex , yIndex , zIndex ] ,
77
80
hoverinfo : this . hoverinfo
78
81
} ;
79
82
} ;
Original file line number Diff line number Diff line change @@ -46,19 +46,23 @@ function Heatmap(scene, uid) {
46
46
var proto = Heatmap . prototype ;
47
47
48
48
proto . handlePick = function ( pickResult ) {
49
- var index = pickResult . pointId ,
50
- shape = this . options . shape ;
49
+ var shape = this . options . shape ,
50
+ index = pickResult . pointId ,
51
+ xIndex = index % shape [ 0 ] ,
52
+ yIndex = Math . floor ( index / shape [ 0 ] ) ,
53
+ zIndex = index ;
51
54
52
55
return {
53
56
trace : this ,
54
57
dataCoord : pickResult . dataCoord ,
55
58
traceCoord : [
56
- this . options . x [ index % shape [ 0 ] ] ,
57
- this . options . y [ Math . floor ( index / shape [ 0 ] ) ] ,
58
- this . options . z [ index ]
59
+ this . options . x [ xIndex ] ,
60
+ this . options . y [ yIndex ] ,
61
+ this . options . z [ zIndex ]
59
62
] ,
60
63
textLabel : this . textLabels [ index ] ,
61
64
name : this . name ,
65
+ pointIndex : [ xIndex , yIndex , zIndex ] ,
62
66
hoverinfo : this . hoverinfo
63
67
} ;
64
68
} ;
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ proto.handlePick = function(pickResult) {
63
63
this . textLabels ,
64
64
color : this . color ,
65
65
name : this . name ,
66
+ pointIndex : index ,
66
67
hoverinfo : this . hoverinfo
67
68
} ;
68
69
} ;
You can’t perform that action at this time.
0 commit comments