map = {
const width = 1200;
const height = 600;
const projection = d3
.geoAlbersUsa()
.translate([width / 2, height / 2])
.fitSize([width, height], json);
const path = d3.geoPath().projection(projection);
const svg = d3
.select(DOM.element('svg'))
.attr('width', width)
.attr('height', height);
for (let j = 0, jmax = json.features.length; j < jmax; j++) {
const jsonState = json.features[j].properties.name;
}
svg
.selectAll("path")
.data(json.features)
.enter()
.append("path")
.attr("d", path)
.style('stroke', 'white')
.attr('stroke', 'gray')
.text('test')
.style('fill', d => {
const value = d.properties.value;
return mapColor;
})
.on('touchmove mousemove', function(d) {
const name = d.properties.name;
const [x, y] = d3.mouse(this);
tooltip
.attr('transform', `translate(${x},${y})`)
.call(callout, `${name}`);
})
.on('touchend mouseleave', () => tooltip.call(callout, null));
const tooltip = svg.append('g');
yield svg.node();
svg
.append('g')
.attr('style', "font-family: 'Lato';")
.attr(
'transform',
);
}