Skip to content

Commit 196d7dc

Browse files
committed
change top-paper <defs> id to 'topdefs' + uid:
- that way ids remain unique on page - rm special <defs> merge block in to-svg step
1 parent 757ffdf commit 196d7dc

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,7 @@ function makePlotFramework(gd) {
25862586
.attr('id', 'defs-' + fullLayout._uid);
25872587

25882588
fullLayout._topdefs = fullLayout._toppaper.append('defs')
2589-
.attr('id', 'defs-' + fullLayout._uid);
2589+
.attr('id', 'topdefs-' + fullLayout._uid);
25902590

25912591
fullLayout._draggers = fullLayout._paper.append('g')
25922592
.classed('draglayer', true);

src/snapshot/tosvg.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,7 @@ module.exports = function toSVG(gd, format) {
8989
// assumes everything in toppaper is a group, and if it's empty (like hoverlayer)
9090
// we can ignore it
9191
if(fullLayout._toppaper) {
92-
var topDefs = fullLayout._topdefs.node().childNodes;
9392

94-
for(i = 0; i < topDefs.length; i++) {
95-
var topDef = topDefs[i];
96-
97-
fullLayout._defs.node().appendChild(topDef);
98-
}
99-
100-
fullLayout._topdefs.remove();
10193

10294
var topGroups = fullLayout._toppaper.node().childNodes;
10395

0 commit comments

Comments
 (0)