sunset = {
replay;
const svg = d3.create("svg").attr("width", width).attr("height", height);
svg
.append("rect")
.attr("stroke", "none")
.attr("fill", backgroundColor)
.attr("x", "0")
.attr("y", "0")
.attr("width", width)
.attr("height", height);
svg
.selectAll("circle")
.data(circles)
.join("circle")
.attr("stroke", "black")
.attr("stroke-width", lineWidth)
.attr("cy", -100)
.attr("cx", (d) => d.x * width)
.attr("r", (d) => d.r)
.transition()
.duration(nLines * 300 + 1000)
.attr("cy", (d) => d.y * height)
.attr("fill", circleColor);
svg
.append("g")
.selectAll("path")
.data(lines)
.join("path")
.attr("stroke", "black")
.attr("stroke-width", lineWidth)
.attr("d", startArea)
.transition()
.duration(800)
.delay((d, i) => (nLines - i) * 200)
.attr("fill", (_, i) =>
d3.interpolateInferno(0.9 * ((i + 1) / (lines.length + 1)))
)
.attr("d", area);
return svg.node();
}