Skip to content

Commit

Permalink
make copy of top-paper childNodes array-like:
Browse files Browse the repository at this point in the history
- as childNodes prop gets mutated in top-group loop
  • Loading branch information
etpinard committed Mar 16, 2016
1 parent 196d7dc commit 860e647
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/snapshot/tosvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ module.exports = function toSVG(gd, format) {
.appendChild(geoFramework.node());
}

// now that we've got the 3d images in the right layer, add top items above them
// assumes everything in toppaper is a group, and if it's empty (like hoverlayer)
// we can ignore it
// now that we've got the 3d images in the right layer,
// add top items above them assumes everything in toppaper is either
// a group or a defs, and if it's empty (like hoverlayer) we can ignore it.
if(fullLayout._toppaper) {
var nodes = fullLayout._toppaper.node().childNodes;


var topGroups = fullLayout._toppaper.node().childNodes;
// make copy of nodes as childNodes prop gets mutated in loop below
var topGroups = Array.prototype.slice.call(nodes);

for(i = 0; i < topGroups.length; i++) {
var topGroup = topGroups[i];
Expand Down

0 comments on commit 860e647

Please sign in to comment.