{
const svg = d3
.create('svg')
.attr('width', mapConfig.width)
.attr('height', mapConfig.height);
ts.forEach(t => svg.call(t));
const stage = svg.append('g');
const enterProvince = province =>
province
.append('path')
.attr('class', 'province')
.attr('data', d => d)
.attr('d', makePath)
.style('fill', () => {
const textureIndex = Math.round(Math.random() * (ts.length - 1));
return ts[textureIndex].url();
})
.attr('stroke', 'black');
stage
.selectAll('.province')
.data(geoJson.features)
.join(enterProvince);
return svg.node();
}