Hi there,
Animations.jl is a package for creating (unsurprisingly) animations, useful when you’re making animated visualizations and want to quickly lay down a timeline of changing values together with easing functions. I added all the functionality I needed that eases the pain of doing this manually. Maybe once it’s fun to transform a sine function into an easing function yourself, but not every time. Also repetitions and delays are common but annoying to implement correctly so you don’t have problems at keyframe borders. Syntax example:
using Animations
anim = Animation(
0, 0,
sineio(n=3, yoyo=true),
2, 10,
linear(),
3, 20
)
anim_alternative_syntax = Animation(
[0, 2, 3], [0, 10, 20], [sineio(n=3, yoyo=true), linear()]
)
value = anim(t)
You can animate numbers, arrays, colors, or add your own methods for custom types based on linear interpolation. You can loop keyframed animations or put multiple together in sequences, as well as loop sequences or sequence loops etc. so I hope all bases are covered… Additionally, the values outside of an animation are the same as at the endpoints, which reduces the amount of keyframes you need to set in most cases. You can also “animate” between discrete things like strings if you use discrete step easing functions, like this:
labelanim = Animation([0, 0.25, 0.5, 0.75, 1], ["first", "second", "third", "fourth", "fifth"], noease())
label = labelanim(t)
which in my opinion is better than writing chains of
label = if t < 0.25
"first"
elseif 0.25 <= t <= 0.5
"second"
elseif
elseif
elseif...
I hope other people will also find it useful and create beautiful and engaging animations to better convey their research.