@@ -11,24 +11,6 @@ var delay = require('../assets/delay');
1111var mouseEvent = require ( '../assets/mouse_event' ) ;
1212var readPixel = require ( '../assets/read_pixel' ) ;
1313
14- function _newPlot ( gd , arg2 , arg3 , arg4 ) {
15- var fig ;
16- if ( Array . isArray ( arg2 ) ) {
17- fig = {
18- data : arg2 ,
19- layout : arg3 ,
20- config : arg4
21- } ;
22- } else fig = arg2 ;
23-
24- if ( ! fig . layout ) fig . layout = { } ;
25- if ( ! fig . layout . newselection ) fig . layout . newselection = { } ;
26- fig . layout . newselection . mode = 'gradual' ;
27- // complex ouline creation are mainly tested in "gradual" mode here
28-
29- return Plotly . newPlot ( gd , fig ) ;
30- }
31-
3214function drag ( gd , path ) {
3315 var len = path . length ;
3416 var el = d3Select ( gd ) . select ( 'rect.nsewdrag' ) . node ( ) ;
@@ -105,7 +87,7 @@ describe('Test gl2d lasso/select:', function() {
10587 _mock . layout . dragmode = 'select' ;
10688 gd = createGraphDiv ( ) ;
10789
108- _newPlot ( gd , _mock )
90+ Plotly . newPlot ( gd , _mock )
10991 . then ( delay ( 20 ) )
11092 . then ( function ( ) {
11193 expect ( gd . _fullLayout . _plots . xy . _scene . select2d ) . not . toBe ( undefined , 'scatter2d renderer' ) ;
@@ -130,7 +112,7 @@ describe('Test gl2d lasso/select:', function() {
130112 _mock . layout . dragmode = 'lasso' ;
131113 gd = createGraphDiv ( ) ;
132114
133- _newPlot ( gd , _mock )
115+ Plotly . newPlot ( gd , _mock )
134116 . then ( delay ( 20 ) )
135117 . then ( function ( ) {
136118 return select ( gd , lassoPath2 ) ;
@@ -153,7 +135,7 @@ describe('Test gl2d lasso/select:', function() {
153135 _mock . layout . dragmode = 'select' ;
154136 gd = createGraphDiv ( ) ;
155137
156- _newPlot ( gd , _mock )
138+ Plotly . newPlot ( gd , _mock )
157139 . then ( delay ( 20 ) )
158140 . then ( function ( ) {
159141 return select ( gd , selectPath2 ) ;
@@ -172,7 +154,7 @@ describe('Test gl2d lasso/select:', function() {
172154 _mock . layout . dragmode = 'lasso' ;
173155 gd = createGraphDiv ( ) ;
174156
175- _newPlot ( gd , _mock )
157+ Plotly . newPlot ( gd , _mock )
176158 . then ( delay ( 20 ) )
177159 . then ( function ( ) {
178160 return select ( gd , lassoPath ) ;
@@ -193,7 +175,7 @@ describe('Test gl2d lasso/select:', function() {
193175 fig . layout . width = 500 ;
194176 gd = createGraphDiv ( ) ;
195177
196- _newPlot ( gd , fig )
178+ Plotly . newPlot ( gd , fig )
197179 . then ( delay ( 20 ) )
198180 . then ( function ( ) { return select ( gd , [ [ 100 , 100 ] , [ 250 , 250 ] ] ) ; } )
199181 . then ( function ( eventData ) {
@@ -223,7 +205,7 @@ describe('Test gl2d lasso/select:', function() {
223205 } ) ;
224206 }
225207
226- _newPlot ( gd , fig )
208+ Plotly . newPlot ( gd , fig )
227209 . then ( delay ( 20 ) )
228210 . then ( function ( ) {
229211 _assertGlTextOpts ( 'base' , {
@@ -305,7 +287,7 @@ describe('Test gl2d lasso/select:', function() {
305287 } ) ;
306288 }
307289
308- _newPlot ( gd , fig )
290+ Plotly . newPlot ( gd , fig )
309291 . then ( delay ( 20 ) )
310292 . then ( function ( ) {
311293 _assertGlTextOpts ( 'base' , {
@@ -388,7 +370,7 @@ describe('Test gl2d lasso/select:', function() {
388370 var scatterEventData = { } ;
389371 var selectPath = [ [ 150 , 150 ] , [ 250 , 250 ] ] ;
390372
391- _newPlot ( gd , _mock )
373+ Plotly . newPlot ( gd , _mock )
392374 . then ( delay ( 20 ) )
393375 . then ( function ( ) {
394376 expect ( gd . _fullLayout [ ax + 'axis' ] . type ) . toEqual ( test [ 0 ] ) ;
@@ -446,7 +428,7 @@ describe('Test displayed selections:', function() {
446428
447429 function readFocus ( ) { return _read ( '.gl-canvas-focus' ) ; }
448430
449- _newPlot ( gd , [ {
431+ Plotly . newPlot ( gd , [ {
450432 type : 'scattergl' ,
451433 mode : 'markers' ,
452434 y : [ 2 , 1 , 2 ]
@@ -506,7 +488,7 @@ describe('Test displayed selections:', function() {
506488 }
507489 } ;
508490
509- _newPlot ( gd , mock )
491+ Plotly . newPlot ( gd , mock )
510492 . then ( select ( gd , [ [ 160 , 100 ] , [ 180 , 100 ] ] ) )
511493 . then ( function ( ) {
512494 expect ( readPixel ( gd . querySelector ( '.gl-canvas-context' ) , 168 , 100 ) [ 3 ] ) . toBe ( 0 ) ;
@@ -551,7 +533,7 @@ describe('Test displayed selections:', function() {
551533 }
552534 } ;
553535
554- _newPlot ( gd , mock )
536+ Plotly . newPlot ( gd , mock )
555537 . then ( select ( gd , [ [ 160 , 100 ] , [ 180 , 100 ] ] ) )
556538 . then ( function ( ) {
557539 expect ( readPixel ( gd . querySelector ( '.gl-canvas-context' ) , 168 , 100 ) [ 3 ] ) . toBe ( 0 ) ;
@@ -640,7 +622,7 @@ describe('Test selections during funky scenarios', function() {
640622 it ( '@gl should behave correctly when doubleclick before selecting anything' , function ( done ) {
641623 gd = createGraphDiv ( ) ;
642624
643- _newPlot ( gd , [ {
625+ Plotly . newPlot ( gd , [ {
644626 type : 'scattergl' ,
645627 mode : 'markers' ,
646628 y : [ 1 , 2 , 1 ] ,
@@ -696,7 +678,7 @@ describe('Test selections during funky scenarios', function() {
696678 tracker = [ ] ;
697679 }
698680
699- _newPlot ( gd , [ {
681+ Plotly . newPlot ( gd , [ {
700682 type : 'scattergl' ,
701683 mode : 'markers' ,
702684 y : [ 1 , 2 , 1 ] ,
@@ -748,7 +730,7 @@ describe('Test selections during funky scenarios', function() {
748730
749731 var scene , scene2 ;
750732
751- _newPlot ( gd , [ {
733+ Plotly . newPlot ( gd , [ {
752734 x : [ 1 , 2 , 3 ] ,
753735 y : [ 40 , 50 , 60 ] ,
754736 type : 'scattergl' ,
0 commit comments