Skip to content

Commit 176f922

Browse files
committed
Ensure zindex is compared by trace
1 parent df9361c commit 176f922

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/plots/cartesian/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
234234
if(cdModule.length) {
235235
layerData.push({
236236
i: traceLayerClasses.indexOf(className),
237-
z: z,
237+
zindex: z,
238238
className: className,
239239
plotMethod: plotMethod,
240240
cdModule: cdModule
@@ -248,7 +248,7 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
248248
}
249249
}
250250
// Sort the layers primarily by z, then by i
251-
layerData.sort(function(a, b) { return a.z - b.z || a.i - b.i; });
251+
layerData.sort(function(a, b) { return a.zindex - b.zindex || a.i - b.i; });
252252

253253
var layers = plotinfo.plot.selectAll('g.mlayer')
254254
.data(layerData, function(d) { return d.className; });

src/plots/get_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ exports.getModuleCalcData = function(calcdata, arg1, arg2) {
5858
return [moduleCalcData, calcdata];
5959
}
6060
var zindex = arg2;
61-
var filterByZ = (zindex !== undefined);
6261

6362
for(var i = 0; i < calcdata.length; i++) {
6463
var cd = calcdata[i];
6564
var trace = cd[0].trace;
65+
var filterByZ = (trace.zindex !== undefined);
6666
// N.B.
6767
// - 'legendonly' traces do not make it past here
6868
// - skip over 'visible' traces that got trimmed completely during calc transforms

0 commit comments

Comments
 (0)