@@ -19,7 +19,10 @@ describe('groupby', function() {
19
19
transforms: [{
20
20
type: 'groupby',
21
21
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
22
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
22
+ style: [
23
+ {target: 'a', value: {marker: {color: 'red'}}},
24
+ {target: 'b', value: {marker: {color: 'blue'}}}
25
+ ]
23
26
}]
24
27
}];
25
28
@@ -30,7 +33,10 @@ describe('groupby', function() {
30
33
transforms: [{
31
34
type: 'groupby',
32
35
groups: ['b', 'a', 'b', 'b', 'b', 'a', 'a'],
33
- style: { a: {marker: {color: 'green'}}, b: {marker: {color: 'black'}} }
36
+ style: [
37
+ {target: 'a', value: {marker: {color: 'green'}}},
38
+ {target: 'b', value: {marker: {color: 'black'}}}
39
+ ]
34
40
}]
35
41
}];
36
42
@@ -92,7 +98,10 @@ describe('groupby', function() {
92
98
expect(gd._fullData[1].marker.opacity).toEqual(1);
93
99
94
100
return Plotly.restyle(gd, {
95
- 'transforms[0].style': { a: {marker: {color: 'green'}}, b: {marker: {color: 'red'}} },
101
+ 'transforms[0].style': [
102
+ {target: 'a', value: {marker: {color: 'green'}}},
103
+ {target: 'b', value: {marker: {color: 'red'}}}
104
+ ],
96
105
'marker.opacity': 0.4
97
106
});
98
107
}).then(function() {
@@ -192,7 +201,10 @@ describe('groupby', function() {
192
201
transforms: [{
193
202
type: 'groupby',
194
203
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
195
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
204
+ style: [
205
+ {target: 'a', value: {marker: {color: 'red'}}},
206
+ {target: 'b', value: {marker: {color: 'blue'}}}
207
+ ]
196
208
}]
197
209
}];
198
210
@@ -387,7 +399,10 @@ describe('groupby', function() {
387
399
transforms: [{
388
400
type: 'groupby',
389
401
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
390
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
402
+ style: [
403
+ {target: 'a', value: {marker: {color: 'red'}}},
404
+ {taret: 'b', value: {marker: {color: 'blue'}}}
405
+ ]
391
406
}]
392
407
}];
393
408
@@ -401,17 +416,20 @@ describe('groupby', function() {
401
416
transforms: [{
402
417
type: 'groupby',
403
418
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
404
- style: {
405
- a: {
419
+ style: [{
420
+ target: 'a',
421
+ value: {
406
422
marker: {
407
423
color: 'orange',
408
424
size: 20,
409
425
line: {
410
426
color: 'red'
411
427
}
412
428
}
413
- },
414
- b: {
429
+ }
430
+ }, {
431
+ target: 'b',
432
+ value: {
415
433
mode: 'markers+lines', // heterogeonos attributes are OK: group 'a' doesn't need to define this
416
434
marker: {
417
435
color: 'cyan',
@@ -426,7 +444,7 @@ describe('groupby', function() {
426
444
color: 'purple'
427
445
}
428
446
}
429
- }
447
+ }]
430
448
}]
431
449
}];
432
450
@@ -447,11 +465,14 @@ describe('groupby', function() {
447
465
transforms: [{
448
466
type: 'groupby',
449
467
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
450
- style: {
451
- a: {marker: {size: 30}},
468
+ style: [{
469
+ target: 'a',
470
+ value: {marker: {size: 30}}
471
+ }, {
452
472
// override general color:
453
- b: {marker: {size: 15, line: {color: 'yellow'}}, line: {color: 'purple'}}
454
- }
473
+ target: 'b',
474
+ value: {marker: {size: 15, line: {color: 'yellow'}}, line: {color: 'purple'}}
475
+ }]
455
476
}]
456
477
}];
457
478
@@ -464,7 +485,7 @@ describe('groupby', function() {
464
485
transforms: [{
465
486
type: 'groupby',
466
487
groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
467
- style: { /* can be empty, or of partial group id coverage */}
488
+ style: [ /* can be empty, or of partial group id coverage */]
468
489
}]
469
490
}];
470
491
@@ -548,7 +569,10 @@ describe('groupby', function() {
548
569 transforms: [{
549
570
type: 'groupby',
550
571
// groups: ['a', 'a', 'b', 'a', 'b', 'b', 'a'],
551
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
572
+ style: [
573
+ {target: 'a', value: {marker: {color: 'red'}}},
574
+ {target: 'b', value: {marker: {color: 'blue'}}}
575
+ ]
552
576
}]
553
577
}];
554
578
@@ -561,7 +585,10 @@ describe('groupby', function() {
561
585
transforms: [{
562
586
type: 'groupby',
563
587
groups: [],
564
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
588
+ style: [
589
+ {target: 'a', value: {marker: {color: 'red'}}},
590
+ {target: 'b', value: {marker: {color: 'blue'}}}
591
+ ]
565
592
}]
566
593
}];
567
594
@@ -574,7 +601,10 @@ describe('groupby', function() {
574
601
transforms: [{
575
602
type: 'groupby',
576
603
groups: null,
577
- style: { a: {marker: {color: 'red'}}, b: {marker: {color: 'blue'}} }
604
+ style: [
605
+ {target: 'a', value: {marker: {color: 'red'}}},
606
+ {target: 'b', value: {marker: {color: 'blue'}}}
607
+ ]
578
608
}]
579
609
}];
580
610
0 commit comments