@@ -522,4 +522,56 @@ describe('groupby', function() {
522
522
523
523
} ) ;
524
524
525
+ describe ( 'passes with no `groups`' , function ( ) {
526
+ 'use strict' ;
527
+
528
+ afterEach ( destroyGraphDiv ) ;
529
+
530
+ var mockData = [ {
531
+ mode : 'markers+lines' ,
532
+ ids : [ 'q' , 'w' , 'r' , 't' , 'y' , 'u' , 'i' ] ,
533
+ x : [ 1 , - 1 , - 2 , 0 , 1 , 2 , 3 ] ,
534
+ y : [ 0 , 1 , 2 , 3 , 5 , 4 , 6 ] ,
535
+ marker : { size : 20 , line : { width : [ 4 , 2 , 4 , 2 , 2 , 3 , 3 ] } } ,
536
+ transforms : [ {
537
+ type : 'groupby' ,
538
+ //groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
539
+ style : { a : { marker : { color : 'red' } } , b : { marker : { color : 'blue' } } }
540
+ } ]
541
+ } ] ;
542
+
543
+ it ( "passes" , function ( done ) {
544
+ var data = Lib . extendDeep ( [ ] , mockData ) ;
545
+
546
+ var gd = createGraphDiv ( ) ;
547
+
548
+ Plotly . plot ( gd , data ) . then ( function ( ) {
549
+
550
+ /*
551
+ expect(gd.data.length).toEqual(1);
552
+ expect(gd.data[0].ids).toEqual(['q', 'w', 'r', 't', 'y', 'u', 'i']);
553
+ expect(gd.data[0].x).toEqual([1, -1, -2, 0, 1, 2, 3]);
554
+ expect(gd.data[0].y).toEqual([0, 1, 2, 3, 5, 4, 6]);
555
+ expect(gd.data[0].marker.line.width).toEqual([4, 2, 4, 2, 2, 3, 3]);
556
+
557
+ expect(gd._fullData.length).toEqual(2);
558
+
559
+ expect(gd._fullData[0].ids).toEqual(['q', 'w', 't', 'i']);
560
+ expect(gd._fullData[0].x).toEqual([1, -1, 0, 3]);
561
+ expect(gd._fullData[0].y).toEqual([0, 1, 3, 6]);
562
+ expect(gd._fullData[0].marker.line.width).toEqual([4, 2, 2, 3]);
563
+
564
+ expect(gd._fullData[1].ids).toEqual(['r', 'y', 'u']);
565
+ expect(gd._fullData[1].x).toEqual([-2, 1, 2]);
566
+ expect(gd._fullData[1].y).toEqual([2, 5, 4]);
567
+ expect(gd._fullData[1].marker.line.width).toEqual([4, 2, 3]);
568
+
569
+ assertDims([4, 3]);
570
+ */
571
+
572
+ done ( ) ;
573
+ } ) ;
574
+ } ) ;
575
+
576
+ } ) ;
525
577
} ) ;
0 commit comments