@@ -149,6 +149,13 @@ class PlotlyGraph extends Component {
149
149
figure = props . _dashprivate_transformFigure ( figure , gd ) ;
150
150
config = props . _dashprivate_transformConfig ( config , gd ) ;
151
151
152
+ const figureClone = {
153
+ data : figure . data ,
154
+ layout : this . getLayout ( figure . layout , responsive ) ,
155
+ frames : figure . frames ,
156
+ config : this . getConfig ( config , responsive ) ,
157
+ } ;
158
+
152
159
if (
153
160
animate &&
154
161
this . _hasPlotted &&
@@ -159,22 +166,16 @@ class PlotlyGraph extends Component {
159
166
if ( figure . frames ) {
160
167
return Plotly . deleteFrames ( gd )
161
168
. then ( ( ) => Plotly . addFrames ( gd , figure . frames ) )
162
- . then ( ( ) => Plotly . animate ( gd , figure , animation_options ) ) ;
169
+ . then ( ( ) =>
170
+ Plotly . animate ( gd , figureClone , animation_options )
171
+ ) ;
163
172
}
164
- return Plotly . animate ( gd , figure , animation_options ) ;
173
+ return Plotly . animate ( gd , figureClone , animation_options ) ;
165
174
}
166
175
167
- const configClone = this . getConfig ( config , responsive ) ;
168
- const layoutClone = this . getLayout ( figure . layout , responsive ) ;
169
-
170
176
gd . classList . add ( 'dash-graph--pending' ) ;
171
177
172
- return Plotly . react ( gd , {
173
- data : figure . data ,
174
- layout : layoutClone ,
175
- frames : figure . frames ,
176
- config : configClone ,
177
- } ) . then ( ( ) => {
178
+ return Plotly . react ( gd , figureClone ) . then ( ( ) => {
178
179
const gd = this . gd . current ;
179
180
180
181
// double-check gd hasn't been unmounted
0 commit comments