@@ -322,10 +322,14 @@ proto.render = function() {
322
322
if ( trace . setContourLevels ) trace . setContourLevels ( ) ;
323
323
}
324
324
325
- function formatter ( axisName , val ) {
326
- var axis = scene . fullSceneLayout [ axisName ] ;
325
+ function formatter ( axLetter , val , hoverformat ) {
326
+ var ax = scene . fullSceneLayout [ axLetter + 'axis' ] ;
327
327
328
- return Axes . tickText ( axis , axis . d2l ( val ) , 'hover' ) . text ;
328
+ if ( ax . type !== 'log' ) {
329
+ val = ax . d2l ( val ) ;
330
+ }
331
+
332
+ return Axes . hoverLabelText ( ax , val , hoverformat ) ;
329
333
}
330
334
331
335
var oldEventData ;
@@ -337,9 +341,9 @@ proto.render = function() {
337
341
var ptNumber = selection . index ;
338
342
339
343
var labels = {
340
- xLabel : formatter ( 'xaxis ' , selection . traceCoordinate [ 0 ] ) ,
341
- yLabel : formatter ( 'yaxis ' , selection . traceCoordinate [ 1 ] ) ,
342
- zLabel : formatter ( 'zaxis ' , selection . traceCoordinate [ 2 ] )
344
+ xLabel : formatter ( 'x ' , selection . traceCoordinate [ 0 ] , trace . xhoverformat ) ,
345
+ yLabel : formatter ( 'y ' , selection . traceCoordinate [ 1 ] , trace . yhoverformat ) ,
346
+ zLabel : formatter ( 'z ' , selection . traceCoordinate [ 2 ] , trace . zhoverformat )
343
347
} ;
344
348
345
349
var hoverinfo = Fx . castHoverinfo ( traceNow , scene . fullLayout , ptNumber ) ;
@@ -358,17 +362,17 @@ proto.render = function() {
358
362
var vectorTx = [ ] ;
359
363
360
364
if ( trace . type === 'cone' || trace . type === 'streamtube' ) {
361
- labels . uLabel = formatter ( 'xaxis ' , selection . traceCoordinate [ 3 ] ) ;
365
+ labels . uLabel = formatter ( 'x ' , selection . traceCoordinate [ 3 ] , trace . uhoverformat ) ;
362
366
if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'u' ) !== - 1 ) {
363
367
vectorTx . push ( 'u: ' + labels . uLabel ) ;
364
368
}
365
369
366
- labels . vLabel = formatter ( 'yaxis ' , selection . traceCoordinate [ 4 ] ) ;
370
+ labels . vLabel = formatter ( 'y ' , selection . traceCoordinate [ 4 ] , trace . vhoverformat ) ;
367
371
if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'v' ) !== - 1 ) {
368
372
vectorTx . push ( 'v: ' + labels . vLabel ) ;
369
373
}
370
374
371
- labels . wLabel = formatter ( 'zaxis ' , selection . traceCoordinate [ 5 ] ) ;
375
+ labels . wLabel = formatter ( 'z ' , selection . traceCoordinate [ 5 ] , trace . whoverformat ) ;
372
376
if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'w' ) !== - 1 ) {
373
377
vectorTx . push ( 'w: ' + labels . wLabel ) ;
374
378
}
@@ -388,7 +392,7 @@ proto.render = function() {
388
392
}
389
393
tx = vectorTx . join ( '<br>' ) ;
390
394
} else if ( trace . type === 'isosurface' || trace . type === 'volume' ) {
391
- labels . valueLabel = Axes . tickText ( scene . _mockAxis , scene . _mockAxis . d2l ( selection . traceCoordinate [ 3 ] ) , 'hover' ) . text ;
395
+ labels . valueLabel = Axes . hoverLabelText ( scene . _mockAxis , scene . _mockAxis . d2l ( selection . traceCoordinate [ 3 ] ) , trace . valuehoverformat ) ;
392
396
vectorTx . push ( 'value: ' + labels . valueLabel ) ;
393
397
if ( selection . textLabel ) {
394
398
vectorTx . push ( selection . textLabel ) ;
0 commit comments