9
9
10
10
'use strict' ;
11
11
12
- var Lib = require ( '../../lib' ) ;
13
12
var Registry = require ( '../../registry' ) ;
14
13
var Axes = require ( '../../plots/cartesian/axes' ) ;
15
14
var Fx = require ( '../../components/fx' ) ;
@@ -645,11 +644,11 @@ proto.draw = function() {
645
644
zLabel : selection . traceCoord [ 2 ] ,
646
645
text : selection . textLabel ,
647
646
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' )
653
652
} , {
654
653
container : this . svgContainer
655
654
} ) ;
@@ -675,18 +674,3 @@ proto.hoverFormatter = function(axisName, val) {
675
674
var axis = this [ axisName ] ;
676
675
return Axes . tickText ( axis , axis . c2l ( val ) , 'hover' ) . text ;
677
676
} ;
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