UNPKG

d3-hierarchy

Version:

Layout algorithms for visualizing hierarchical data.

8 lines (7 loc) 151 B
export default function(compare) { return this.eachBefore(function(node) { if (node.children) { node.children.sort(compare); } }); }