Skip to content

Commit

Permalink
Merge branch 'master' into sunburstRotation
Browse files Browse the repository at this point in the history
  • Loading branch information
thierryVergult committed Sep 28, 2020
2 parents bac32bf + 8c38995 commit a8db79a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"strongly-connected-components": "^1.0.1",
"superscript-text": "^1.0.0",
"svg-path-sdf": "^1.1.3",
"tinycolor2": "^1.4.1",
"tinycolor2": "^1.4.2",
"to-px": "1.0.1",
"topojson-client": "^3.1.0",
"webgl-context": "^2.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/traces/sunburst/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ module.exports = {
].join(' ')
}),
rotation: pieAttrs.rotation,
sort: pieAttrs.sort,

domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
};
4 changes: 3 additions & 1 deletion src/traces/sunburst/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ exports.calc = function(gd, trace) {
if(failed) return;

// TODO add way to sort by height also?
hierarchy.sort(function(a, b) { return b.value - a.value; });
if(trace.sort) {
hierarchy.sort(function(a, b) { return b.value - a.value; });
}

var pullColor;
var scaleColor;
Expand Down
3 changes: 3 additions & 0 deletions src/traces/sunburst/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

coerce('insidetextorientation');

coerce('sort');

coerce('rotation');


handleDomainDefaults(traceOut, layout, coerce);

Expand Down
1 change: 1 addition & 0 deletions src/traces/treemap/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ module.exports = {
'Sets the positions of the `text` elements.'
].join(' ')
},
sort: pieAttrs.sort,

domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}),
};
2 changes: 2 additions & 0 deletions src/traces/treemap/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('pathbar.edgeshape');
}

coerce('sort');

handleDomainDefaults(traceOut, layout, coerce);

// do not support transforms for now
Expand Down

0 comments on commit a8db79a

Please sign in to comment.