@@ -68,23 +68,28 @@ function render(scene) {
68
68
69
69
if ( lastPicked !== null ) {
70
70
var pdata = project ( scene . glplot . cameraParams , selection . dataCoordinate ) ,
71
- hoverinfo = lastPicked . data . hoverinfo ;
71
+ trace = lastPicked . data ,
72
+ hoverinfo = trace . hoverinfo ;
73
+
74
+ var xVal = formatter ( 'xaxis' , selection . traceCoordinate [ 0 ] ) ,
75
+ yVal = formatter ( 'yaxis' , selection . traceCoordinate [ 1 ] ) ,
76
+ zVal = formatter ( 'zaxis' , selection . traceCoordinate [ 2 ] ) ;
72
77
73
78
if ( hoverinfo !== 'all' ) {
74
79
var hoverinfoParts = hoverinfo . split ( '+' ) ;
75
- if ( hoverinfoParts . indexOf ( 'x' ) === - 1 ) selection . traceCoordinate [ 0 ] = undefined ;
76
- if ( hoverinfoParts . indexOf ( 'y' ) === - 1 ) selection . traceCoordinate [ 1 ] = undefined ;
77
- if ( hoverinfoParts . indexOf ( 'z' ) === - 1 ) selection . traceCoordinate [ 2 ] = undefined ;
80
+ if ( hoverinfoParts . indexOf ( 'x' ) === - 1 ) xVal = undefined ;
81
+ if ( hoverinfoParts . indexOf ( 'y' ) === - 1 ) yVal = undefined ;
82
+ if ( hoverinfoParts . indexOf ( 'z' ) === - 1 ) zVal = undefined ;
78
83
if ( hoverinfoParts . indexOf ( 'text' ) === - 1 ) selection . textLabel = undefined ;
79
84
if ( hoverinfoParts . indexOf ( 'name' ) === - 1 ) lastPicked . name = undefined ;
80
85
}
81
86
82
87
Fx . loneHover ( {
83
- x : ( 0.5 + 0.5 * pdata [ 0 ] / pdata [ 3 ] ) * width ,
84
- y : ( 0.5 - 0.5 * pdata [ 1 ] / pdata [ 3 ] ) * height ,
85
- xLabel : formatter ( 'xaxis' , selection . traceCoordinate [ 0 ] ) ,
86
- yLabel : formatter ( 'yaxis' , selection . traceCoordinate [ 1 ] ) ,
87
- zLabel : formatter ( 'zaxis' , selection . traceCoordinate [ 2 ] ) ,
88
+ x : ( 0.5 + 0.5 * pdata [ 0 ] / pdata [ 3 ] ) * width ,
89
+ y : ( 0.5 - 0.5 * pdata [ 1 ] / pdata [ 3 ] ) * height ,
90
+ xLabel : xVal ,
91
+ yLabel : yVal ,
92
+ zLabel : zVal ,
88
93
text : selection . textLabel ,
89
94
name : lastPicked . name ,
90
95
color : lastPicked . color
0 commit comments