function preview(poly) {
return Plot.plot({
projection: {
type: "orthographic",
rotate: [-20, -20],
inset: 1
},
marks: [
Plot.geo(poly, {fill: "red", fillOpacity: 0.5}),
Plot.graticule({strokeOpacity: 0.3}),
Plot.line(poly.coordinates[0], {marker: "arrow"}),
Plot.sphere({strokeWidth: 2})
]
});
}