Skip to content

Commit 7a9f1e7

Browse files
Reorder axes with dependency tickmode sync
1 parent 5afad5e commit 7a9f1e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/plots/cartesian/axes.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,18 @@ axes.draw = function(gd, arg, opts) {
23032303
return ax.overlaying;
23042304
});
23052305

2306+
// order axes that have dependency to other axes
2307+
axList.map(function(axId) {
2308+
var ax = axes.getFromId(gd, axId);
2309+
2310+
if(ax.tickmode === 'sync' && ax.overlaying) {
2311+
var overlayingIndex = axList.findIndex(function(axis) {return axis === ax.overlaying;});
2312+
2313+
if(overlayingIndex >= 0) {
2314+
axList.unshift(axList.splice(overlayingIndex, 1).shift());
2315+
}
2316+
}
2317+
});
23062318

23072319
var axShifts = {'false': {'left': 0, 'right': 0}};
23082320

0 commit comments

Comments
 (0)