mix = (projection, frame) =>
Plot.plot({
width: 0.49 * width,
height: 0.49 * width * (projection === "equal-earth" ? 0.5 : 1),
projection,
marks: [
Plot.voronoiMesh(points, {
clip: "sphere",
strokeOpacity: 1,
strokeWidth: 0.5,
stroke: "red"
}),
Plot.geo(d3.geoVoronoi().cellMesh(points), {
clip: "sphere",
strokeOpacity: 1,
strokeWidth: 0.5,
stroke: "blue"
}),
Plot.dot(points, { r: 1, fill: "black" }),
frame ? Plot.frame({ strokeWidth: 1.5 }) : Plot.sphere()
],
caption: htl.html`<span><span style="color: red">Planar</span> — <span style="color: blue">Spherical</span>`
})