chart = {
const svg = d3.select(DOM.svg(width, height))
.style("width", width)
.style("height", height)
.style('background-color', '#eee')
.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("fill", d => (d.data.name === 'Drugs' ? '#ff8900' : '#888'));
leaf.append("text")
.selectAll('tspan')
.data(d => [d.data.name, formatPerc(d.data.perc)])
.join('tspan')
.attr('x', 0)
.attr('y', (d, i, nodes) => `${i * 1.3 - (nodes.length / 2) + 1}em`)
.attr('font-weight', (d, i) => (i == 0 ? 'bold' : 'normal'))
.attr('font-size', (d, i) => (i == 0 ? 16 : 14))
.text(d => d);
leaf.append("title")
.text(d => d.name);
return svg.node();
}