Animations in Dash

animate=True only works in a couple of contexts right now:
1 - Graphs that aren’t adding or removing traces
2 - Scatter or line plots
3 - SVG plots, not their webgl equivalents (e.g. scatter not scattergl)

(1) is relatively easy to fix inside dcc.Graph. .animate method that can handle any type of figure diff · Issue #1849 · plotly/plotly.js · GitHub is the ultimate solution but before that gets merged we can just patch dcc.Graph inside here: dash-core-components/src/components/Graph.react.js at master · plotly/dash-core-components · GitHub with a few checks to see if the user is adding or removing traces and, if so, call newPlot instead of animate. This would be a great first community PR.

(2) and (3) require deeper changes to plotly.js, there might be issues created for them already in Issues · plotly/plotly.js · GitHub

If your organization or company has a budget for software, these fixes and features can always be prioritized and sponsored directly, Consulting, Training & Open-Source Development

1 Like