map = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const g = svg.append("g");
g.append("g")
.append("rect")
.attr("width", width)
.attr("height", height)
.attr("fill", "#eef");
const projection = d3
.geoConicConformal()
.parallels([33, 44])
.rotate([-135, 0])
.scale(width)
.center([0, 35])
.translate([width / 2, height / 2])
.scale(2200);
const path = d3.geoPath(projection);
g.append("g")
.attr("fill", "#fff")
.append("path")
.attr(
"d",
path(topojson.merge(japan, japan.objects["N03-21_210101"].geometries))
);
g.append("g")
.attr("fill", "none")
.attr("stroke", "#000")
.attr("stroke-width", 0.5)
.selectAll("path")
.data(topojson.feature(japan, japan.objects["N03-21_210101"]).features)
.join("path")
.attr("d", path);
g.append("g")
.attr("fill", "none")
.attr("stroke", "#f00")
.attr("stroke-width", 0.5)
.selectAll("path")
.data(d3.range(1, 48))
.join("path")
.attr("d", (d) =>
path(
topojson.merge(
japan,
japan.objects["N03-21_210101"].geometries.filter(
(g) => Math.floor(+g.properties.N03_007 / 1000) === d
)
)
)
);
return svg.node();
}