I utilized the following code: root = d3.hierarchy(root); root.sum(d => d.size);
However, my JSON does not include the size value for children nodes. How can I create a proper D3 Zoomable sunburst visualization?
Here is the code snippet:
const width = window.innerWidth, height = window.innerHeight, maxRadius = (Math.min(width, height) / 2) - 5;
const formatNumber = d3.format(',d');
const x = d3.scaleLinear().range([0, 2 * Math.PI]).clamp(true);
const y = d3.scaleSqrt() .range([maxRadius*.1, maxRadius]);
const color = d3.scaleOrdinal(d3.schemeCategory20);
const partition = d3.partition();
... (code continues)
Thanks in advance!