How to animate the plot updates?

I don’t mean to animate via data updates from a server or with javascript timeout events. I mean to add CSS like animations so the plots change smoothly when updating with new data. Similar to what d3.js is doing here:

The idea is this to be a global setting, like with CSS animations, that it’s applied to all plot elements whenever they change.

Based on my googling, CSS cannot be applied to canvas elements, so is there a way to do this in the manner I want or the only solution is to update it myself with a timer, either server-side or client-side?

Thanks!

1 Like

As you note, CSS has no effect on the HTML canvas, so the only way to accomplish this is to explicitly update the data in a timer, as you have suggested. There are various ways that could be done, the Gapminder Example shows one.