@@ -523,28 +523,28 @@ function _hover(gd, evt, subplot) {
523523}
524524
525525function createHoverText ( hoverData , opts ) {
526- var hovermode = opts . hovermode ,
527- rotateLabels = opts . rotateLabels ,
528- bgColor = opts . bgColor ,
529- container = opts . container ,
530- outerContainer = opts . outerContainer ,
531-
532- // opts.fontFamily/Size are used for the common label
533- // and as defaults for each hover label, though the individual labels
534- // can override this.
535- fontFamily = opts . fontFamily || constants . HOVERFONT ,
536- fontSize = opts . fontSize || constants . HOVERFONTSIZE ,
537-
538- c0 = hoverData [ 0 ] ,
539- xa = c0 . xa ,
540- ya = c0 . ya ,
541- commonAttr = hovermode === 'y' ? 'yLabel' : 'xLabel' ,
542- t0 = c0 [ commonAttr ] ,
543- t00 = ( String ( t0 ) || '' ) . split ( ' ' ) [ 0 ] ,
544- outerContainerBB = outerContainer . node ( ) . getBoundingClientRect ( ) ,
545- outerTop = outerContainerBB . top ,
546- outerWidth = outerContainerBB . width ,
547- outerHeight = outerContainerBB . height ;
526+ var hovermode = opts . hovermode ;
527+ var rotateLabels = opts . rotateLabels ;
528+ var bgColor = opts . bgColor ;
529+ var container = opts . container ;
530+ var outerContainer = opts . outerContainer ;
531+
532+ // opts.fontFamily/Size are used for the common label
533+ // and as defaults for each hover label, though the individual labels
534+ // can override this.
535+ var fontFamily = opts . fontFamily || constants . HOVERFONT ;
536+ var fontSize = opts . fontSize || constants . HOVERFONTSIZE ;
537+
538+ var c0 = hoverData [ 0 ] ;
539+ var xa = c0 . xa ;
540+ var ya = c0 . ya ;
541+ var commonAttr = hovermode === 'y' ? 'yLabel' : 'xLabel' ;
542+ var t0 = c0 [ commonAttr ] ;
543+ var t00 = ( String ( t0 ) || '' ) . split ( ' ' ) [ 0 ] ;
544+ var outerContainerBB = outerContainer . node ( ) . getBoundingClientRect ( ) ;
545+ var outerTop = outerContainerBB . top ;
546+ var outerWidth = outerContainerBB . width ;
547+ var outerHeight = outerContainerBB . height ;
548548
549549 // show the common label, if any, on the axis
550550 // never show a common label in array mode,
@@ -674,14 +674,14 @@ function createHoverText(hoverData, opts) {
674674 hoverLabels . each ( function ( d ) {
675675 var g = d3 . select ( this ) . attr ( 'transform' , '' ) ,
676676 name = '' ,
677- text = '' ,
677+ text = '' ;
678+
678679 // combine possible non-opaque trace color with bgColor
679- baseColor = Color . opacity ( d . color ) ?
680- d . color : Color . defaultLine ,
681- traceColor = Color . combine ( baseColor , bgColor ) ,
680+ var baseColor = Color . opacity ( d . color ) ? d . color : Color . defaultLine ;
681+ var traceColor = Color . combine ( baseColor , bgColor ) ;
682682
683- // find a contrasting color for border and text
684- contrastColor = d . borderColor || Color . contrast ( traceColor ) ;
683+ // find a contrasting color for border and text
684+ var contrastColor = d . borderColor || Color . contrast ( traceColor ) ;
685685
686686 // to get custom 'name' labels pass cleanPoint
687687 if ( d . nameOverride !== undefined ) d . name = d . nameOverride ;
0 commit comments