@@ -37,6 +37,11 @@ var BADNUM = constants.BADNUM;
37
37
var VISIBLE = { visibility : 'visible' } ;
38
38
var HIDDEN = { visibility : 'hidden' } ;
39
39
40
+ var GRID_PATH = { K : 'gridline' , L : 'path' } ;
41
+ var ZERO_PATH = { K : 'zeroline' , L : 'path' } ;
42
+ var TICK_PATH = { K : 'tick' , L : 'path' } ;
43
+ var TICK_TEXT = { K : 'tick' , L : 'text' } ;
44
+
40
45
var alignmentConstants = require ( '../../constants/alignment' ) ;
41
46
var MID_SHIFT = alignmentConstants . MID_SHIFT ;
42
47
var CAP_SHIFT = alignmentConstants . CAP_SHIFT ;
@@ -2807,7 +2812,7 @@ axes.drawTicks = function(gd, ax, opts) {
2807
2812
. attr ( 'd' , opts . path )
2808
2813
. style ( VISIBLE ) ;
2809
2814
2810
- hideCounterAxisInsideTickLabels ( ax ) ;
2815
+ hideCounterAxisInsideTickLabels ( ax , [ TICK_PATH ] ) ;
2811
2816
2812
2817
ticks . attr ( 'transform' , opts . transFn ) ;
2813
2818
} ;
@@ -2873,7 +2878,7 @@ axes.drawGrid = function(gd, ax, opts) {
2873
2878
. style ( 'stroke-width' , ax . _gw + 'px' )
2874
2879
. style ( VISIBLE ) ;
2875
2880
2876
- hideCounterAxisInsideTickLabels ( ax ) ;
2881
+ hideCounterAxisInsideTickLabels ( ax , [ GRID_PATH ] ) ;
2877
2882
2878
2883
if ( typeof opts . path === 'function' ) grid . attr ( 'd' , opts . path ) ;
2879
2884
} ;
@@ -2925,7 +2930,7 @@ axes.drawZeroLine = function(gd, ax, opts) {
2925
2930
. style ( 'stroke-width' , Drawing . crispRound ( gd , ax . zerolinewidth , ax . _gw || 1 ) + 'px' )
2926
2931
. style ( VISIBLE ) ;
2927
2932
2928
- hideCounterAxisInsideTickLabels ( ax ) ;
2933
+ hideCounterAxisInsideTickLabels ( ax , [ ZERO_PATH ] ) ;
2929
2934
} ;
2930
2935
2931
2936
/**
@@ -3102,21 +3107,18 @@ axes.drawLabels = function(gd, ax, opts) {
3102
3107
}
3103
3108
} ;
3104
3109
3105
- ax . _hideCounterAxisInsideTickLabels = function ( ) {
3110
+ ax . _hideCounterAxisInsideTickLabels = function ( partialOpts ) {
3106
3111
if ( insideTicklabelposition ( ax . _anchorAxis || { } ) ) {
3107
- [
3108
- { K : 'gridline' , L : 'path' } ,
3109
- { K : 'zeroline' , L : 'path' } ,
3110
- { K : 'tick' , L : 'path' } ,
3111
- { K : 'tick' , L : 'text' }
3112
-
3113
- ] . forEach ( function ( e ) {
3114
- var isX = ax . _id . charAt ( 0 ) === 'x' ;
3115
-
3112
+ ( partialOpts || [
3113
+ GRID_PATH ,
3114
+ ZERO_PATH ,
3115
+ TICK_PATH ,
3116
+ TICK_TEXT
3117
+ ] ) . forEach ( function ( e ) {
3116
3118
var sel ;
3117
3119
if ( e . K === 'gridline' ) sel = opts . plotinfo . gridlayer ;
3118
3120
else if ( e . K === 'zeroline' ) sel = opts . plotinfo . zerolinelayer ;
3119
- else sel = opts . plotinfo [ ( isX ? 'x' : 'y' ) + 'axislayer' ] ;
3121
+ else sel = opts . plotinfo [ ax . _id . charAt ( 0 ) + 'axislayer' ] ;
3120
3122
3121
3123
sel . each ( function ( ) {
3122
3124
d3 . select ( this ) . selectAll ( e . L ) . each ( function ( d ) {
@@ -3771,10 +3773,10 @@ function insideTicklabelposition(ax) {
3771
3773
return ( ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) ;
3772
3774
}
3773
3775
3774
- function hideCounterAxisInsideTickLabels ( ax ) {
3776
+ function hideCounterAxisInsideTickLabels ( ax , opts ) {
3775
3777
if ( insideTicklabelposition ( ax . _anchorAxis || { } ) ) {
3776
3778
if ( ax . _hideCounterAxisInsideTickLabels ) {
3777
- ax . _hideCounterAxisInsideTickLabels ( ) ;
3779
+ ax . _hideCounterAxisInsideTickLabels ( opts ) ;
3778
3780
}
3779
3781
}
3780
3782
}
0 commit comments