map = {
const context = DOM.context2d(width, height),
path = d3.geoPath(projection).context(context);
context.save();
context.beginPath();
path({ type: "Sphere" });
context.clip();
for (let x = 0; x < width; x += 5) {
for (let y = 0; y < height; y += 5) {
const p = projection.invert([x - 0.5, y - 0.5]);
context.fillStyle = color(kriging.predict(...p, variogram));
context.fillRect(x, y, 10, 10);
}
}
context.restore();
context.beginPath();
path(land);
context.stroke();
context.beginPath();
path.pointRadius(1.5);
context.fillStyle = "white";
path({ type: "MultiPoint", coordinates: d3.zip(data.x, data.y) });
context.fill();
context.beginPath();
path({ type: "Sphere" });
context.stroke();
return context.canvas;
}