Skip to content

Commit a66b42d

Browse files
treemap sort
- obey npm lint - add sort option to treemap (define attribute & coerce in default Treepad is using the calc from sunburst, so the 1 line code change for sunburst impacted treemap (sort was not true)
1 parent cf66d2e commit a66b42d

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/traces/sunburst/calc.js

+1-1
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 (trace.sort) {
195+
if(trace.sort) {
196196
hierarchy.sort(function(a, b) { return b.value - a.value; });
197197
}
198198

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)