function map(width, height) {
projection.fitSize([width - margin * 2, height - margin * 2], data);
const svg = d3
.create('svg')
.attr('viewBox', [0, 0, width, height])
.attr('width', width)
.attr('height', height)
.style('border', '1px dotted rgba(0, 0, 0, 50%)')
.style('box-sizing', 'border-box');
const g = svg
.append('g')
.attr('transform', `translate(${margin},${margin})`);
g.selectAll('path')
.data(data.features ? data.features : [data])
.join('path')
.attr('fill', '#ccc')
.attr('stroke', '#eee')
.attr('d', path);
return svg.node();
}