function draw(transform) {
const map = d3.select('svg');
if (transform.k === 1 && transform.x === 0 && transform.y === 0) {
map.select('g.layer-comm')
.attr('stroke', '#fff')
.attr('stroke-width', communePathWidth)
.selectAll('path')
.data(data.communes)
.join('path')
.attr('d', path)
.attr('fill', d => d.properties.color);
map.select('g.layer-dep')
.attr('stroke', colorDep)
.attr('stroke-width', depPathWidth)
.selectAll('path')
.data(data.dep_borders)
.join('path')
.attr('d', path)
.attr('fill', 'transparent');
} else {
d3.selectAll('g.layer-comm > path')
.attr('stroke-width', communePathWidth / transform.k)
.attr('fill', d => d.properties.color)
.attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')')
d3.selectAll('g.layer-dep > path')
.attr('stroke-width', depPathWidth / transform.k)
.attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')')
}
}