chart = {
const svg = d3.create("svg")
.attr("width", width)
.attr("height", height);
const states = svg.selectAll("path.states")
.data(geojson.features, d => d.properties.NAME)
.join("path")
.attr("class", "states")
.attr("d", d => pathGen(d))
.attr("fill", d => ["District of Columbia", "Puerto Rico"]
.includes(d.properties.NAME)
? "Black"
: colorScale(costData.filter(obj => obj.state === d.properties.NAME)[0].cost))
.attr("stroke", "black")
return svg.node();
}