svg - Recursive/recurring animation events in D3 -
i'm trying make recurring transitions in d3 keep repeating indefinitely. specifically, i'm working map , want background stars flicker. problem transitions appears they're run ahead of time, try infinite recursion ahead of time , page never load. found related example (recursive d3 animation issue) isn't infinite. other idea somehow use d3 timer, i'm not entirely sure how go either. tips appreciated.
right, can’t schedule infinite number of transitions ahead of time. :) however, can repeatedly schedule new transition when old transition ends (or starts), using transition.each listen end (or start) events.
take @ chained transitions example infinitely-repeating animation. whenever circle transition starts, schedules identical following transition, allowing transition repeat indefinitely.
alternatively, use setinterval or settimeout create transitions repeatedly, in concurrent transitions example. unlike chained transitions example linked, approach won’t guarantee exact synchronization of chained transitions, if want occasional background flicker, might simpler approach.
Comments
Post a Comment