@@ -1452,7 +1452,7 @@ function formatDate(ax, out, hover, extraPrecision) {
1452
1452
ax . _prevDateHead = headStr ;
1453
1453
dateStr += '<br>' + headStr ;
1454
1454
} else {
1455
- var isInside = ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ;
1455
+ var isInside = insideTicklabelposition ( ax ) ;
1456
1456
var side = ax . _realSide || ax . side ; // polar mocks the side of the radial axis
1457
1457
if (
1458
1458
( ! isInside && side === 'top' ) ||
@@ -2870,7 +2870,7 @@ axes.drawGrid = function(gd, ax, opts) {
2870
2870
. style ( 'stroke-width' , ax . _gw + 'px' )
2871
2871
. style ( VISIBLE ) ;
2872
2872
2873
- if ( ( ( ax . _anchorAxis || { } ) . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
2873
+ if ( insideTicklabelposition ( ax . _anchorAxis || { } ) ) {
2874
2874
if ( ax . _hideCounterAxisInsideTickLabels ) {
2875
2875
ax . _hideCounterAxisInsideTickLabels ( ) ;
2876
2876
}
@@ -3008,7 +3008,7 @@ axes.drawLabels = function(gd, ax, opts) {
3008
3008
}
3009
3009
3010
3010
function positionLabels ( s , angle ) {
3011
- var isInside = ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ;
3011
+ var isInside = insideTicklabelposition ( ax ) ;
3012
3012
3013
3013
s . each ( function ( d ) {
3014
3014
var thisLabel = d3 . select ( this ) ;
@@ -3053,7 +3053,7 @@ axes.drawLabels = function(gd, ax, opts) {
3053
3053
}
3054
3054
3055
3055
ax . _hideOutOfRangeInsideTickLabels = function ( ) {
3056
- if ( ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
3056
+ if ( insideTicklabelposition ( ax ) ) {
3057
3057
var rl = Lib . simpleMap ( ax . range , ax . r2l ) ;
3058
3058
3059
3059
// hide inside tick labels that go outside axis end points
@@ -3099,7 +3099,7 @@ axes.drawLabels = function(gd, ax, opts) {
3099
3099
} ;
3100
3100
3101
3101
ax . _hideCounterAxisInsideTickLabels = function ( ) {
3102
- if ( ( ( ax . _anchorAxis || { } ) . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) {
3102
+ if ( insideTicklabelposition ( ax . _anchorAxis || { } ) ) {
3103
3103
var grid = opts . plotinfo . gridlayer . select ( '.' + ax . _id ) ;
3104
3104
grid . each ( function ( ) {
3105
3105
d3 . select ( this ) . selectAll ( 'path' ) . each ( function ( d ) {
@@ -3240,7 +3240,7 @@ axes.drawLabels = function(gd, ax, opts) {
3240
3240
var anchorAx = ax . _anchorAxis ;
3241
3241
if (
3242
3242
anchorAx && anchorAx . autorange &&
3243
- ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 &&
3243
+ insideTicklabelposition ( ax ) &&
3244
3244
! isLinked ( fullLayout , ax . _id )
3245
3245
) {
3246
3246
if ( ! fullLayout . _insideTickLabelsAutorange ) {
@@ -3389,7 +3389,7 @@ function drawTitle(gd, ax) {
3389
3389
if ( ax . title . hasOwnProperty ( 'standoff' ) ) {
3390
3390
titleStandoff = ax . _depth + ax . title . standoff + approxTitleDepth ( ax ) ;
3391
3391
} else {
3392
- var isInside = ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ;
3392
+ var isInside = insideTicklabelposition ( ax ) ;
3393
3393
3394
3394
if ( ax . type === 'multicategory' ) {
3395
3395
titleStandoff = ax . _depth ;
@@ -3747,3 +3747,7 @@ function moveOutsideBreak(v, ax) {
3747
3747
}
3748
3748
return v ;
3749
3749
}
3750
+
3751
+ function insideTicklabelposition ( ax ) {
3752
+ return ( ( ax . ticklabelposition || '' ) . indexOf ( 'inside' ) !== - 1 ) ;
3753
+ }
0 commit comments