99
1010'use strict' ;
1111
12- var Lib = require ( '../../lib' ) ;
1312var Registry = require ( '../../registry' ) ;
1413var Axes = require ( '../../plots/cartesian/axes' ) ;
1514var Fx = require ( '../../components/fx' ) ;
@@ -645,11 +644,11 @@ proto.draw = function() {
645644 zLabel : selection . traceCoord [ 2 ] ,
646645 text : selection . textLabel ,
647646 name : selection . name ,
648- color : this . castHoverOption ( trace , ptNumber , 'bgcolor' ) || selection . color ,
649- borderColor : this . castHoverOption ( trace , ptNumber , 'bordercolor' ) ,
650- fontFamily : this . castHoverOption ( trace , ptNumber , 'font.family' ) ,
651- fontSize : this . castHoverOption ( trace , ptNumber , 'font.size' ) ,
652- fontColor : this . castHoverOption ( trace , ptNumber , 'font.color' )
647+ color : Fx . castHoverOption ( trace , ptNumber , 'bgcolor' ) || selection . color ,
648+ borderColor : Fx . castHoverOption ( trace , ptNumber , 'bordercolor' ) ,
649+ fontFamily : Fx . castHoverOption ( trace , ptNumber , 'font.family' ) ,
650+ fontSize : Fx . castHoverOption ( trace , ptNumber , 'font.size' ) ,
651+ fontColor : Fx . castHoverOption ( trace , ptNumber , 'font.color' )
653652 } , {
654653 container : this . svgContainer
655654 } ) ;
@@ -675,18 +674,3 @@ proto.hoverFormatter = function(axisName, val) {
675674 var axis = this [ axisName ] ;
676675 return Axes . tickText ( axis , axis . c2l ( val ) , 'hover' ) . text ;
677676} ;
678-
679- proto . castHoverOption = function ( trace , ptNumber , attr ) {
680- var labelOpts = trace . hoverlabel || { } ;
681- var val = Lib . nestedProperty ( labelOpts , attr ) . get ( ) ;
682-
683- if ( Array . isArray ( val ) ) {
684- if ( Array . isArray ( ptNumber ) && Array . isArray ( val [ ptNumber [ 0 ] ] ) ) {
685- return val [ ptNumber [ 0 ] ] [ ptNumber [ 1 ] ] ;
686- } else {
687- return val [ ptNumber ] ;
688- }
689- } else {
690- return val ;
691- }
692- } ;
0 commit comments