@@ -290,5 +290,41 @@ describe('calculated data and points', function() {
290
290
// behavior, rather than an explicit 'explicit' categorymode.
291
291
} ) ;
292
292
} ) ;
293
+
294
+ describe ( 'ordering tests in the presence of multiple traces' , function ( ) {
295
+
296
+ it ( 'baseline testing for the unordered, disjunct case' , function ( ) {
297
+
298
+ var x1 = [ 'Gear' , 'Bearing' , 'Motor' ] ;
299
+ var x2 = [ 'Switch' , 'Plug' , 'Cord' , 'Fuse' , 'Bulb' ] ;
300
+ var x3 = [ 'Pump' , 'Leak' , 'Seals' ] ;
301
+
302
+ Plotly . plot ( gd , [ {
303
+ x : x1 ,
304
+ y : x1 . map ( function ( d , i ) { return i + 10 ; } )
305
+ } , {
306
+ x : x2 ,
307
+ y : x2 . map ( function ( d , i ) { return i + 20 ; } )
308
+ } , {
309
+ x : x3 ,
310
+ y : x3 . map ( function ( d , i ) { return i + 30 ; } )
311
+ } ] ) ;
312
+
313
+ expect ( gd . calcdata [ 0 ] [ 0 ] ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 10 } ) ) ;
314
+ expect ( gd . calcdata [ 0 ] [ 1 ] ) . toEqual ( jasmine . objectContaining ( { x : 1 , y : 11 } ) ) ;
315
+ expect ( gd . calcdata [ 0 ] [ 2 ] ) . toEqual ( jasmine . objectContaining ( { x : 2 , y : 12 } ) ) ;
316
+
317
+ expect ( gd . calcdata [ 1 ] [ 0 ] ) . toEqual ( jasmine . objectContaining ( { x : 3 , y : 20 } ) ) ;
318
+ expect ( gd . calcdata [ 1 ] [ 1 ] ) . toEqual ( jasmine . objectContaining ( { x : 4 , y : 21 } ) ) ;
319
+ expect ( gd . calcdata [ 1 ] [ 2 ] ) . toEqual ( jasmine . objectContaining ( { x : 5 , y : 22 } ) ) ;
320
+ expect ( gd . calcdata [ 1 ] [ 3 ] ) . toEqual ( jasmine . objectContaining ( { x : 6 , y : 23 } ) ) ;
321
+ expect ( gd . calcdata [ 1 ] [ 4 ] ) . toEqual ( jasmine . objectContaining ( { x : 7 , y : 24 } ) ) ;
322
+
323
+ expect ( gd . calcdata [ 2 ] [ 0 ] ) . toEqual ( jasmine . objectContaining ( { x : 8 , y : 30 } ) ) ;
324
+ expect ( gd . calcdata [ 2 ] [ 1 ] ) . toEqual ( jasmine . objectContaining ( { x : 9 , y : 31 } ) ) ;
325
+ expect ( gd . calcdata [ 2 ] [ 2 ] ) . toEqual ( jasmine . objectContaining ( { x : 10 , y : 32 } ) ) ;
326
+ } ) ;
327
+
328
+ } ) ;
293
329
} ) ;
294
330
} ) ;
0 commit comments