choropleth = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("transform", "translate(140,20)")
.append(() =>
legend({
color: color,
title: data.title,
width: 750,
tickFormat: "0.1f"
})
);
svg.append("g")
.selectAll("path")
.data(counties.features)
.join("path")
.attr("stroke", "black")
.attr("stroke-linejoin", "bevel")
.attr("stroke-width", 0.2)
.attr("fill", d => color(data.get(+d.properties.FIPS)))
.attr("d", path)
.append("title")
.text(d => " Population Density: " + data.get(+d.properties.FIPS));
return svg.node();
}