I have a list of values such as:
[10, 20, 20, 30, 10, 10, 10, 20, 20, ...]
That can change before the animation starts.
The goal is to take an SVG circle and do the following:
- Index i = 0
- Smooth set radius to list[i] over X seconds
- Increase i
- Smooth set radius to list[i] over X seconds
- Increase i
- ...
I currently use Animate.timing
and onComplete
I start a new one but it seems like an inefficient way (and perhaps it can add some delays) to setup a pre-planned animation. Is there a way to tell the SVG object to change shape at given timings and given durations?
I am imagining to be able to tell the circle to:
[{from_radius: 10, to_radius: 20, duration: 0.25}, {from_radius: 20, to_radius: 20, duration: 0.25}, {from_radius: 20, to_radius: 30, duration: 0.25}, ...]
And give that to the circle to handle it automatically.