File tree 2 files changed +9
-7
lines changed 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,12 @@ function toImage(gd, opts) {
61
61
setTimeout ( function ( ) {
62
62
var svg = Snapshot . toSVG ( clonedGd ) ;
63
63
64
- var canvasContainer = window . document . createElement ( 'div' ) ;
65
- var canvas = window . document . createElement ( 'canvas' ) ;
64
+ var canvasContainer = document . createElement ( 'div' ) ,
65
+ canvas = document . createElement ( 'canvas' ) ;
66
66
67
- canvasContainer . appendChild ( canvas ) ;
67
+ // no need to attach canvas container to DOM
68
68
69
+ canvasContainer . appendChild ( canvas ) ;
69
70
canvasContainer . id = Plotly . Lib . randstr ( ) ;
70
71
canvas . id = Plotly . Lib . randstr ( ) ;
71
72
@@ -86,6 +87,7 @@ function toImage(gd, opts) {
86
87
} ) . catch ( function ( err ) {
87
88
reject ( err ) ;
88
89
} ) ;
90
+
89
91
} , delay ) ;
90
92
} ) ;
91
93
}
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ function toImage(gd, opts) {
38
38
setTimeout ( function ( ) {
39
39
var svg = Plotly . Snapshot . toSVG ( clonedGd ) ;
40
40
41
- var canvasContainer = window . document . createElement ( 'div' ) ;
42
- var canvas = window . document . createElement ( 'canvas' ) ;
41
+ var canvasContainer = document . createElement ( 'div' ) ,
42
+ canvas = document . createElement ( 'canvas' ) ;
43
43
44
- // window.document.body.appendChild(canvasContainer);
45
- canvasContainer . appendChild ( canvas ) ;
44
+ // no need to attach canvas container to DOM
46
45
46
+ canvasContainer . appendChild ( canvas ) ;
47
47
canvasContainer . id = Plotly . Lib . randstr ( ) ;
48
48
canvas . id = Plotly . Lib . randstr ( ) ;
49
49
You can’t perform that action at this time.
0 commit comments