File tree Expand file tree Collapse file tree 2 files changed +10
-19
lines changed Expand file tree Collapse file tree 2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 88
99'use strict' ;
1010
11+ var isNumeric = require ( 'fast-isnumeric' ) ;
12+
1113var Plotly = require ( '../plotly' ) ;
14+ var Lib = require ( '../lib' ) ;
1215
13- var isNumeric = require ( 'fast-isnumeric' ) ;
1416
1517/**
1618 * @param {object } gd figure Object
@@ -61,14 +63,8 @@ function toImage(gd, opts) {
6163 setTimeout ( function ( ) {
6264 var svg = Snapshot . toSVG ( clonedGd ) ;
6365
64- var canvasContainer = document . createElement ( 'div' ) ,
65- canvas = document . createElement ( 'canvas' ) ;
66-
67- // no need to attach canvas container to DOM
68-
69- canvasContainer . appendChild ( canvas ) ;
70- canvasContainer . id = Plotly . Lib . randstr ( ) ;
71- canvas . id = Plotly . Lib . randstr ( ) ;
66+ var canvas = document . createElement ( 'canvas' ) ;
67+ canvas . id = Lib . randstr ( ) ;
7268
7369 Snapshot . svgToImg ( {
7470 format : opts . format ,
Original file line number Diff line number Diff line change 66* LICENSE file in the root directory of this source tree.
77*/
88
9- /*eslint dot-notation: [2, {"allowPattern": "^catch$"}]*/
10-
119'use strict' ;
1210
1311var EventEmitter = require ( 'events' ) . EventEmitter ;
12+
1413var Plotly = require ( '../plotly' ) ;
14+ var Lib = require ( '../lib' ) ;
15+
1516
1617/**
1718 * @param {object } gd figure Object
@@ -38,14 +39,8 @@ function toImage(gd, opts) {
3839 setTimeout ( function ( ) {
3940 var svg = Plotly . Snapshot . toSVG ( clonedGd ) ;
4041
41- var canvasContainer = document . createElement ( 'div' ) ,
42- canvas = document . createElement ( 'canvas' ) ;
43-
44- // no need to attach canvas container to DOM
45-
46- canvasContainer . appendChild ( canvas ) ;
47- canvasContainer . id = Plotly . Lib . randstr ( ) ;
48- canvas . id = Plotly . Lib . randstr ( ) ;
42+ var canvas = document . createElement ( 'canvas' ) ;
43+ canvas . id = Lib . randstr ( ) ;
4944
5045 ev = Plotly . Snapshot . svgToImg ( {
5146 format : opts . format ,
You can’t perform that action at this time.
0 commit comments