@@ -895,9 +895,9 @@ describe('@flaky Test select box and lasso per trace:', function() {
895
895
keys . forEach ( function ( k , j ) {
896
896
var msgFull = msg + 'selected pt ' + i + ' - ' + k + ' val' ;
897
897
898
- if ( typeof e [ j ] === 'number' ) {
898
+ if ( typeof p [ k ] === 'number' && typeof e [ j ] === 'number' ) {
899
899
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 ] ) ) {
901
901
expect ( p [ k ] ) . toBeCloseToArray ( e [ j ] , 1 , msgFull ) ;
902
902
} else {
903
903
expect ( p [ k ] ) . toBe ( e [ j ] , msgFull ) ;
@@ -1166,8 +1166,8 @@ describe('@flaky Test select box and lasso per trace:', function() {
1166
1166
var fig = {
1167
1167
data : [ {
1168
1168
type : 'scattergeo' ,
1169
- lon : [ 10 , 20 , 30 ] ,
1170
- lat : [ 10 , 20 , 30 ]
1169
+ lon : [ 10 , 20 , 30 , null ] ,
1170
+ lat : [ 10 , 20 , 30 , null ]
1171
1171
} , {
1172
1172
type : 'scattergeo' ,
1173
1173
lon : [ - 10 , - 20 , - 30 ] ,
@@ -1212,6 +1212,25 @@ describe('@flaky Test select box and lasso per trace:', function() {
1212
1212
null , LASSOEVENTS , 'scattergeo lasso'
1213
1213
) ;
1214
1214
} )
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
+ } )
1215
1234
. then ( function ( ) {
1216
1235
// make sure selection handlers don't get called in 'pan' dragmode
1217
1236
return Plotly . relayout ( gd , 'dragmode' , 'pan' ) ;
0 commit comments