randomTree = ((l = 10) => {
let category = 0;
const root = {id: -1, children: [], category};
const nodes = [root];
for (let i = 0; i < l; i++) {
if (Math.random() < 0.25) {
category++;
}
const j = Math.floor(Math.random() * (i + 1));
const n = {children: [], id: i, category};
nodes[j].children.push(n);
nodes.push(n);
}
return d3.hierarchy(root);
})(12)