Skip to content

Commit e5003c6

Browse files
committed
Handle zindex undefined in sort
1 parent c422f53 commit e5003c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plots/cartesian/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.zindex - b.zindex || a.i - b.i; });
251+
layerData.sort(function(a, b) { return (a.zindex || 0) - (b.zindex || 0) || a.i - b.i; });
252252

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

0 commit comments

Comments
 (0)