Skip to content

Commit

Permalink
update logic from inside label to past edge of label
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Mar 30, 2021
1 parent f05cd39 commit 1f146f5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,7 @@ axes.drawLabels = function(gd, ax, opts) {
var min = Math.min(p0, p1) + ax._offset;
var max = Math.max(p0, p1) + ax._offset;

var side = ax.side;
var isX = ax._id.charAt(0) === 'x';

var visibleLabelMin = Infinity;
Expand All @@ -3086,8 +3087,17 @@ axes.drawLabels = function(gd, ax, opts) {
if(hide) {
t.style('display', 'none'); // hidden
} else {
visibleLabelMin = Math.min(visibleLabelMin, isX ? bb.top : bb.left);
visibleLabelMax = Math.max(visibleLabelMax, isX ? bb.bottom : bb.right);
if(side === 'bottom' || side === 'right') {
visibleLabelMin = Math.min(visibleLabelMin, isX ? bb.top : bb.left);
} else {
visibleLabelMin = -Infinity;
}

if(side === 'top' || side === 'left') {
visibleLabelMax = Math.max(visibleLabelMax, isX ? bb.bottom : bb.right);
} else {
visibleLabelMax = Infinity;
}
}
} // TODO: hide mathjax?
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ticklabelposition-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ticklabelposition-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ticklabelposition-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/ticklabelposition-a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1f146f5

Please sign in to comment.