viewof svg = {
const svg = d3.select(DOM.svg(width, height))
.style("width", "100%")
.style("height", "auto")
.call(zoom)
svg.append("rect")
.attr("width", width)
.attr("height", height)
.attr("x", 0)
.attr("y", 0)
.attr("fill", "hsl(0, 0%, 96%)")
const g = svg.append("g")
.classed("map-layers", true)
g.selectAll("path")
.data(geojson.features)
.enter().append("path")
.attr("class", d => quantile(d.properties[category]))
.attr("d", path)
.append("title")
.text(d => `${format(d.properties[category])} / sq meter`)
g.append("path")
.datum(topojson.mesh(tractsTopoJSON, tractsTopoJSON.objects.tracts_jobs_2002_wgs84))
.attr("fill", "none")
.attr("stroke-width", 0.05)
.attr("stroke", "purple")
.attr("stroke-linejoin", "round")
.attr("d", path);
const legend = svg.append("g")
.classed("legend", true)
.attr("transform", `translate(20, ${height - 60})`)
legend.selectAll("rect")
.data(quantile.range())
.enter().append("rect")
.attr("height", 8)
.attr("width", x.bandwidth())
.attr("x", d => x(d))
.attr("class", d => d)
legend.append("g")
.attr("transform", "translate(0, 5)")
.call(d3.axisBottom(x))
legend.select(".domain").remove()
legend.selectAll(".tick > line").remove()
return svg.node()
}