chart = {
const data = d3.cross(d3.ticks(-1, 1, 20), d3.ticks(-1, 1, 20));
const radius = 12;
const circle = d3.geoCircle()();
const projection = d3.geoOrthographic().translate([0, 0]).scale(radius);
const path = d3.geoPath(projection);
return Plot.plot({
aspectRatio: 1,
width: 640,
inset: 40,
axis: null,
length: {type: "identity"},
marks: [
Plot.dot(data, {r: radius, fill: "white", stroke: "currentColor"}),
Plot.vector(data, {
length: ([x, y]) => ((Math.hypot(x, y) + Math.atan2(y, x) / (Math.PI * 2) - (now / 3000)) % 1) * -360,
shape: {draw: (context, l) => (projection.rotate([0, l, -l]), path.context(context)(circle))},
anchor: "start",
fill: "currentColor"
})
]
});
}