@@ -322,10 +322,14 @@ proto.render = function() {
322322 if ( trace . setContourLevels ) trace . setContourLevels ( ) ;
323323 }
324324
325- function formatter ( axisName , val ) {
326- var axis = scene . fullSceneLayout [ axisName ] ;
325+ function formatter ( axLetter , val , hoverformat ) {
326+ var ax = scene . fullSceneLayout [ axLetter + 'axis' ] ;
327327
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 ) ;
329333 }
330334
331335 var oldEventData ;
@@ -337,9 +341,9 @@ proto.render = function() {
337341 var ptNumber = selection . index ;
338342
339343 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 )
343347 } ;
344348
345349 var hoverinfo = Fx . castHoverinfo ( traceNow , scene . fullLayout , ptNumber ) ;
@@ -358,17 +362,17 @@ proto.render = function() {
358362 var vectorTx = [ ] ;
359363
360364 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 ) ;
362366 if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'u' ) !== - 1 ) {
363367 vectorTx . push ( 'u: ' + labels . uLabel ) ;
364368 }
365369
366- labels . vLabel = formatter ( 'yaxis ' , selection . traceCoordinate [ 4 ] ) ;
370+ labels . vLabel = formatter ( 'y ' , selection . traceCoordinate [ 4 ] , trace . vhoverformat ) ;
367371 if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'v' ) !== - 1 ) {
368372 vectorTx . push ( 'v: ' + labels . vLabel ) ;
369373 }
370374
371- labels . wLabel = formatter ( 'zaxis ' , selection . traceCoordinate [ 5 ] ) ;
375+ labels . wLabel = formatter ( 'z ' , selection . traceCoordinate [ 5 ] , trace . whoverformat ) ;
372376 if ( isHoverinfoAll || hoverinfoParts . indexOf ( 'w' ) !== - 1 ) {
373377 vectorTx . push ( 'w: ' + labels . wLabel ) ;
374378 }
@@ -388,7 +392,7 @@ proto.render = function() {
388392 }
389393 tx = vectorTx . join ( '<br>' ) ;
390394 } 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 ) ;
392396 vectorTx . push ( 'value: ' + labels . valueLabel ) ;
393397 if ( selection . textLabel ) {
394398 vectorTx . push ( selection . textLabel ) ;
0 commit comments