File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,21 @@ 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 topGroups = fullLayout . _toppaper . node ( ) . childNodes ,
93- topGroup ;
92+ var topDefs = fullLayout . _topdefs . node ( ) . childNodes ;
93+
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 ( ) ;
101+
102+ var topGroups = fullLayout . _toppaper . node ( ) . childNodes ;
103+
94104 for ( i = 0 ; i < topGroups . length ; i ++ ) {
95- topGroup = topGroups [ i ] ;
105+ var topGroup = topGroups [ i ] ;
106+
96107 if ( topGroup . childNodes . length ) svg . node ( ) . appendChild ( topGroup ) ;
97108 }
98109 }
You can’t perform that action at this time.
0 commit comments