Skip to content

Commit 21d0a12

Browse files
committed
update description and some optimization
1 parent 49ba846 commit 21d0a12

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

src/plots/cartesian/axes.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,26 +3203,25 @@ axes.drawLabels = function(gd, ax, opts) {
32033203
});
32043204
}
32053205

3206-
if(!axisIds.isLinked(fullLayout, ax._id)) {
3207-
var anchorAx = ax._anchorAxis;
3208-
if(
3209-
anchorAx && anchorAx.autorange &&
3210-
(ax.ticklabelposition || '').indexOf('inside') !== -1
3211-
) {
3212-
if(!fullLayout._insideTickLabelsAutorange) {
3213-
fullLayout._insideTickLabelsAutorange = {};
3214-
}
3215-
fullLayout._insideTickLabelsAutorange[anchorAx._name + '.autorange'] = anchorAx.autorange;
3216-
3217-
seq.push(
3218-
function computeFinalTickLabelBoundingBoxes() {
3219-
tickLabels.each(function(d, i) {
3220-
var thisLabel = selectTickLabel(this);
3221-
ax._vals[i].bb = Drawing.bBox(thisLabel.node());
3222-
});
3223-
}
3224-
);
3206+
var anchorAx = ax._anchorAxis;
3207+
if(
3208+
anchorAx && anchorAx.autorange &&
3209+
(ax.ticklabelposition || '').indexOf('inside') !== -1 &&
3210+
!axisIds.isLinked(fullLayout, ax._id)
3211+
) {
3212+
if(!fullLayout._insideTickLabelsAutorange) {
3213+
fullLayout._insideTickLabelsAutorange = {};
32253214
}
3215+
fullLayout._insideTickLabelsAutorange[anchorAx._name + '.autorange'] = anchorAx.autorange;
3216+
3217+
seq.push(
3218+
function computeFinalTickLabelBoundingBoxes() {
3219+
tickLabels.each(function(d, i) {
3220+
var thisLabel = selectTickLabel(this);
3221+
ax._vals[i].bb = Drawing.bBox(thisLabel.node());
3222+
});
3223+
}
3224+
);
32263225
}
32273226

32283227
var done = Lib.syncOrAsync(seq);

src/plots/cartesian/layout_attributes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,10 @@ module.exports = {
525525
'top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*.',
526526
'Similarly',
527527
'left or right has no effect on y axes or when `ticklabelmode` is set to *period*.',
528-
'Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.'
528+
'Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.',
529+
'When used on axes linked by `matches` or `scaleanchor`,',
530+
'no extra padding for inside labels would be added by autorange,',
531+
'so that the scales could match.'
529532
].join(' ')
530533
},
531534
mirror: {

0 commit comments

Comments
 (0)