@@ -232,6 +232,10 @@ describe('user-defined transforms:', function() {
232
232
describe ( 'multiple transforms:' , function ( ) {
233
233
'use strict' ;
234
234
235
+ var gd ;
236
+
237
+ beforeEach ( function ( ) { gd = createGraphDiv ( ) ; } ) ;
238
+
235
239
var mockData0 = [ {
236
240
mode : 'markers' ,
237
241
x : [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ,
@@ -278,8 +282,6 @@ describe('multiple transforms:', function() {
278
282
it ( 'Plotly.plot should plot the transform traces' , function ( done ) {
279
283
var data = Lib . extendDeep ( [ ] , mockData0 ) ;
280
284
281
- var gd = createGraphDiv ( ) ;
282
-
283
285
Plotly . plot ( gd , data ) . then ( function ( ) {
284
286
expect ( gd . data . length ) . toEqual ( 1 ) ;
285
287
expect ( gd . data [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
@@ -302,8 +304,6 @@ describe('multiple transforms:', function() {
302
304
303
305
data [ 0 ] . transforms . slice ( ) . reverse ( ) ;
304
306
305
- var gd = createGraphDiv ( ) ;
306
-
307
307
Plotly . plot ( gd , data ) . then ( function ( ) {
308
308
expect ( gd . data . length ) . toEqual ( 1 ) ;
309
309
expect ( gd . data [ 0 ] . x ) . toEqual ( [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ) ;
@@ -325,7 +325,6 @@ describe('multiple transforms:', function() {
325
325
var data = Lib . extendDeep ( [ ] , mockData0 ) ;
326
326
data [ 0 ] . marker = { size : 20 } ;
327
327
328
- var gd = createGraphDiv ( ) ;
329
328
var dims = [ 2 , 2 ] ;
330
329
331
330
Plotly . plot ( gd , data ) . then ( function ( ) {
@@ -377,8 +376,6 @@ describe('multiple transforms:', function() {
377
376
it ( 'Plotly.extendTraces should work' , function ( done ) {
378
377
var data = Lib . extendDeep ( [ ] , mockData0 ) ;
379
378
380
- var gd = createGraphDiv ( ) ;
381
-
382
379
Plotly . plot ( gd , data ) . then ( function ( ) {
383
380
expect ( gd . data [ 0 ] . x . length ) . toEqual ( 7 ) ;
384
381
expect ( gd . _fullData [ 0 ] . x . length ) . toEqual ( 2 ) ;
@@ -405,8 +402,6 @@ describe('multiple transforms:', function() {
405
402
it ( 'Plotly.deleteTraces should work' , function ( done ) {
406
403
var data = Lib . extendDeep ( [ ] , mockData1 ) ;
407
404
408
- var gd = createGraphDiv ( ) ;
409
-
410
405
Plotly . plot ( gd , data ) . then ( function ( ) {
411
406
assertDims ( [ 2 , 2 , 2 , 2 ] ) ;
412
407
@@ -425,8 +420,6 @@ describe('multiple transforms:', function() {
425
420
it ( 'toggling trace visibility should work' , function ( done ) {
426
421
var data = Lib . extendDeep ( [ ] , mockData1 ) ;
427
422
428
- var gd = createGraphDiv ( ) ;
429
-
430
423
Plotly . plot ( gd , data ) . then ( function ( ) {
431
424
assertDims ( [ 2 , 2 , 2 , 2 ] ) ;
432
425
0 commit comments