Black Lives Matter. Please consider donating to Black Girls Code today.

Stop animation graph object

I want to update my dcc.Graph figure element through call back. I am able to do this but when I turn on the animation and try to change the figure element all I can see is the superposition of updated and previous figure elements. (which makes it look crazy as the previous animation is never stopped). How can I stop animating previous figure element of the graph object and immediately fill it with new figure element ?