@@ -3013,8 +3013,6 @@ axes.drawLabels = function(gd, ax, opts) {
30133013 }
30143014
30153015 function positionLabels ( s , angle ) {
3016- var isInside = insideTicklabelposition ( ax ) ;
3017-
30183016 s . each ( function ( d ) {
30193017 var thisLabel = d3 . select ( this ) ;
30203018 var mathjaxGroup = thisLabel . select ( '.text-math-group' ) ;
@@ -3042,12 +3040,10 @@ axes.drawLabels = function(gd, ax, opts) {
30423040 'text-anchor' : anchor
30433041 } ) ;
30443042
3045- if ( isInside ) {
3046- thisText . style ( 'opacity' , 1 ) ; // visible
3043+ thisText . style ( 'opacity' , 1 ) ; // visible
30473044
3048- if ( ax . _adjustTickLabelsOverflow ) {
3049- ax . _adjustTickLabelsOverflow ( ) ;
3050- }
3045+ if ( ax . _adjustTickLabelsOverflow ) {
3046+ ax . _adjustTickLabelsOverflow ( ) ;
30513047 }
30523048 } else {
30533049 var mjWidth = Drawing . bBox ( mathjaxGroup . node ( ) ) . width ;
@@ -3058,19 +3054,27 @@ axes.drawLabels = function(gd, ax, opts) {
30583054 }
30593055
30603056 ax . _adjustTickLabelsOverflow = function ( ) {
3061- if ( ! insideTicklabelposition ( ax ) ) return ;
3057+ var ticklabeloverflow = ax . ticklabeloverflow ;
3058+ if ( ! ticklabeloverflow || ticklabeloverflow === 'allow' ) return ;
30623059
3063- var rl = Lib . simpleMap ( ax . range , ax . r2l ) ;
3060+ var isX = ax . _id . charAt ( 0 ) === 'x' ;
3061+ // div positions
3062+ var p0 = 0 ;
3063+ var p1 = isX ?
3064+ gd . _fullLayout . width :
3065+ gd . _fullLayout . height ;
30643066
3065- // hide inside tick labels that go outside axis end points
3066- var p0 = ax . l2p ( rl [ 0 ] ) ;
3067- var p1 = ax . l2p ( rl [ 1 ] ) ;
3067+ if ( ticklabeloverflow . indexOf ( 'domain' ) !== - 1 ) {
3068+ // domain positions
3069+ var rl = Lib . simpleMap ( ax . range , ax . r2l ) ;
3070+ p0 = ax . l2p ( rl [ 0 ] ) + ax . _offset ;
3071+ p1 = ax . l2p ( rl [ 1 ] ) + ax . _offset ;
3072+ }
30683073
3069- var min = Math . min ( p0 , p1 ) + ax . _offset ;
3070- var max = Math . max ( p0 , p1 ) + ax . _offset ;
3074+ var min = Math . min ( p0 , p1 ) ;
3075+ var max = Math . max ( p0 , p1 ) ;
30713076
30723077 var side = ax . side ;
3073- var isX = ax . _id . charAt ( 0 ) === 'x' ;
30743078
30753079 var visibleLabelMin = Infinity ;
30763080 var visibleLabelMax = - Infinity ;
0 commit comments