File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 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) {
6161 setTimeout ( function ( ) {
6262 var svg = Snapshot . toSVG ( clonedGd ) ;
6363
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' ) ;
6666
67- canvasContainer . appendChild ( canvas ) ;
67+ // no need to attach canvas container to DOM
6868
69+ canvasContainer . appendChild ( canvas ) ;
6970 canvasContainer . id = Plotly . Lib . randstr ( ) ;
7071 canvas . id = Plotly . Lib . randstr ( ) ;
7172
@@ -86,6 +87,7 @@ function toImage(gd, opts) {
8687 } ) . catch ( function ( err ) {
8788 reject ( err ) ;
8889 } ) ;
90+
8991 } , delay ) ;
9092 } ) ;
9193 }
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ function toImage(gd, opts) {
3838 setTimeout ( function ( ) {
3939 var svg = Plotly . Snapshot . toSVG ( clonedGd ) ;
4040
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' ) ;
4343
44- // window.document.body.appendChild(canvasContainer);
45- canvasContainer . appendChild ( canvas ) ;
44+ // no need to attach canvas container to DOM
4645
46+ canvasContainer . appendChild ( canvas ) ;
4747 canvasContainer . id = Plotly . Lib . randstr ( ) ;
4848 canvas . id = Plotly . Lib . randstr ( ) ;
4949
You can’t perform that action at this time.
0 commit comments