map = {
const width = 800;
const height = 600;
const projection = d3.geoMercator()
.fitExtent([[20, 20], [width, height]], counties)
const path = d3.geoPath().projection(projection);
const svg = d3
.select(DOM.element('svg'))
.attr('width', width)
.attr('height', height)
.style("width", "100%")
.style("height", "auto")
svg
.selectAll("path")
.data(counties.features)
.enter()
.append("path")
.attr("d", path)
.style('stroke', 'white')
.attr('stroke', 'gray')
.text('test')
.style('fill', "steelblue")
svg.append('g').selectAll('path')
.data(precincts.features)
.enter().append('path')
.attr('d', path)
.style('fill', 'none')
.style('stroke', 'white')
.style("stroke-width", .5)
.on('touchmove mousemove', function(d) {
const name1 = d.properties.NAME;
const [x, y] = d3.mouse(this);
tooltip
.attr('transform', `translate(${x},${y})`)
.call(callout, `${name1}`);
})
.on('touchend mouseleave', () => tooltip.call(callout, null));
const zoom = d3.zoom()
.scaleExtent([1, 8])
.on('zoom', function() {
const { transform } = d3.event;
svg
.attr('transform', transform);
});
svg.call(zoom);
const tooltip = svg.append('g');
yield svg.node();
svg
.append('g')
.attr('style', "font-family: 'Lato';")
.attr(
'transform',
);
}