chart = {
const root = packAlgorithm(data);
const svg = d3.create("svg")
.attr("width", width)
.attr("height", height)
.attr("font-size", 10)
.attr("font-family", "sans-serif")
.attr("text-anchor", "middle");
const leaf = svg.selectAll("g")
.data(root.leaves())
.join("g")
.attr("transform", d => `translate(${d.x + 1},${d.y + 1})`);
leaf.append("circle")
.attr("id", d => (d.leafUid = DOM.uid("leaf")).id)
.attr("r", d => d.r)
.attr("stroke", d => 'lightgrey')
.attr("fill", d => colorScale(d.value));
leaf.append("text")
.attr("x", 0)
.attr("y", 4)
.text(d => Math.round(d.value));
return svg.node();
}