Skip to content

Commit d06bc6d

Browse files
committed
simplify autoshift checks
1 parent 61c2889 commit d06bc6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/plots/cartesian/axes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,7 +2251,7 @@ axes.draw = function(gd, arg, opts) {
22512251
var fullAxList = axes.list(gd);
22522252
// Get the list of the overlaying axis for all 'shift' axes
22532253
var overlayingShiftedAx = fullAxList.filter(function(ax) {
2254-
return ax.autoshift === true;
2254+
return ax.autoshift;
22552255
}).map(function(ax) {
22562256
return ax.overlaying;
22572257
});
@@ -2328,7 +2328,7 @@ axes.drawOne = function(gd, ax, opts) {
23282328
// this happens when updating matched group with 'missing' axes
23292329
if(!mainPlotinfo) return;
23302330

2331-
ax._shiftPusher = ax.autoshift === true ||
2331+
ax._shiftPusher = ax.autoshift ||
23322332
overlayingShiftedAx.indexOf(ax._id) !== -1 ||
23332333
overlayingShiftedAx.indexOf(ax.overlaying) !== -1;
23342334
// An axis is also shifted by 1/2 of its own linewidth and inside tick length if applicable
@@ -4293,7 +4293,7 @@ function incrementShift(ax, shiftVal, axShifts, normalize) {
42934293
}
42944294

42954295
function setShiftVal(ax, axShifts) {
4296-
return ax.autoshift === true ?
4296+
return ax.autoshift ?
42974297
axShifts[ax.overlaying][ax.side] :
42984298
(ax.shift || 0);
42994299
}

src/plots/cartesian/position_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
4949
if(anchor === 'free') {
5050
if(letter === 'y') {
5151
var autoshift = coerce('autoshift');
52-
if(autoshift === true) {
52+
if(autoshift) {
5353
dfltPosition = side === 'left' ? overlayingDomain[0] : overlayingDomain[1];
5454
dfltAutomargin = containerOut.automargin ? containerOut.automargin : true;
5555
dfltShift = side === 'left' ? -3 : 3;

0 commit comments

Comments
 (0)