Skip to content

Commit cda1db3

Browse files
committed
fix default axis anchors
we were sorting too late, so if 'y2' was referenced before 'y' in gd.data, it would become the default anchor for x axes.
1 parent 30af5b7 commit cda1db3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/plots/plots.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -701,11 +701,6 @@ plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLa
701701

702702
var i, j, id, ax;
703703

704-
// sort subplot lists
705-
for(var subplotType in newSubplotList) {
706-
newSubplotList[subplotType].sort(Lib.subplotSort);
707-
}
708-
709704
for(i = 0; i < ids.length; i++) {
710705
id = ids[i];
711706
var oldSubplot = oldSubplots[id];
@@ -1390,6 +1385,11 @@ plots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData, trans
13901385
Cartesian.finalizeSubplots(layoutIn, layoutOut);
13911386
}
13921387

1388+
// sort subplot lists
1389+
for(var subplotType in layoutOut._subplots) {
1390+
layoutOut._subplots[subplotType].sort(Lib.subplotSort);
1391+
}
1392+
13931393
// base plot module layout defaults
13941394
for(i = 0; i < basePlotModules.length; i++) {
13951395
_module = basePlotModules[i];

test/image/mocks/range_slider_axes_stacked.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{"fill": "tozeroy", "y": [30, 20, 10]}
55
],
66
"layout": {
7-
"xaxis": {"rangeslider": {}, "title": "x", "anchor": "y"},
7+
"xaxis": {"rangeslider": {}, "title": "x"},
88
"yaxis": {"title": "y", "domain": [0, 0.25]},
99
"yaxis2": {"title": "y2", "domain": [ 0.3, 1]}
1010
}

0 commit comments

Comments
 (0)