Skip to content

Commit 0a531f8

Browse files
reuse pie.sort
reuse pie.sort in attributes, default true
1 parent 61c4a83 commit 0a531f8

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

src/traces/sunburst/attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ module.exports = {
203203
'this option won\'t have any effect and `insidetextfont` would be used.'
204204
].join(' ')
205205
}),
206+
sort: pieAttrs.sort,
206207

207208
domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
208209
};

src/traces/sunburst/calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ exports.calc = function(gd, trace) {
192192
if(failed) return;
193193

194194
// TODO add way to sort by height also?
195-
if ( fullLayout[ 'sort']) {
195+
if ( trace.sort) {
196196
hierarchy.sort(function(a, b) { return b.value - a.value; });
197197
}
198198

src/traces/sunburst/defaults.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7373

7474
coerce('insidetextorientation');
7575

76+
coerce('sort');
77+
7678
handleDomainDefaults(traceOut, layout, coerce);
7779

7880
// do not support transforms for now

src/traces/sunburst/layout_attributes.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,5 @@ module.exports = {
3535
'Colors provided in the trace, using `marker.colors`, are never',
3636
'extended.'
3737
].join(' ')
38-
},
39-
sort: {
40-
valType: 'boolean',
41-
dflt: true,
42-
role: 'style',
43-
editType: 'calc',
44-
description: [
45-
'sort on values.',
46-
'default true'
47-
].join(' ')
4838
}
4939
};

src/traces/sunburst/layout_defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
1717
}
1818
coerce('sunburstcolorway', layoutOut.colorway);
1919
coerce('extendsunburstcolors');
20-
coerce('sort');
2120
};

0 commit comments

Comments
 (0)