Show HN: Tree of Reddit Sex Life

Show HN: Tree of Reddit Sex Life

value);
return button;
}
chart = {
const root = tree(data, showSubreddits);

let x0 = Infinity;
let x1 = -x0;
root.each(d = {
if (d.x x1) x1 = d.x;
if (d.x x0) x0 = d.x;
});

const svg = d3.select(DOM.svg(width, x1 – x0 + root.dx * 2))
. attr(“d”, d = `
M${d.target.y},${d.target.x}
C${d.source.y + root.dy / 2},${d.target.x}
${d.source.y + root.dy / 2},${d.source.x}
${d.source.y},${d.source.x}
`);

const node = g.append(“g”)
. text(d = return svg.node();
}
tree = (data, showSubreddits) = {

function remove_rs(node) {
node.children = node.children.filter((x) = x.name.slice(0, 2) !

Source: observablehq.com