@@ -50,28 +50,33 @@ proto.handlePick = function(selection) {
5050 ( selection . object === this . linePlot ||
5151 selection . object === this . delaunayMesh ||
5252 selection . object === this . textMarkers ||
53- selection . object === this . scatterPlot ) ) {
53+ selection . object === this . scatterPlot )
54+ ) {
55+ var ind = selection . index = selection . data . index ;
56+
5457 if ( selection . object . highlight ) {
5558 selection . object . highlight ( null ) ;
5659 }
5760 if ( this . scatterPlot ) {
5861 selection . object = this . scatterPlot ;
5962 this . scatterPlot . highlight ( selection . data ) ;
6063 }
64+
65+ selection . textLabel = '' ;
6166 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+ }
6471 } else {
6572 selection . textLabel = this . textLabels ;
6673 }
6774 }
68- else selection . textLabel = '' ;
6975
70- var selectIndex = selection . index = selection . data . index ;
7176 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 ]
7580 ] ;
7681
7782 return true ;
0 commit comments