File tree 2 files changed +35
-4
lines changed
2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,17 @@ function calc(gd, trace) {
59
59
xa = AxisIDs . getFromId ( gd , trace . _diag [ i ] [ 0 ] ) ;
60
60
ya = AxisIDs . getFromId ( gd , trace . _diag [ i ] [ 1 ] ) ;
61
61
62
+ // if corresponding x & y axes don't have matching types, skip dim
63
+ if ( xa && ya && xa . type !== ya . type ) continue ;
64
+
62
65
if ( xa ) {
63
66
makeCalcdata ( xa , dim ) ;
64
67
if ( ya && ya . type === 'category' ) {
65
68
ya . _categories = xa . _categories . slice ( ) ;
66
69
}
67
- } else if ( ya ) {
70
+ } else {
71
+ // should not make it here, if both xa and ya undefined
68
72
makeCalcdata ( ya , dim ) ;
69
- if ( xa && xa . type === 'category' ) {
70
- xa . _categories = ya . _categories . slice ( ) ;
71
- }
72
73
}
73
74
}
74
75
}
Original file line number Diff line number Diff line change @@ -359,6 +359,36 @@ describe('Test splom trace defaults:', function() {
359
359
} ) ;
360
360
} ) ;
361
361
362
+ describe ( 'Test splom trace calc step:' , function ( ) {
363
+ var gd ;
364
+
365
+ function _calc ( opts , layout ) {
366
+ gd = { } ;
367
+
368
+ gd . data = [ Lib . extendFlat ( { type : 'splom' } , opts || { } ) ] ;
369
+ gd . layout = layout || { } ;
370
+ supplyAllDefaults ( gd ) ;
371
+ Plots . doCalcdata ( gd ) ;
372
+ }
373
+
374
+ it ( 'should skip dimensions with conflicting axis types' , function ( ) {
375
+ _calc ( {
376
+ dimensions : [ {
377
+ values : [ 1 , 2 , 3 ]
378
+ } , {
379
+ values : [ 2 , 1 , 2 ]
380
+ } ]
381
+ } , {
382
+ xaxis : { type : 'category' } ,
383
+ yaxis : { type : 'linear' }
384
+ } ) ;
385
+
386
+ var cd = gd . calcdata [ 0 ] [ 0 ] ;
387
+
388
+ expect ( cd . t . _scene . matrixOptions . data ) . toBeCloseTo2DArray ( [ [ 2 , 1 , 2 ] ] ) ;
389
+ } ) ;
390
+ } ) ;
391
+
362
392
describe ( '@gl Test splom interactions:' , function ( ) {
363
393
var gd ;
364
394
You can’t perform that action at this time.
0 commit comments