@@ -71,28 +71,53 @@ function render(scene) {
71
71
trace = lastPicked . data ;
72
72
var ptNumber = selection . index ;
73
73
var hoverinfo = Fx . castHoverinfo ( trace , scene . fullLayout , ptNumber ) ;
74
+ var hoverinfoParts = hoverinfo . split ( '+' ) ;
75
+ var isHoverinfoAll = hoverinfo === 'all' ;
74
76
75
- var xVal = formatter ( 'xaxis' , selection . traceCoordinate [ 0 ] ) ,
76
- yVal = formatter ( 'yaxis' , selection . traceCoordinate [ 1 ] ) ,
77
- zVal = formatter ( 'zaxis' , selection . traceCoordinate [ 2 ] ) ;
77
+ var xVal = formatter ( 'xaxis' , selection . traceCoordinate [ 0 ] ) ;
78
+ var yVal = formatter ( 'yaxis' , selection . traceCoordinate [ 1 ] ) ;
79
+ var zVal = formatter ( 'zaxis' , selection . traceCoordinate [ 2 ] ) ;
78
80
79
- if ( hoverinfo !== 'all' ) {
80
- var hoverinfoParts = hoverinfo . split ( '+' ) ;
81
+ if ( ! isHoverinfoAll ) {
81
82
if ( hoverinfoParts . indexOf ( 'x' ) === - 1 ) xVal = undefined ;
82
83
if ( hoverinfoParts . indexOf ( 'y' ) === - 1 ) yVal = undefined ;
83
84
if ( hoverinfoParts . indexOf ( 'z' ) === - 1 ) zVal = undefined ;
84
85
if ( hoverinfoParts . indexOf ( 'text' ) === - 1 ) selection . textLabel = undefined ;
85
86
if ( hoverinfoParts . indexOf ( 'name' ) === - 1 ) lastPicked . name = undefined ;
86
87
}
87
88
89
+ var tx ;
90
+
91
+ if ( trace . type === 'cone' ) {
92
+ var coneTx = [ ] ;
93
+ if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'u' ) !== - 1 ) {
94
+ coneTx . push ( 'u: ' + formatter ( 'xaxis' , selection . traceCoordinate [ 3 ] ) ) ;
95
+ }
96
+ if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'v' ) !== - 1 ) {
97
+ coneTx . push ( 'v: ' + formatter ( 'yaxis' , selection . traceCoordinate [ 4 ] ) ) ;
98
+ }
99
+ if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'w' ) !== - 1 ) {
100
+ coneTx . push ( 'w: ' + formatter ( 'zaxis' , selection . traceCoordinate [ 5 ] ) ) ;
101
+ }
102
+ if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'norm' ) !== - 1 ) {
103
+ coneTx . push ( 'norm: ' + selection . traceCoordinate [ 6 ] . toPrecision ( 3 ) ) ;
104
+ }
105
+ if ( selection . textLabel ) {
106
+ coneTx . push ( selection . textLabel ) ;
107
+ }
108
+ tx = coneTx . join ( '<br>' ) ;
109
+ } else {
110
+ tx = selection . textLabel ;
111
+ }
112
+
88
113
if ( scene . fullSceneLayout . hovermode ) {
89
114
Fx . loneHover ( {
90
115
x : ( 0.5 + 0.5 * pdata [ 0 ] / pdata [ 3 ] ) * width ,
91
116
y : ( 0.5 - 0.5 * pdata [ 1 ] / pdata [ 3 ] ) * height ,
92
117
xLabel : xVal ,
93
118
yLabel : yVal ,
94
119
zLabel : zVal ,
95
- text : selection . textLabel ,
120
+ text : tx ,
96
121
name : lastPicked . name ,
97
122
color : Fx . castHoverOption ( trace , ptNumber , 'bgcolor' ) || lastPicked . color ,
98
123
borderColor : Fx . castHoverOption ( trace , ptNumber , 'bordercolor' ) ,
0 commit comments