File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
components/dash-core-components/src/fragments Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,6 @@ class PlotlyGraph extends Component {
146
146
const { animate, animation_options, responsive} = props ;
147
147
148
148
const gd = this . gd . current ;
149
-
150
149
figure = props . _dashprivate_transformFigure ( figure , gd ) ;
151
150
config = props . _dashprivate_transformConfig ( config , gd ) ;
152
151
@@ -155,7 +154,19 @@ class PlotlyGraph extends Component {
155
154
this . _hasPlotted &&
156
155
figure . data . length === gd . data . length
157
156
) {
158
- return Plotly . animate ( gd , figure , animation_options ) ;
157
+ // in case we've have figure frames,
158
+ // we need to recreate frames before animation
159
+ let result ;
160
+ if ( figure . frames ) {
161
+ result = Plotly . deleteFrames ( gd ) . then ( ( ) => {
162
+ return Plotly . addFrames ( gd , figure . frames ) . then ( ( ) => {
163
+ return Plotly . animate ( gd , figure , animation_options ) ;
164
+ } ) ;
165
+ } ) ;
166
+ } else {
167
+ result = Plotly . animate ( gd , figure , animation_options ) ;
168
+ }
169
+ return result ;
159
170
}
160
171
161
172
const configClone = this . getConfig ( config , responsive ) ;
You can’t perform that action at this time.
0 commit comments