Is it possible to pass on dynamic delay in d3.interval?
In this Notebook, I am asking d3.interval to run at 1000ms delay. But is there a way I can ask d3.interval to run at 0ms, 1000ms, 2000ms, 3000ms respectively for interval# 1,2,3,4.
I tried like desiredDelay[counterF] but it did not work.
I don’t think that d3.interval can accept a list like that. I’d simply iterate through the list of delays and yield the results after a delay. Perhaps, something like so:
{
let delays = [1000, 2000, 3000, 4000];
let cnt = 0;
for (let t of delays) {
await Promises.delay(t);
yield ++cnt;
}
}