@@ -1375,9 +1375,10 @@ describe('Test sunburst texttemplate without `values` should work:', function()
1375
1375
] ) ;
1376
1376
} ) ;
1377
1377
1378
- describe ( 'Test sunburst texttemplate with `values` should work:' , function ( ) {
1378
+ describe ( 'Test sunburst texttemplate with *total* `values` should work:' , function ( ) {
1379
1379
checkTextTemplate ( [ {
1380
1380
type : 'sunburst' ,
1381
+ branchvalues : 'total' ,
1381
1382
labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' ] ,
1382
1383
parents : [ '' , 'Eve' , 'Eve' , 'Seth' , 'Seth' , 'Eve' , 'Eve' , 'Awan' , 'Eve' ] ,
1383
1384
values : [ 65 , 14 , 12 , 10 , 2 , 6 , 6 , 1 , 4 ] ,
@@ -1391,7 +1392,7 @@ describe('Test sunburst texttemplate with `values` should work:', function() {
1391
1392
[ '%{percentEntry} of %{entry}' , [ '100% of Eve' , '22% of Eve' , '18% of Eve' , '9% of Eve' , '9% of Eve' , '6% of Eve' , '15% of Eve' , '3% of Eve' , '2% of Eve' ] ] ,
1392
1393
[ '%{percentParent} of %{parent}' , [
1393
1394
'%{percentParent} of %{parent}' , // TODO: what should be printed for the parent of root?
1394
- '83 % of Seth ' , '22 % of Eve' , '18 % of Eve' , '9% of Eve' , '9 % of Eve' , '6 % of Eve ' , '17% of Seth' , '17% of Awan'
1395
+ '22 % of Eve ' , '18 % of Eve' , '9 % of Eve' , '9% of Eve' , '6 % of Eve' , '83 % of Seth ' , '17% of Seth' , '17% of Awan'
1395
1396
] ] ,
1396
1397
[
1397
1398
[
@@ -1419,3 +1420,49 @@ describe('Test sunburst texttemplate with `values` should work:', function() {
1419
1420
]
1420
1421
] ) ;
1421
1422
} ) ;
1423
+
1424
+ describe ( 'Test sunburst texttemplate with *remainder* `values` should work:' , function ( ) {
1425
+ checkTextTemplate ( [ {
1426
+ type : 'sunburst' ,
1427
+ branchvalues : 'remainder' ,
1428
+ labels : [ 'Eve' , 'Cain' , 'Seth' , 'Enos' , 'Noam' , 'Abel' , 'Awan' , 'Enoch' , 'Azura' ] ,
1429
+ parents : [ '' , 'Eve' , 'Eve' , 'Seth' , 'Seth' , 'Eve' , 'Eve' , 'Awan' , 'Eve' ] ,
1430
+ values : [ 65 , 14 , 12 , 10 , 2 , 6 , 6 , 1 , 4 ] ,
1431
+ text : [ 'sixty-five' , 'fourteen' , 'twelve' , 'ten' , 'two' , 'six' , 'six' , 'one' , 'four' ]
1432
+ } ] , 'g.slicetext' , [
1433
+ [ 'color: %{color}' , [ 'color: rgba(0,0,0,0)' , 'color: #1f77b4' , 'color: #ff7f0e' , 'color: #2ca02c' , 'color: #d62728' , 'color: #9467bd' , 'color: #ff7f0e' , 'color: #ff7f0e' , 'color: #d62728' ] ] ,
1434
+ [ 'label: %{label}' , [ 'label: Eve' , 'label: Cain' , 'label: Seth' , 'label: Enos' , 'label: Noam' , 'label: Abel' , 'label: Awan' , 'label: Enoch' , 'label: Azura' ] ] ,
1435
+ [ 'value: %{value}' , [ 'value: 65' , 'value: 14' , 'value: 12' , 'value: 10' , 'value: 2' , 'value: 6' , 'value: 6' , 'value: 1' , 'value: 4' ] ] ,
1436
+ [ 'text: %{text}' , [ 'text: sixty-five' , 'text: fourteen' , 'text: twelve' , 'text: ten' , 'text: two' , 'text: six' , 'text: six' , 'text: one' , 'text: four' ] ] ,
1437
+ [ '%{percentRoot} of %{root}' , [ '54% of Eve' , '10% of Eve' , '12% of Eve' , '5% of Eve' , '5% of Eve' , '3% of Eve' , '8% of Eve' , '2% of Eve' , '1% of Eve' ] ] ,
1438
+ [ '%{percentEntry} of %{entry}' , [ '54% of Eve' , '10% of Eve' , '12% of Eve' , '5% of Eve' , '5% of Eve' , '3% of Eve' , '8% of Eve' , '2% of Eve' , '1% of Eve' ] ] ,
1439
+ [ '%{percentParent} of %{parent}' , [
1440
+ '%{percentParent} of %{parent}' , // TODO: what should be printed for the parent of root?
1441
+ '10% of Eve' , '12% of Eve' , '5% of Eve' , '5% of Eve' , '3% of Eve' , '42% of Seth' , '8% of Seth' , '14% of Awan'
1442
+ ] ] ,
1443
+ [
1444
+ [
1445
+ 'label: %{label}' ,
1446
+ 'text: %{text}' ,
1447
+ 'value: %{value}' ,
1448
+ '%{percentRoot} of %{root}' ,
1449
+ '%{percentEntry} of %{entry}' ,
1450
+ '%{percentParent} of %{parent}' ,
1451
+ '%{percentParent} of %{parent}' ,
1452
+ '%{percentParent} of %{parent}' ,
1453
+ 'color: %{color}'
1454
+ ] ,
1455
+ [
1456
+ 'label: Eve' ,
1457
+ 'text: fourteen' ,
1458
+ 'value: 12' ,
1459
+ '5% of Eve' ,
1460
+ '5% of Eve' ,
1461
+ '8% of Eve' ,
1462
+ '2% of Eve' ,
1463
+ '14% of Awan' ,
1464
+ 'color: #9467bd'
1465
+ ]
1466
+ ]
1467
+ ] ) ;
1468
+ } ) ;
0 commit comments