@@ -50,28 +50,33 @@ proto.handlePick = function(selection) {
50
50
( selection . object === this . linePlot ||
51
51
selection . object === this . delaunayMesh ||
52
52
selection . object === this . textMarkers ||
53
- selection . object === this . scatterPlot ) ) {
53
+ selection . object === this . scatterPlot )
54
+ ) {
55
+ var ind = selection . index = selection . data . index ;
56
+
54
57
if ( selection . object . highlight ) {
55
58
selection . object . highlight ( null ) ;
56
59
}
57
60
if ( this . scatterPlot ) {
58
61
selection . object = this . scatterPlot ;
59
62
this . scatterPlot . highlight ( selection . data ) ;
60
63
}
64
+
65
+ selection . textLabel = '' ;
61
66
if ( this . textLabels ) {
62
- if ( this . textLabels [ selection . data . index ] !== undefined ) {
63
- selection . textLabel = this . textLabels [ selection . data . index ] ;
67
+ if ( Array . isArray ( this . textLabels ) ) {
68
+ if ( this . textLabels [ ind ] || this . textLabels [ ind ] === 0 ) {
69
+ selection . textLabel = this . textLabels [ ind ] ;
70
+ }
64
71
} else {
65
72
selection . textLabel = this . textLabels ;
66
73
}
67
74
}
68
- else selection . textLabel = '' ;
69
75
70
- var selectIndex = selection . index = selection . data . index ;
71
76
selection . traceCoordinate = [
72
- this . data . x [ selectIndex ] ,
73
- this . data . y [ selectIndex ] ,
74
- this . data . z [ selectIndex ]
77
+ this . data . x [ ind ] ,
78
+ this . data . y [ ind ] ,
79
+ this . data . z [ ind ]
75
80
] ;
76
81
77
82
return true ;
0 commit comments