JSFiddle - React, Tailwind, and code Playground
JavaScript
var svg = d3.select("body")
.append("svg")
.attr("width", 500)
.attr("height", 500);
// code, code, code, irrelevant code...
function timeForTimeline() { // har
var timeline = svg.append("line")
.attr("stroke", "steelblue");
repeat();
function repeat() {
timeline
.attr('x1', 0)
.attr('y1', 130)
.attr('x2', 168)
.attr('y2', 130)
.transition()
.duration(4000)
.ease(d3.easeLinear)
.attr('x1', 0)
.attr('y1', 430)
.attr('x2', 168)
.attr('y2', 430)
.on("end", repeat);
}
}
timeForTimeline();