Skip to content

Commit a8db79a

Browse files
Merge branch 'master' into sunburstRotation
2 parents bac32bf + 8c38995 commit a8db79a

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"strongly-connected-components": "^1.0.1",
118118
"superscript-text": "^1.0.0",
119119
"svg-path-sdf": "^1.1.3",
120-
"tinycolor2": "^1.4.1",
120+
"tinycolor2": "^1.4.2",
121121
"to-px": "1.0.1",
122122
"topojson-client": "^3.1.0",
123123
"webgl-context": "^2.2.0",

src/traces/sunburst/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ module.exports = {
204204
].join(' ')
205205
}),
206206
rotation: pieAttrs.rotation,
207+
sort: pieAttrs.sort,
207208

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

src/traces/sunburst/calc.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ exports.calc = function(gd, trace) {
192192
if(failed) return;
193193

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

197199
var pullColor;
198200
var scaleColor;

src/traces/sunburst/defaults.js

+3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7373

7474
coerce('insidetextorientation');
7575

76+
coerce('sort');
77+
7678
coerce('rotation');
79+
7780

7881
handleDomainDefaults(traceOut, layout, coerce);
7982

src/traces/treemap/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ module.exports = {
268268
'Sets the positions of the `text` elements.'
269269
].join(' ')
270270
},
271+
sort: pieAttrs.sort,
271272

272273
domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}),
273274
};

src/traces/treemap/defaults.js

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
114114
coerce('pathbar.edgeshape');
115115
}
116116

117+
coerce('sort');
118+
117119
handleDomainDefaults(traceOut, layout, coerce);
118120

119121
// do not support transforms for now

0 commit comments

Comments
 (0)