chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, 900, 610]);
svg
.append("g")
.attr("transform", "translate(610,20)")
.append(() =>
legend({
color: prevScale,
title: 'Prev. of Obesity (%)',
width: 260
})
);
svg
.append("g")
.selectAll("path")
.data(topojson.feature(TJHD_ZCTAs, TJHD_ZCTAs.objects.TJHD_ZCTAs).features)
.join("path")
.attr(
"fill",
d => prevScale(prev_by_ZCTA.get(d.properties.ZCTA5CE10)) || "white"
)
.attr('stroke', '#404040')
.attr("d", path)
.append("title")
.text(
d =>
`${d.properties.ZCTA5CE10}: ${prev_by_ZCTA.get(
d.properties.ZCTA5CE10
) || '-'}\%`
);
return svg.node();
}