chart = {
const root = partition(data);
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", height);
const g = svg
.append("g")
.attr("transform", `translate(${width / 2}, ${height / 2 - innerRadius})`);
g.selectAll("path")
.data(
root.descendants().filter(d => {
return d.depth && d.x1 - d.x0 > 0.002;
})
)
.join("path")
.attr("d", arc)
.attr("stroke", "#fff")
.attr("fill", d => color(d.data.name));
return svg.node();
}