Skip to content

Commit a6e7f38

Browse files
authored
Merge pull request #7148 from plotly/refactor-before-fix-zorder
Some refactor before fixing zorder bug
2 parents 8b7805d + 9cf7b7c commit a6e7f38

5 files changed

+5
-11
lines changed

src/plots/cartesian/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
244244
if(cdModule.length) {
245245
layerData.push({
246246
i: traceLayerClasses.indexOf(classBaseName),
247-
zorder: z,
247+
zindex: z,
248248
className: className,
249249
plotMethod: plotMethod,
250250
cdModule: cdModule
@@ -257,10 +257,10 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
257257
}
258258
}
259259
}
260-
// Sort the layers primarily by z, then by i
260+
// Sort the layers primarily by zindex, then by i
261261
layerData.sort(function(a, b) {
262262
return (
263-
(a.zorder || 0) - (b.zorder || 0) ||
263+
(a.zindex || 0) - (b.zindex || 0) ||
264264
(a.i - b.i)
265265
);
266266
});
Loading
Loading

test/image/mocks/zorder-overlayed-subplots-multiple-traces-main-subplot.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343
"layout": {
4444
"showlegend": true,
4545
"title": {
46-
"text": "zorder overlayed subplots - multiple on the same subplot",
47-
"subtitle": {
48-
"text": "Orange trace is displayed on top!"
49-
}
46+
"text": "zorder overlayed subplots - multiple on the same subplot"
5047
},
5148
"width": 600,
5249
"height": 400,

test/image/mocks/zorder-overlayed-subplots-multiple-traces-main-subplot2.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343
"layout": {
4444
"showlegend": true,
4545
"title": {
46-
"text": "zorder overlayed subplots - multiple on the same subplot",
47-
"subtitle": {
48-
"text": "Orange trace is displayed on top!"
49-
}
46+
"text": "zorder overlayed subplots - multiple on the same subplot"
5047
},
5148
"width": 600,
5249
"height": 400,

0 commit comments

Comments
 (0)