File tree 2 files changed +10
-19
lines changed
2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 8
8
9
9
'use strict' ;
10
10
11
+ var isNumeric = require ( 'fast-isnumeric' ) ;
12
+
11
13
var Plotly = require ( '../plotly' ) ;
14
+ var Lib = require ( '../lib' ) ;
12
15
13
- var isNumeric = require ( 'fast-isnumeric' ) ;
14
16
15
17
/**
16
18
* @param {object } gd figure Object
@@ -61,14 +63,8 @@ function toImage(gd, opts) {
61
63
setTimeout ( function ( ) {
62
64
var svg = Snapshot . toSVG ( clonedGd ) ;
63
65
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 ( ) ;
72
68
73
69
Snapshot . svgToImg ( {
74
70
format : opts . format ,
Original file line number Diff line number Diff line change 6
6
* LICENSE file in the root directory of this source tree.
7
7
*/
8
8
9
- /*eslint dot-notation: [2, {"allowPattern": "^catch$"}]*/
10
-
11
9
'use strict' ;
12
10
13
11
var EventEmitter = require ( 'events' ) . EventEmitter ;
12
+
14
13
var Plotly = require ( '../plotly' ) ;
14
+ var Lib = require ( '../lib' ) ;
15
+
15
16
16
17
/**
17
18
* @param {object } gd figure Object
@@ -38,14 +39,8 @@ function toImage(gd, opts) {
38
39
setTimeout ( function ( ) {
39
40
var svg = Plotly . Snapshot . toSVG ( clonedGd ) ;
40
41
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 ( ) ;
49
44
50
45
ev = Plotly . Snapshot . svgToImg ( {
51
46
format : opts . format ,
You can’t perform that action at this time.
0 commit comments