proportionalsymbols = {
const svg = d3.create("svg")
.attr("viewBox", [70, 70, width, height]);
svg.append("path")
.datum(topojson.feature(BasePolygons, BasePolygons.objects.iowa_borderWGS84))
.attr("fill", "#f0f0f0")
.attr("stroke", "black")
.attr("d", path_basemap);
svg.append("path")
.datum(topojson.mesh(BasePolygons, BasePolygons.objects.iowa_borderWGS84, (a, b) => a !== b))
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("d", path_basemap);
const legend = svg.append("g")
.attr("fill", "black")
.attr("transform", "translate(950,600)")
.attr("text-anchor", "middle")
.style("font", "12px sans-serif")
.selectAll("g")
.data([1.4e7, d3.max([...data.values()])])
.join("g");
legend.append("circle")
.attr("fill", "none")
.attr("stroke", "black")
.attr("cy", d => -radius(d))
.attr("r", radius);
legend.append("text")
.attr("y", d => -3.2 * radius(d))
.attr("dy", "1.4cm")
.text(d3.format(".2s"));
svg.append("g")
.attr("fill", "#99d8c9")
.attr("fill-opacity", 0.5)
.attr("stroke", "#00441b")
.attr("stroke-width", 0.5)
.selectAll("circle")
.data(points.features
.map(d => (d.value = data.get(d.properties.NAME), d))
.sort((a, b) => b.value - a.value))
.join("circle")
.attr("transform", d => `translate(${path_points.centroid(d)})`)
.attr("r", d => radius(data.get(d.properties.NAME)))
.append("title")
.text(d => `${d.properties.NAME} : ${format(d.value)}`);
return svg.node();
}