chart = {
const svg = d3.create('svg')
.attr('viewBox', [-width/2, -height/2, width, height]);
const types = [
{type: 'left', pie: pieLeft, radius: 100, color: 'gold'},
{type: 'right', pie: pieRight, radius: 50, color: 'orange'}
];
types.forEach(({type, pie, radius, color}) => {
svg.selectAll('.circle-' + type)
.data(pie(d3.entries(data)))
.join('path')
.attr('class', 'circle-' + type)
.attr('d', d3.arc()
.outerRadius(radius)
.innerRadius(0))
.attr('fill', color);
});
return svg.node();
}