{
const width = 928;
const height = 1200;
const svg = d3.create("svg")
.attr("width", width)
.attr("height", height)
.attr("viewBox", [0, 0, width, height])
.attr("style", "max-width: 100%; height: auto;");
const land = topojson.feature(nj, {
type: "GeometryCollection",
geometries: nj.objects.tracts.geometries.filter((d) => (d.id / 10000 | 0) % 100 !== 99)
});
const path = d3.geoPath()
.projection(d3.geoTransverseMercator()
.rotate([74 + 30 / 60, -38 - 50 / 60])
.fitExtent([[20, 20], [width - 20, height - 20]], land));
svg.selectAll("path")
.data(land.features)
.enter().append("path")
.attr("class", "tract")
.attr("d", path)
.append("title")
.text(function(d) { return d.id; });
svg.append("path")
.datum(topojson.mesh(nj, nj.objects.tracts, function(a, b) { return a !== b; }))
.attr("class", "tract-border")
.attr("d", path);
svg.append("style").text(`
.tract {fill: #eee;}
.tract:hover {fill: orange;}
.tract-border {
fill: none;
stroke: #777;
pointer-events: none;
}
`);
return svg.node();
}