Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/traces/sunburst/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module.exports = {
'this option won\'t have any effect and `insidetextfont` would be used.'
].join(' ')
}),
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
2 changes: 2 additions & 0 deletions src/traces/sunburst/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

coerce('insidetextorientation');

coerce('sort');

handleDomainDefaults(traceOut, layout, coerce);

// do not support transforms for now
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