Skip to content

Commit e18ffd6

Browse files
committed
ensure images stay sorted properly with the new data key
1 parent 8c707b2 commit e18ffd6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/images/draw.js

+4
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ module.exports = function draw(gd) {
207207
return [d.xref, d.x, d.sizex, d.yref, d.y, d.sizey].join('_');
208208
}
209209

210+
function imgSort(a, b) { return a._index - b._index; }
211+
210212
var imagesBelow = fullLayout._imageLowerLayer.selectAll('image')
211213
.data(imageDataBelow, imgDataFunc);
212214
var imagesAbove = fullLayout._imageUpperLayer.selectAll('image')
@@ -226,6 +228,8 @@ module.exports = function draw(gd) {
226228
setImage.bind(this)(d);
227229
applyAttributes.bind(this)(d);
228230
});
231+
imagesBelow.sort(imgSort);
232+
imagesAbove.sort(imgSort);
229233

230234
var allSubplots = Object.keys(fullLayout._plots);
231235
for(i = 0; i < allSubplots.length; i++) {

0 commit comments

Comments
 (0)