{
const svg = d3.create('svg')
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom);
const g = svg.append('g')
.attr('transform', `translate(${margin.left}, ${margin.top})`);
g.append('g')
.attr('transform', `translate(0,${-margin.top})`)
.append(() => legend({color, title: 'title', tickFormat: '.2~s'}))
g.selectAll('path')
.data(precinct_json.features)
.join('path')
.attr('d', path)
.attr('fill', d => color(aggregatedDataByPrecinct.get(d.properties.precinct)))
.attr('stroke', 'white')
return svg.node();
}