As you may remember, a few weeks ago we had an article describing how most people using ProtonDB have moved away from using Ubuntu in the past few years (based on ProtonDB reports), mostly in favor of Arch-based distros (Arch and Manjaro taking the lead). Hence the fall of Ubuntu. The article did very well, audience-wise, but I must admit that the graph takes a few minutes to understand properly. So for the past week or so, I have been working to produce an animation instead, that would hopefully make it more tangible and also more fun to watch.
The underlying data is the same. But making an animation is a lot more involved. First, let me share with you the end result:
(You can also check it out on Peertube)
So, how did I produce it?
Join us on Matrix to chat with us and our community!
The (not so) secret sauce is a mix of:
gganimate is a library that helps produce and compress animations (using ffmpeg or other executables) out of static images. The static images are first produced by ggplot2 (one of the key graphing libraries used with R), and you then decide how you calculate the transition between each “state” of your animation, with transition functions from gganimate. After that, it’s a matter of letting the machine run – a 60s video at 60 fps (ideal for smoothness) will require 3600 frames as you might expect, and it’s a 20-30 minutes job.
The final code is actually relatively short, but getting things to look right took numerous iterations (maybe 50?). I found one stackoverflow post really helpful to get me on the right track – anyone trying to reproduce this may find it a good pointer as well. When prototyping you can start with shorter videos (20s, 20 fps) so that you can shorten the wait time between each iteration.
If there’s enough interest in seeing the actual (R) code, I can make it public relatively quickly. Let me know in the comments if you want it!
You might want to check out the following articles too!
BoilingSteam lets you access our content for free, but writing articles is a constant investment. We don't use ads or sponsporship, help us make our activities sustainable by donating via Patreon or LiberaPay if you prefer it anonymous. You can follow what we do via our newsletter, our RSS feed, our Mastodon profile or our Twitter feed. We also have Peertube, Youtube and LBRY channels. If you'd like to chat, you can also find us on #boilingsteam:matrix.org. (what is Matrix?)