choropleth = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("transform", "translate(360,20)")
.append(() =>
legend({
color: color,
title: data.title,
width: 260,
tickFormat: ".3f"
})
);
svg.append("g")
.selectAll("path")
.data(counties.features)
.join("path")
.attr("stroke", "black")
.attr("stroke-linejoin", "round")
.attr("stroke-width", 0.5)
.attr("fill", function(d){
if(data.get(d.properties.FIPS))
return color(data.get(d.properties.FIPS)[0]);
else
return "black";
})
.attr("d", path)
.append("title")
.text(d => " Percent of OWI's: " + data.get(d.properties.FIPS));
return svg.node();
}