Skip to content

Commit

Permalink
only return label from the helper - set the label of dummy root to blank
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Sep 28, 2019
1 parent 422d5d3 commit df5e121
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/traces/sunburst/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ exports.calc = function(gd, trace) {
cd.unshift({
hasMultipleRoots: true,
id: dummyId,
pid: ''
pid: '',
label: ''
});
}

Expand Down
3 changes: 1 addition & 2 deletions src/traces/sunburst/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ exports.getPtId = function(pt) {
};

exports.getPtLabel = function(pt) {
var label = pt.data.data.label;
return label === undefined ? pt.data.data.pid : label;
return pt.data.data.label;
};

exports.getValue = function(d) {
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/sunburst_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('Test sunburst calc:', function() {

expect(extract('id')).toEqual(['dummy', 'A', 'B', 'b']);
expect(extract('pid')).toEqual(['', 'dummy', 'dummy', 'B']);
expect(extract('label')).toEqual([undefined, 'A', 'B', 'b']);
expect(extract('label')).toEqual(['', 'A', 'B', 'b']);
});

it('should compute hierarchy values', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/treemap_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ describe('Test treemap calc:', function() {

expect(extract('id')).toEqual(['dummy', 'A', 'B', 'b']);
expect(extract('pid')).toEqual(['', 'dummy', 'dummy', 'B']);
expect(extract('label')).toEqual([undefined, 'A', 'B', 'b']);
expect(extract('label')).toEqual(['', 'A', 'B', 'b']);
});

it('should compute hierarchy values', function() {
Expand Down

0 comments on commit df5e121

Please sign in to comment.