Skip to content

Commit 1258f2d

Browse files
committed
rename 'extra' -> 'remainder' + attrs description fixes
1 parent 5d981c2 commit 1258f2d

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/traces/sunburst/attributes.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ var pieAtts = require('../pie/attributes');
1515

1616
var extendFlat = require('../../lib/extend').extendFlat;
1717

18-
// TODO should we use singular `label`, `parent` and `value`?
19-
2018
module.exports = {
2119
labels: {
2220
valType: 'data_array',
@@ -34,7 +32,7 @@ module.exports = {
3432
'the root node in the hierarchy.',
3533
'If `ids` is filled, `parents` items are understood to be "ids" themselves.',
3634
'When `ids` is not set, plotly attempts to find matching items in `labels`,',
37-
'but beware there must be unique.'
35+
'but beware they must be unique.'
3836
].join(' ')
3937
},
4038

@@ -48,14 +46,14 @@ module.exports = {
4846
},
4947
branchvalues: {
5048
valType: 'enumerated',
51-
values: ['total', 'extra'],
52-
dflt: 'extra',
49+
values: ['remainder', 'total'],
50+
dflt: 'remainder',
5351
editType: 'calc',
5452
role: 'info',
5553
description: [
5654
'Determines how the items in `values` are summed.',
5755
'When set to *total*, items in `values` are taken to be value of all its descendants.',
58-
'When set to *extra*, items in `values` corresponding to the root and the branches sectors',
56+
'When set to *remainder*, items in `values` corresponding to the root and the branches sectors',
5957
'are taken to be the extra part not part of the sum of the values at their leaves.'
6058
].join(' ')
6159
},

src/traces/sunburst/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ exports.calc = function(gd, trace) {
137137

138138
if(hasVals) {
139139
switch(trace.branchvalues) {
140-
case 'extra':
140+
case 'remainder':
141141
hierarchy.sum(function(d) { return d.data.v; });
142142
break;
143143
case 'total':
370 Bytes
Loading

test/image/mocks/sunburst_values.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"data": [
33
{
44
"type": "sunburst",
5-
"name": "with branchvalues:extra",
5+
"name": "with branchvalues:remainder",
66
"labels": ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
77
"parents": ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
88
"values": [10, 14, 12, 10, 2, 6, 6, 1, 4],
@@ -27,7 +27,7 @@
2727
"layout": {
2828
"annotations": [{
2929
"showarrow": false,
30-
"text": "branchvalues: <b>extra</b>",
30+
"text": "branchvalues: <b>remainder</b>",
3131
"x": 0.25,
3232
"xanchor": "center",
3333
"y": 1.1,

test/jasmine/tests/sunburst_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('Test sunburst defaults:', function() {
7575
{labels: [1], parents: ['']},
7676
]);
7777

78-
expect(fullData[0].branchvalues).toBe('extra', 'base');
78+
expect(fullData[0].branchvalues).toBe('remainder', 'base');
7979
expect(fullData[1].branchvalues).toBe(undefined, 'no values');
8080
});
8181

0 commit comments

Comments
 (0)