j = {
f();
const line = d3
.line()
.x(([x, y]) => x)
.y(([x, y]) => y)
.curve(d3.curveBasisOpen);
const li = d3.select("#lines").selectAll("path").data(data);
li.enter()
.append("path")
.attr("fill", "none")
.attr("stroke-width", "2")
.attr("stroke", (_, i) => colors[i])
.merge(li)
.attr("d", line)
.style("stroke-dasharray", function (d) {
return d3.select(this).node().getTotalLength();
})
.style("stroke-dashoffset", function (d) {
return d3.select(this).node().getTotalLength() / (step - 1);
})
.transition()
.ease(d3.easeLinear)
.duration(200)
.style("stroke-dashoffset", 0)
.style();
}