Tracking the current frame in an animated plotly figure (example code included!)

Cross-posting an answer I got on Stackoverflow: Is there a way to extract the current frame from a plotly figure? - Stack Overflow

(Big thank you for the answer there!)

Basically, it looks like you can’t trigger a callback on an animation frame change, nor can you extract the current frame (as far as I can tell!). It seems like the only way to do this is with Dash and a slider, so I guess I’ll switch to trying to find the most efficient way to do that.

Hopefully this will be helpful if other people find it as well!