@@ -3013,8 +3013,6 @@ axes.drawLabels = function(gd, ax, opts) {
3013
3013
}
3014
3014
3015
3015
function positionLabels ( s , angle ) {
3016
- var isInside = insideTicklabelposition ( ax ) ;
3017
-
3018
3016
s . each ( function ( d ) {
3019
3017
var thisLabel = d3 . select ( this ) ;
3020
3018
var mathjaxGroup = thisLabel . select ( '.text-math-group' ) ;
@@ -3042,12 +3040,10 @@ axes.drawLabels = function(gd, ax, opts) {
3042
3040
'text-anchor' : anchor
3043
3041
} ) ;
3044
3042
3045
- if ( isInside ) {
3046
- thisText . style ( 'opacity' , 1 ) ; // visible
3043
+ thisText . style ( 'opacity' , 1 ) ; // visible
3047
3044
3048
- if ( ax . _adjustTickLabelsOverflow ) {
3049
- ax . _adjustTickLabelsOverflow ( ) ;
3050
- }
3045
+ if ( ax . _adjustTickLabelsOverflow ) {
3046
+ ax . _adjustTickLabelsOverflow ( ) ;
3051
3047
}
3052
3048
} else {
3053
3049
var mjWidth = Drawing . bBox ( mathjaxGroup . node ( ) ) . width ;
@@ -3058,19 +3054,27 @@ axes.drawLabels = function(gd, ax, opts) {
3058
3054
}
3059
3055
3060
3056
ax . _adjustTickLabelsOverflow = function ( ) {
3061
- if ( ! insideTicklabelposition ( ax ) ) return ;
3057
+ var ticklabeloverflow = ax . ticklabeloverflow ;
3058
+ if ( ! ticklabeloverflow || ticklabeloverflow === 'allow' ) return ;
3062
3059
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 ;
3064
3066
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
+ }
3068
3073
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 ) ;
3071
3076
3072
3077
var side = ax . side ;
3073
- var isX = ax . _id . charAt ( 0 ) === 'x' ;
3074
3078
3075
3079
var visibleLabelMin = Infinity ;
3076
3080
var visibleLabelMax = - Infinity ;
0 commit comments