@@ -1851,7 +1851,7 @@ describe('Test select box and lasso per trace:', function() {
1851
1851
dblClickPos = dblClickPos || [ 250 , 200 ] ;
1852
1852
1853
1853
var scale = 1 ;
1854
- if ( hasCssTransform ) {
1854
+ if ( hasCssTransform ) {
1855
1855
scale = 0.5 ;
1856
1856
}
1857
1857
dblClickPos [ 0 ] *= scale ;
@@ -1894,8 +1894,12 @@ describe('Test select box and lasso per trace:', function() {
1894
1894
fig . layout . dragmode = 'select' ;
1895
1895
addInvisible ( fig ) ;
1896
1896
1897
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
1898
- Plotly . plot ( gd , fig ) . then ( function ( ) {
1897
+ Plotly . plot ( gd , fig )
1898
+ . then ( function ( ) {
1899
+ if ( hasCssTransform )
1900
+ transformPlot ( gd , cssTransform ) ;
1901
+ } )
1902
+ . then ( function ( ) {
1899
1903
return _run ( hasCssTransform ,
1900
1904
[ [ 400 , 200 ] , [ 445 , 235 ] ] ,
1901
1905
function ( ) {
@@ -1950,8 +1954,12 @@ describe('Test select box and lasso per trace:', function() {
1950
1954
fig . layout . dragmode = 'select' ;
1951
1955
addInvisible ( fig ) ;
1952
1956
1953
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
1954
- Plotly . plot ( gd , fig ) . then ( function ( ) {
1957
+ Plotly . plot ( gd , fig )
1958
+ . then ( function ( ) {
1959
+ if ( hasCssTransform )
1960
+ transformPlot ( gd , cssTransform ) ;
1961
+ } )
1962
+ . then ( function ( ) {
1955
1963
return _run ( hasCssTransform ,
1956
1964
[ [ 300 , 200 ] , [ 400 , 250 ] ] ,
1957
1965
function ( ) {
@@ -1997,7 +2005,7 @@ describe('Test select box and lasso per trace:', function() {
1997
2005
} ;
1998
2006
addInvisible ( fig ) ;
1999
2007
2000
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2008
+ if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2001
2009
Plotly . plot ( gd , fig ) . then ( function ( ) {
2002
2010
return _run ( hasCssTransform ,
2003
2011
[ [ 370 , 120 ] , [ 500 , 200 ] ] ,
@@ -2056,8 +2064,12 @@ describe('Test select box and lasso per trace:', function() {
2056
2064
} ;
2057
2065
addInvisible ( fig ) ;
2058
2066
2059
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2060
- Plotly . plot ( gd , fig ) . then ( function ( ) {
2067
+ Plotly . plot ( gd , fig )
2068
+ . then ( function ( ) {
2069
+ if ( hasCssTransform )
2070
+ transformPlot ( gd , cssTransform ) ;
2071
+ } )
2072
+ . then ( function ( ) {
2061
2073
return _run ( hasCssTransform ,
2062
2074
[ [ 150 , 150 ] , [ 300 , 300 ] ] ,
2063
2075
function ( ) {
@@ -2128,8 +2140,11 @@ describe('Test select box and lasso per trace:', function() {
2128
2140
} ;
2129
2141
addInvisible ( fig ) ;
2130
2142
2131
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2132
2143
Plotly . plot ( gd , fig )
2144
+ . then ( function ( ) {
2145
+ if ( hasCssTransform )
2146
+ transformPlot ( gd , cssTransform ) ;
2147
+ } )
2133
2148
. then ( function ( ) {
2134
2149
return _run ( hasCssTransform ,
2135
2150
[ [ 350 , 200 ] , [ 450 , 400 ] ] ,
@@ -2202,8 +2217,12 @@ describe('Test select box and lasso per trace:', function() {
2202
2217
fig . layout . dragmode = 'select' ;
2203
2218
addInvisible ( fig ) ;
2204
2219
2205
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2206
- Plotly . plot ( gd , fig ) . then ( function ( ) {
2220
+ Plotly . plot ( gd , fig )
2221
+ . then ( function ( ) {
2222
+ if ( hasCssTransform )
2223
+ transformPlot ( gd , cssTransform ) ;
2224
+ } )
2225
+ . then ( function ( ) {
2207
2226
return _run ( hasCssTransform ,
2208
2227
[ [ 150 , 150 ] , [ 350 , 250 ] ] ,
2209
2228
function ( ) {
@@ -2245,8 +2264,12 @@ describe('Test select box and lasso per trace:', function() {
2245
2264
fig . layout . dragmode = 'select' ;
2246
2265
addInvisible ( fig ) ;
2247
2266
2248
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2249
- Plotly . plot ( gd , fig ) . then ( function ( ) {
2267
+ Plotly . plot ( gd , fig )
2268
+ . then ( function ( ) {
2269
+ if ( hasCssTransform )
2270
+ transformPlot ( gd , cssTransform ) ;
2271
+ } )
2272
+ . then ( function ( ) {
2250
2273
return _run ( hasCssTransform ,
2251
2274
[ [ 150 , 150 ] , [ 250 , 250 ] ] ,
2252
2275
function ( ) {
@@ -2313,8 +2336,11 @@ describe('Test select box and lasso per trace:', function() {
2313
2336
emptyChoroplethTrace . z = [ ] ;
2314
2337
fig . data . push ( emptyChoroplethTrace ) ;
2315
2338
2316
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2317
2339
Plotly . plot ( gd , fig )
2340
+ . then ( function ( ) {
2341
+ if ( hasCssTransform )
2342
+ transformPlot ( gd , cssTransform ) ;
2343
+ } )
2318
2344
. then ( function ( ) {
2319
2345
return _run ( hasCssTransform ,
2320
2346
[ [ 350 , 200 ] , [ 400 , 250 ] ] ,
@@ -2369,8 +2395,11 @@ describe('Test select box and lasso per trace:', function() {
2369
2395
fig . layout . dragmode = 'lasso' ;
2370
2396
addInvisible ( fig ) ;
2371
2397
2372
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2373
2398
Plotly . plot ( gd , fig )
2399
+ . then ( function ( ) {
2400
+ if ( hasCssTransform )
2401
+ transformPlot ( gd , cssTransform ) ;
2402
+ } )
2374
2403
. then ( function ( ) {
2375
2404
return _run ( hasCssTransform ,
2376
2405
[ [ 400 , 300 ] , [ 200 , 400 ] , [ 400 , 500 ] , [ 600 , 400 ] , [ 500 , 350 ] ] ,
@@ -2430,8 +2459,11 @@ describe('Test select box and lasso per trace:', function() {
2430
2459
fig . layout . dragmode = 'lasso' ;
2431
2460
addInvisible ( fig ) ;
2432
2461
2433
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2434
2462
Plotly . plot ( gd , fig )
2463
+ . then ( function ( ) {
2464
+ if ( hasCssTransform )
2465
+ transformPlot ( gd , cssTransform ) ;
2466
+ } )
2435
2467
. then ( function ( ) {
2436
2468
return _run ( hasCssTransform ,
2437
2469
[ [ 400 , 300 ] , [ 200 , 400 ] , [ 400 , 500 ] , [ 600 , 400 ] , [ 500 , 350 ] ] ,
@@ -2493,8 +2525,11 @@ describe('Test select box and lasso per trace:', function() {
2493
2525
fig . layout . dragmode = 'lasso' ;
2494
2526
addInvisible ( fig ) ;
2495
2527
2496
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2497
2528
Plotly . plot ( gd , fig )
2529
+ . then ( function ( ) {
2530
+ if ( hasCssTransform )
2531
+ transformPlot ( gd , cssTransform ) ;
2532
+ } )
2498
2533
. then ( function ( ) {
2499
2534
return _run ( hasCssTransform ,
2500
2535
[ [ 350 , 200 ] , [ 400 , 200 ] , [ 400 , 250 ] , [ 350 , 250 ] , [ 350 , 200 ] ] ,
@@ -2600,8 +2635,11 @@ describe('Test select box and lasso per trace:', function() {
2600
2635
var x1 = 250 ;
2601
2636
var y1 = 250 ;
2602
2637
2603
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2604
2638
Plotly . plot ( gd , fig )
2639
+ . then ( function ( ) {
2640
+ if ( hasCssTransform )
2641
+ transformPlot ( gd , cssTransform ) ;
2642
+ } )
2605
2643
. then ( function ( ) {
2606
2644
return _run ( hasCssTransform ,
2607
2645
[ [ x0 , y0 ] , [ x1 , y0 ] , [ x1 , y1 ] , [ x0 , y1 ] , [ x0 , y0 ] ] ,
@@ -2649,8 +2687,11 @@ describe('Test select box and lasso per trace:', function() {
2649
2687
fig . layout . height = 500 ;
2650
2688
addInvisible ( fig ) ;
2651
2689
2652
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2653
2690
Plotly . plot ( gd , fig )
2691
+ . then ( function ( ) {
2692
+ if ( hasCssTransform )
2693
+ transformPlot ( gd , cssTransform ) ;
2694
+ } )
2654
2695
. then ( function ( ) {
2655
2696
return _run ( hasCssTransform ,
2656
2697
[ [ 200 , 200 ] , [ 400 , 200 ] , [ 400 , 350 ] , [ 200 , 350 ] , [ 200 , 200 ] ] ,
@@ -2705,8 +2746,11 @@ describe('Test select box and lasso per trace:', function() {
2705
2746
fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
2706
2747
addInvisible ( fig ) ;
2707
2748
2708
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2709
2749
Plotly . plot ( gd , fig )
2750
+ . then ( function ( ) {
2751
+ if ( hasCssTransform )
2752
+ transformPlot ( gd , cssTransform ) ;
2753
+ } )
2710
2754
. then ( function ( ) {
2711
2755
return _run ( hasCssTransform ,
2712
2756
[ [ 200 , 200 ] , [ 400 , 200 ] , [ 400 , 350 ] , [ 200 , 350 ] , [ 200 , 200 ] ] ,
@@ -2778,8 +2822,11 @@ describe('Test select box and lasso per trace:', function() {
2778
2822
}
2779
2823
} ;
2780
2824
2781
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2782
2825
Plotly . plot ( gd , fig )
2826
+ . then ( function ( ) {
2827
+ if ( hasCssTransform )
2828
+ transformPlot ( gd , cssTransform ) ;
2829
+ } )
2783
2830
. then ( function ( ) {
2784
2831
return _run ( hasCssTransform ,
2785
2832
[ [ 200 , 200 ] , [ 400 , 200 ] , [ 400 , 350 ] , [ 200 , 350 ] , [ 200 , 200 ] ] ,
@@ -2821,8 +2868,11 @@ describe('Test select box and lasso per trace:', function() {
2821
2868
fig . layout . height = 500 ;
2822
2869
addInvisible ( fig ) ;
2823
2870
2824
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2825
2871
Plotly . plot ( gd , fig )
2872
+ . then ( function ( ) {
2873
+ if ( hasCssTransform )
2874
+ transformPlot ( gd , cssTransform ) ;
2875
+ } )
2826
2876
. then ( function ( ) {
2827
2877
return _run ( hasCssTransform ,
2828
2878
[ [ 200 , 200 ] , [ 400 , 200 ] , [ 400 , 350 ] , [ 200 , 350 ] , [ 200 , 200 ] ] ,
@@ -2903,7 +2953,6 @@ describe('Test select box and lasso per trace:', function() {
2903
2953
return unselected ;
2904
2954
}
2905
2955
2906
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2907
2956
Plotly . newPlot ( gd , [ {
2908
2957
type : type ,
2909
2958
x : [ '2011-01-02' , '2011-01-03' , '2011-01-04' ] ,
@@ -2918,6 +2967,10 @@ describe('Test select box and lasso per trace:', function() {
2918
2967
yaxis : { range : [ - 3 , 9 ] } ,
2919
2968
dragmode : 'lasso'
2920
2969
} )
2970
+ . then ( function ( ) {
2971
+ if ( hasCssTransform )
2972
+ transformPlot ( gd , cssTransform ) ;
2973
+ } )
2921
2974
. then ( function ( ) {
2922
2975
return _run ( hasCssTransform ,
2923
2976
[ [ l0 , t ] , [ l0 , b ] , [ r0 , b ] , [ r0 , t ] , [ l0 , t ] ] ,
@@ -2958,7 +3011,6 @@ describe('Test select box and lasso per trace:', function() {
2958
3011
it ( '@flaky should work on traces with enabled transforms, hasCssTransform: ' + hasCssTransform , function ( done ) {
2959
3012
var assertSelectedPoints = makeAssertSelectedPoints ( ) ;
2960
3013
2961
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
2962
3014
Plotly . plot ( gd , [ {
2963
3015
x : [ 1 , 2 , 3 , 4 , 5 ] ,
2964
3016
y : [ 2 , 3 , 1 , 7 , 9 ] ,
@@ -2985,6 +3037,10 @@ describe('Test select box and lasso per trace:', function() {
2985
3037
height : 400 ,
2986
3038
margin : { l : 0 , t : 0 , r : 0 , b : 0 }
2987
3039
} )
3040
+ . then ( function ( ) {
3041
+ if ( hasCssTransform )
3042
+ transformPlot ( gd , cssTransform ) ;
3043
+ } )
2988
3044
. then ( function ( ) {
2989
3045
return _run ( hasCssTransform ,
2990
3046
[ [ 5 , 5 ] , [ 395 , 395 ] ] ,
@@ -3015,7 +3071,6 @@ describe('Test select box and lasso per trace:', function() {
3015
3071
} ) ;
3016
3072
}
3017
3073
3018
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
3019
3074
Plotly . plot ( gd , [ {
3020
3075
mode : 'markers+text' ,
3021
3076
x : [ 1 , 2 , 3 ] ,
@@ -3035,6 +3090,10 @@ describe('Test select box and lasso per trace:', function() {
3035
3090
height : 400 ,
3036
3091
margin : { l : 0 , t : 0 , r : 0 , b : 0 }
3037
3092
} )
3093
+ . then ( function ( ) {
3094
+ if ( hasCssTransform )
3095
+ transformPlot ( gd , cssTransform ) ;
3096
+ } )
3038
3097
. then ( function ( ) {
3039
3098
return _run ( hasCssTransform ,
3040
3099
[ [ 10 , 10 ] , [ 100 , 300 ] ] ,
@@ -3062,8 +3121,11 @@ describe('Test select box and lasso per trace:', function() {
3062
3121
fig . layout . dragmode = 'select' ;
3063
3122
var dblClickPos = [ 250 , 400 ] ;
3064
3123
3065
- if ( hasCssTransform ) transformPlot ( gd , cssTransform ) ;
3066
3124
Plotly . plot ( gd , fig )
3125
+ . then ( function ( ) {
3126
+ if ( hasCssTransform )
3127
+ transformPlot ( gd , cssTransform ) ;
3128
+ } )
3067
3129
. then ( function ( ) {
3068
3130
// No groups initially
3069
3131
expect ( gd . _fullData [ 0 ] . node . groups ) . toEqual ( [ ] ) ;
0 commit comments