File tree 3 files changed +21
-11
lines changed
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) {
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 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 ;
66
69
67
70
return {
68
71
trace : this ,
69
72
dataCoord : pickResult . dataCoord ,
70
73
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 ]
74
77
] ,
75
78
textLabel : this . textLabels [ index ] ,
76
79
name : this . name ,
80
+ pointIndex : [ xIndex , yIndex , zIndex ] ,
77
81
hoverinfo : this . hoverinfo
78
82
} ;
79
83
} ;
Original file line number Diff line number Diff line change @@ -46,19 +46,24 @@ 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 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 ;
51
55
52
56
return {
53
57
trace : this ,
54
58
dataCoord : pickResult . dataCoord ,
55
59
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 ]
59
63
] ,
60
64
textLabel : this . textLabels [ index ] ,
61
65
name : this . name ,
66
+ pointIndex : [ xIndex , yIndex , zIndex ] ,
62
67
hoverinfo : this . hoverinfo
63
68
} ;
64
69
} ;
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