oldchart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg.node().drawData = function(data) {
const root = pack(data);
const circles = svg
.selectAll('circle')
.data(root.descendants().filter(d => d.depth > 0));
circles.join(
enter =>
enter
.append('circle')
.attr('cx', d => d.x)
.attr('cy', d => d.y)
.attr('fill', d => color(d.data.group))
.attr('r', d => d.r),
update =>
update
.transition()
.duration(1000)
.delay(Math.random() * 50)
.attr('cx', d => d.x)
.attr('cy', d => d.y)
.attr('fill', d => color(d.data.group))
.attr('r', d => d.r)
);
};
return svg.node();
}