@@ -194,6 +194,7 @@ describe('Test hover and click interactions', function() {
194
194
}
195
195
} ;
196
196
_mock . data [ 0 ] . hoverinfo = _mock . data [ 0 ] . x . map ( function ( _ , i ) { return i % 2 ? 'y' : 'x' ; } ) ;
197
+
197
198
_mock . data [ 0 ] . hoverlabel = {
198
199
bgcolor : 'blue' ,
199
200
bordercolor : _mock . data [ 0 ] . x . map ( function ( _ , i ) { return i % 2 ? 'red' : 'green' ; } )
@@ -464,7 +465,7 @@ describe('@noCI Test gl2d lasso/select:', function() {
464
465
} ) ;
465
466
466
467
var gd ;
467
- var selectPath = [ [ 93 , 193 ] , [ 143 , 193 ] ] ;
468
+ var selectPath = [ [ 103 , 193 ] , [ 113 , 193 ] ] ;
468
469
var lassoPath = [ [ 316 , 171 ] , [ 318 , 239 ] , [ 335 , 243 ] , [ 328 , 169 ] ] ;
469
470
var lassoPath2 = [ [ 93 , 193 ] , [ 143 , 193 ] , [ 143 , 500 ] , [ 93 , 500 ] , [ 93 , 193 ] ] ;
470
471
@@ -508,9 +509,6 @@ describe('@noCI Test gl2d lasso/select:', function() {
508
509
} ) ;
509
510
}
510
511
511
- function countGlObjects ( ) {
512
- return gd . _fullLayout . _plots . xy . _scene2d . glplot . objects . length ;
513
- }
514
512
515
513
it ( 'should work under fast mode with *select* dragmode' , function ( done ) {
516
514
var _mock = Lib . extendDeep ( { } , mockFast ) ;
@@ -520,19 +518,19 @@ describe('@noCI Test gl2d lasso/select:', function() {
520
518
Plotly . plot ( gd , _mock )
521
519
. then ( delay ( 100 ) )
522
520
. then ( function ( ) {
523
- expect ( countGlObjects ( ) ) . toBe ( 1 , 'has on gl- scatter2d object ' ) ;
521
+ expect ( gd . _fullLayout . _plots . xy . _scene . select2d ) . not . toBe ( undefined , 'scatter2d renderer ' ) ;
524
522
525
523
return select ( selectPath ) ;
526
524
} )
527
525
. then ( function ( eventData ) {
528
526
assertEventData ( eventData , {
529
527
points : [
530
- { x : 3.911 , y : 0.401 } ,
531
- { x : 5.34 , y : 0.403 } ,
532
- { x : 6.915 , y : 0.411 }
528
+ { pointNumber : 25 , x : 1.425 , y : 0.538 } ,
529
+ { pointNumber : 26 , x : 1.753 , y : 0.5 } ,
530
+ { pointNumber : 27 , x : 2.22 , y : 0.45 }
533
531
]
534
532
} ) ;
535
- expect ( countGlObjects ( ) ) . toBe ( 2 , 'adds a dimmed gl-scatter2d objects' ) ;
533
+
536
534
} )
537
535
. catch ( fail )
538
536
. then ( done ) ;
@@ -546,19 +544,16 @@ describe('@noCI Test gl2d lasso/select:', function() {
546
544
Plotly . plot ( gd , _mock )
547
545
. then ( delay ( 100 ) )
548
546
. then ( function ( ) {
549
- expect ( countGlObjects ( ) ) . toBe ( 1 ) ;
550
-
551
547
return select ( lassoPath2 ) ;
552
548
} )
553
549
. then ( function ( eventData ) {
554
550
assertEventData ( eventData , {
555
551
points : [
556
- { x : 3.911 , y : 0.401 } ,
557
- { x : 5.34 , y : 0.403 } ,
558
- { x : 6.915 , y : 0.411 }
552
+ { pointNumber : 25 , x : 1.425 , y : 0.538 } ,
553
+ { pointNumber : 26 , x : 1.753 , y : 0.5 } ,
554
+ { pointNumber : 27 , x : 2.22 , y : 0.45 }
559
555
]
560
556
} ) ;
561
- expect ( countGlObjects ( ) ) . toBe ( 2 ) ;
562
557
} )
563
558
. catch ( fail )
564
559
. then ( done ) ;
@@ -572,15 +567,12 @@ describe('@noCI Test gl2d lasso/select:', function() {
572
567
Plotly . plot ( gd , _mock )
573
568
. then ( delay ( 100 ) )
574
569
. then ( function ( ) {
575
- expect ( countGlObjects ( ) ) . toBe ( 2 , 'has a gl-line2d and a gl-scatter2d-sdf' ) ;
576
-
577
570
return select ( selectPath ) ;
578
571
} )
579
572
. then ( function ( eventData ) {
580
573
assertEventData ( eventData , {
581
574
points : [ { x : 0.004 , y : 12.5 } ]
582
575
} ) ;
583
- expect ( countGlObjects ( ) ) . toBe ( 2 , 'only changes colors of gl-scatter2d-sdf object' ) ;
584
576
} )
585
577
. catch ( fail )
586
578
. then ( done ) ;
@@ -594,15 +586,12 @@ describe('@noCI Test gl2d lasso/select:', function() {
594
586
Plotly . plot ( gd , _mock )
595
587
. then ( delay ( 100 ) )
596
588
. then ( function ( ) {
597
- expect ( countGlObjects ( ) ) . toBe ( 2 , 'has a gl-line2d and a gl-scatter2d-sdf' ) ;
598
-
599
589
return select ( lassoPath ) ;
600
590
} )
601
591
. then ( function ( eventData ) {
602
592
assertEventData ( eventData , {
603
593
points : [ { x : 0.099 , y : 2.75 } ]
604
594
} ) ;
605
- expect ( countGlObjects ( ) ) . toBe ( 2 , 'only changes colors of gl-scatter2d-sdf object' ) ;
606
595
} )
607
596
. catch ( fail )
608
597
. then ( done ) ;
0 commit comments