{
const svg = d3.create("svg")
.attr("width", width)
.attr("height", 400)
.attr("viewBox", `0 -20 ${width} 70`);
while (true) {
const t = svg.transition()
.duration(750);
svg.selectAll("text")
.data(randomLetters(), d => d)
.join(
enter => enter.append("text")
.attr("fill", "red")
.attr("x", (d, i) => Math.sign(Math.floor(i * 100 / 360)) * 400 + width / 3)
.attr("y", (d, i) => Math.cos(Math.floor(i * 100 / 360)) * 400)
.text(d => d)
.call(enter => enter.transition(t)
.attr("x", (d, i) => i * 20 + width / 3)
.attr("y", 0)),
update => update
.attr("fill", "black")
.attr("y", 0)
.call(update => update.transition(t)
.attr("x", (d, i) => i * 20 + width / 3)),
exit => exit
.attr("fill", "brown")
.call(exit => exit.transition(t)
.attr("x", (d, i) => Math.sign(Math.floor(i * 100 / 360)) * 400 + width / 2)
.attr("y", (d, i) => Math.cos(Math.floor(i * 100 / 360)) * 400)
.remove())
);
yield svg.node();
await Promises.tick(1000);
}
}