Skip to content

Commit

Permalink
Merge pull request #7148 from plotly/refactor-before-fix-zorder
Browse files Browse the repository at this point in the history
Some refactor before fixing zorder bug
  • Loading branch information
archmoj authored Sep 10, 2024
2 parents 8b7805d + 9cf7b7c commit a6e7f38
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/plots/cartesian/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
if(cdModule.length) {
layerData.push({
i: traceLayerClasses.indexOf(classBaseName),
zorder: z,
zindex: z,
className: className,
plotMethod: plotMethod,
cdModule: cdModule
Expand All @@ -257,10 +257,10 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
}
}
}
// Sort the layers primarily by z, then by i
// Sort the layers primarily by zindex, then by i
layerData.sort(function(a, b) {
return (
(a.zorder || 0) - (b.zorder || 0) ||
(a.zindex || 0) - (b.zindex || 0) ||
(a.i - b.i)
);
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
"layout": {
"showlegend": true,
"title": {
"text": "zorder overlayed subplots - multiple on the same subplot",
"subtitle": {
"text": "Orange trace is displayed on top!"
}
"text": "zorder overlayed subplots - multiple on the same subplot"
},
"width": 600,
"height": 400,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@
"layout": {
"showlegend": true,
"title": {
"text": "zorder overlayed subplots - multiple on the same subplot",
"subtitle": {
"text": "Orange trace is displayed on top!"
}
"text": "zorder overlayed subplots - multiple on the same subplot"
},
"width": 600,
"height": 400,
Expand Down

0 comments on commit a6e7f38

Please sign in to comment.