{
const svg = d3.select(DOM.svg(visWidth + margin.left + margin.right,
visHeight + margin.top + margin.bottom));
const g = svg.append('g')
.attr('transform', `translate(${margin.left}, ${margin.top})`);
g.selectAll('path')
.data(states)
.join('path')
.attr('d', path)
.attr('fill', '#d3d3d3')
.attr('stroke', 'white');
const groups = g.selectAll('g')
.data(states)
.join('g')
.attr('transform', state => `translate(${path.centroid(state)})`);
groups.selectAll('path')
.data(state => pie(dataset[state.properties.NAME]))
.join('path')
.attr('d', arc)
.attr('fill', slice => color(slice.data.age))
return svg.node();
}