@@ -34,6 +34,9 @@ var ONESEC = constants.ONESEC;
3434var MINUS_SIGN = constants . MINUS_SIGN ;
3535var BADNUM = constants . BADNUM ;
3636
37+ var VISIBLE = { visibility : 'visible' } ;
38+ var HIDDEN = { visibility : 'hidden' } ;
39+
3740var alignmentConstants = require ( '../../constants/alignment' ) ;
3841var MID_SHIFT = alignmentConstants . MID_SHIFT ;
3942var CAP_SHIFT = alignmentConstants . CAP_SHIFT ;
@@ -2865,7 +2868,7 @@ axes.drawGrid = function(gd, ax, opts) {
28652868 . attr ( 'd' , opts . path )
28662869 . call ( Color . stroke , ax . gridcolor || '#ddd' )
28672870 . style ( 'stroke-width' , ax . _gw + 'px' )
2868- . style ( { visibility : 'visible' } ) ;
2871+ . style ( VISIBLE ) ;
28692872
28702873 if ( ( ( ax . _anchorAxis || { } ) . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
28712874 if ( ax . _hideCounterAxisInsideTickLabels ) {
@@ -3035,7 +3038,7 @@ axes.drawLabels = function(gd, ax, opts) {
30353038 } ) ;
30363039
30373040 if ( isInside ) {
3038- thisText . style ( { visibility : 'visible' } ) ;
3041+ thisText . style ( VISIBLE ) ;
30393042
30403043 if ( ax . _hideOutOfRangeInsideTickLabels ) {
30413044 ax . _hideOutOfRangeInsideTickLabels ( ) ;
@@ -3080,7 +3083,7 @@ axes.drawLabels = function(gd, ax, opts) {
30803083 else if ( bb . top + ( ax . tickangle ? 0 : d . fontSize / 4 ) < min ) hide = true ;
30813084 }
30823085 if ( hide ) {
3083- thisLabel . select ( 'text' ) . style ( { visibility : 'hidden' } ) ;
3086+ thisLabel . select ( 'text' ) . style ( HIDDEN ) ;
30843087 } else {
30853088 visibleLabelMin = Math . min ( visibleLabelMin , isX ? bb . top : bb . left ) ;
30863089 visibleLabelMax = Math . max ( visibleLabelMax , isX ? bb . bottom : bb . right ) ;
@@ -3103,7 +3106,7 @@ axes.drawLabels = function(gd, ax, opts) {
31033106 var q = ax . l2p ( d . x ) + ax . _offset ;
31043107
31053108 if ( q < ax . _visibleLabelMax && q > ax . _visibleLabelMin ) {
3106- d3 . select ( this ) . style ( { visibility : 'hidden' } ) ;
3109+ d3 . select ( this ) . style ( HIDDEN ) ;
31073110 }
31083111 } ) ;
31093112 } ) ;
0 commit comments