@@ -2184,9 +2184,7 @@ axes.drawOne = function(gd, ax, opts) {
21842184 labelFns : axes . makeLabelFns ( ax , mainLinePosition )
21852185 } ;
21862186
2187- if ( ax . _anchorAxis ) {
2188- opts . grid = plotinfo . gridlayer . select ( '.' + ax . _anchorAxis . _id ) ;
2189- }
2187+ opts . grid = plotinfo . gridlayer . select ( '.' + ax . _id ) ;
21902188
21912189 return axes . drawLabels ( gd , ax , opts ) ;
21922190 } ) ;
@@ -3047,9 +3045,8 @@ axes.drawLabels = function(gd, ax, opts) {
30473045 } ) ;
30483046 }
30493047
3050- ax . _hideOutOfRangeInsideTickLabels = undefined ;
3051- if ( ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
3052- ax . _hideOutOfRangeInsideTickLabels = function ( ) {
3048+ ax . _hideOutOfRangeInsideTickLabels = function ( ) {
3049+ if ( ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
30533050 var rl = Lib . simpleMap ( ax . range , ax . r2l ) ;
30543051
30553052 // hide inside tick labels that go outside axis end points
@@ -3087,24 +3084,30 @@ axes.drawLabels = function(gd, ax, opts) {
30873084 } // TODO: hide mathjax?
30883085 } ) ;
30893086
3090- var anchorAx = ax . _anchorAxis || { } ;
3091-
3092- if ( ( anchorAx . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
3093- var grid = opts . grid ;
3094- if ( grid ) {
3095- grid . each ( function ( ) {
3096- d3 . select ( this ) . selectAll ( 'path' ) . each ( function ( d ) {
3097- var q = anchorAx . l2p ( d . x ) + anchorAx . _offset ;
3087+ if ( ax . _anchorAxis ) {
3088+ ax . _anchorAxis . _visibleLabelMin = visibleLabelMin ;
3089+ ax . _anchorAxis . _visibleLabelMax = visibleLabelMax ;
3090+ }
3091+ }
3092+ } ;
30983093
3099- if ( q < visibleLabelMax && q > visibleLabelMin ) {
3100- d3 . select ( this ) . style ( { opacity : 0 } ) ;
3101- }
3102- } ) ;
3094+ ax . _hideCounterAxisInsideTickLabels = function ( ) {
3095+ var anchorAx = ax . _anchorAxis || { } ;
3096+ if ( ( anchorAx . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
3097+ var grid = opts . grid ;
3098+ if ( grid ) {
3099+ grid . each ( function ( ) {
3100+ d3 . select ( this ) . selectAll ( 'path' ) . each ( function ( d ) {
3101+ var q = ax . l2p ( d . x ) + ax . _offset ;
3102+
3103+ if ( q < ax . _visibleLabelMax && q > ax . _visibleLabelMin ) {
3104+ d3 . select ( this ) . style ( { opacity : 0 } ) ;
3105+ }
31033106 } ) ;
3104- }
3107+ } ) ;
31053108 }
3106- } ;
3107- }
3109+ }
3110+ } ;
31083111
31093112 // make sure all labels are correctly positioned at their base angle
31103113 // the positionLabels call above is only for newly drawn labels.
0 commit comments