choropleth = {
const width = 600;
const height = 400;
const svg = d3.create('svg')
.attr('width', width)
.attr('height', height);
const projection = d3.geoAlbersUsa()
.fitSize([width, height], usaGeo);
const path = d3.geoPath().projection(projection);
const states = svg.selectAll('path')
.data(usaGeo.features.filter(d => d.properties.NAME !== 'Puerto Rico'))
.join('path')
.attr('d', path)
.attr('stroke', 'white');
function update(date) {
states.attr('fill', d => color(stateToDateToRate.get(d.properties.NAME).get(date)));
}
svg.node().update = update;
return svg.node();
}