This is the simplest radial tree diagram I could create. Let me know if you think I can make it tighter.
Build notes:
d.size
when moving from json to csv. While size
is a feature of my data, I had to now access it from d.data.size
.)Radial Tree notes: The size
method in d3.cluster().size([2 * Math.PI, Math.min(vWidth, vHeight)/2 - 10]);
is both important and odd.
Math.min(vWidth, vHeight)/2 - 10]);
: We choose smaller of height and width, then we divide in half to find (and set) the diagram's radius. We pull out a bit extra to ensure we have margin (so that the circles don't get clipped). I chose to subtract 10 since my cirle radius is 10 (which really translates to 10 / 2 * 2 since I'm only in danger of cutting off 1/2 my circle, but it could happen on both sides).From https://bl.ocks.org/denjn5/4cc1a43f41efdc0ae6b7a1bf6a7d5e4e
https://d3js.org/d3.v4.min.js