delay_render = () => {
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", height);
svg
.append("rect")
.attr("width", width)
.attr("height", height)
.attr("fill", "white")
.attr("stroke", "none");
const circles = svg
.selectAll("circle")
.data(circle_data)
.join("circle")
.attr("cx", d => d.x)
.attr("cy", d => d.y)
.style("opacity", .2);
return t => {
const total_duration = 1500;
const circle_duration = 500;
const delay = 10;
circles.attr("r", (d, i) => {
const circle_delay = delay * i;
const time_elapsed = t * total_duration;
const eligible_time = time_elapsed - circle_delay;
const r = (d.r * eligible_time) / circle_duration;
return r > d.r ? d.r : r;
});
return svg.node();
};
}