{
const context = DOM.context2d(
width,
height,
8
),
path = d3.geoPath(projection, context);
context.fillStyle = "#fff";
context.fillRect(0, 0, width, height);
context.fillStyle = "#eee";
context.beginPath();
path({ type: "Sphere" });
context.fill();
for (const f of countries.features) {
const { id } = f;
const polygons = f.closest || (f.closest = closest(f));
context.save();
context.lineWidth = 0.5;
context.strokeStyle = context.fillStyle = color(id);
context.beginPath();
path(f);
context.fill(), context.stroke();
context.clip();
context.globalAlpha = 0.3;
for (const p of polygons) {
context.fillStyle = color(p.properties.site.id);
context.beginPath();
path(p);
context.fill();
context.lineWidth = 0.25;
context.strokeStyle = "white";
context.stroke();
}
context.restore();
yield context.canvas;
}
context.strokeStyle = "white";
context.beginPath();
context.lineWidth = 0.75;
path(borders);
context.stroke();
context.beginPath();
path({ type: "Sphere" });
context.lineWidth = 1.25;
context.strokeStyle = "black";
context.stroke();
yield context.canvas;
}