Skip to content

Commit 3bf58db

Browse files
committed
fix overlaying axis layers
- bug noticed when both overlaying x and y axes have `showline: true`. - ... but `Plotly.restyle(gd, 'visible', true, [1])` does not work for the added mock - both bugs have been broken since PR #946 released in 1.18.0
1 parent fbc0296 commit 3bf58db

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/plots/cartesian/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ function makeSubplotLayer(plotinfo) {
347347
plotinfo.zerolinelayer = joinLayer(mainplotinfo.overzero, 'g', id);
348348

349349
plotinfo.plot = joinLayer(mainplotinfo.overplot, 'g', id);
350-
plotinfo.xlines = joinLayer(mainplotinfo.overlines, 'path', id);
351-
plotinfo.ylines = joinLayer(mainplotinfo.overlines, 'path', id);
352-
plotinfo.xaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id);
353-
plotinfo.yaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id);
350+
plotinfo.xlines = joinLayer(mainplotinfo.overlines, 'path', id + '-x');
351+
plotinfo.ylines = joinLayer(mainplotinfo.overlines, 'path', id + '-y');
352+
plotinfo.xaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id + '-x');
353+
plotinfo.yaxislayer = joinLayer(mainplotinfo.overaxes, 'g', id + '-y');
354354
}
355355

356356
// common attributes for all subplots, overlays or not
30.9 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"data": [{
3+
"y": [1, 2, 3]
4+
}, {
5+
"x": [4, 5, 6],
6+
"y": [3, 1, 2],
7+
"xaxis": "x2",
8+
"yaxis": "y2"
9+
}],
10+
"layout": {
11+
"xaxis": {"showline": true},
12+
"yaxis": {"showline": true},
13+
"xaxis2": {"showline": true, "overlaying": "x", "side": "top"},
14+
"yaxis2": {"showline": true, "overlaying": "y", "side": "right"}
15+
}
16+
}

0 commit comments

Comments
 (0)