@@ -895,9 +895,9 @@ describe('@flaky Test select box and lasso per trace:', function() {
895895 keys . forEach ( function ( k , j ) {
896896 var msgFull = msg + 'selected pt ' + i + ' - ' + k + ' val' ;
897897
898- if ( typeof e [ j ] === 'number' ) {
898+ if ( typeof p [ k ] === 'number' && typeof e [ j ] === 'number' ) {
899899 expect ( p [ k ] ) . toBeCloseTo ( e [ j ] , 1 , msgFull ) ;
900- } else if ( Array . isArray ( e [ j ] ) ) {
900+ } else if ( Array . isArray ( p [ k ] ) && Array . isArray ( e [ j ] ) ) {
901901 expect ( p [ k ] ) . toBeCloseToArray ( e [ j ] , 1 , msgFull ) ;
902902 } else {
903903 expect ( p [ k ] ) . toBe ( e [ j ] , msgFull ) ;
@@ -1166,8 +1166,8 @@ describe('@flaky Test select box and lasso per trace:', function() {
11661166 var fig = {
11671167 data : [ {
11681168 type : 'scattergeo' ,
1169- lon : [ 10 , 20 , 30 ] ,
1170- lat : [ 10 , 20 , 30 ]
1169+ lon : [ 10 , 20 , 30 , null ] ,
1170+ lat : [ 10 , 20 , 30 , null ]
11711171 } , {
11721172 type : 'scattergeo' ,
11731173 lon : [ - 10 , - 20 , - 30 ] ,
@@ -1212,6 +1212,25 @@ describe('@flaky Test select box and lasso per trace:', function() {
12121212 null , LASSOEVENTS , 'scattergeo lasso'
12131213 ) ;
12141214 } )
1215+ . then ( function ( ) {
1216+ // some projection types can't handle BADNUM during c2p,
1217+ // make they are skipped here
1218+ return Plotly . relayout ( gd , 'geo.projection.type' , 'robinson' ) ;
1219+ } )
1220+ . then ( function ( ) {
1221+ return _run (
1222+ [ [ 300 , 200 ] , [ 300 , 300 ] , [ 400 , 300 ] , [ 400 , 200 ] , [ 300 , 200 ] ] ,
1223+ function ( ) {
1224+ assertPoints ( [ [ - 10 , 10 ] , [ - 20 , 20 ] , [ - 30 , 30 ] ] ) ;
1225+ assertSelectedPoints ( { 0 : [ ] , 1 : [ 0 , 1 , 2 ] } ) ;
1226+ assertNodeOpacity ( { 0 : [ 0.2 , 0.2 , 0.2 ] , 1 : [ 1 , 1 , 1 ] } ) ;
1227+ assertLassoPoints ( [
1228+ [ - 67.40 , 55.07 ] , [ - 56.33 , 4.968 ] , [ 0 , 4.968 ] , [ 0 , 55.07 ] , [ - 67.40 , 55.07 ]
1229+ ] ) ;
1230+ } ,
1231+ null , LASSOEVENTS , 'scattergeo lasso (on robinson projection)'
1232+ ) ;
1233+ } )
12151234 . then ( function ( ) {
12161235 // make sure selection handlers don't get called in 'pan' dragmode
12171236 return Plotly . relayout ( gd , 'dragmode' , 'pan' ) ;
0 commit comments