@@ -104,15 +104,18 @@ class PlotlyGraph extends Component {
104
104
) {
105
105
return Plotly . animate ( id , figure , animation_options ) ;
106
106
}
107
- return Plotly . react ( id , figure . data , clone ( figure . layout ) , config ) . then (
108
- ( ) => {
109
- if ( ! this . _hasPlotted ) {
110
- this . bindEvents ( ) ;
111
- Plotly . Plots . resize ( document . getElementById ( id ) ) ;
112
- this . _hasPlotted = true ;
113
- }
107
+ return Plotly . react ( id , {
108
+ data : figure . data ,
109
+ layout : clone ( figure . layout ) ,
110
+ frames : figure . frames ,
111
+ config : config ,
112
+ } ) . then ( ( ) => {
113
+ if ( ! this . _hasPlotted ) {
114
+ this . bindEvents ( ) ;
115
+ Plotly . Plots . resize ( document . getElementById ( id ) ) ;
116
+ this . _hasPlotted = true ;
114
117
}
115
- ) ;
118
+ } ) ;
116
119
}
117
120
118
121
extend ( props ) {
@@ -327,13 +330,13 @@ const graphPropTypes = {
327
330
/**
328
331
* Plotly `figure` object. See schema:
329
332
* https://plot.ly/javascript/reference
330
- * Only supports `data` array and `layout` object.
331
- * `config` is set separately by the `config` property,
332
- * and `frames` is not supported.
333
+ *
334
+ * `config` is set separately by the `config` property
333
335
*/
334
336
figure : PropTypes . exact ( {
335
337
data : PropTypes . arrayOf ( PropTypes . object ) ,
336
338
layout : PropTypes . object ,
339
+ frames : PropTypes . arrayOf ( PropTypes . object ) ,
337
340
} ) ,
338
341
339
342
/**
@@ -628,7 +631,7 @@ const graphDefaultProps = {
628
631
relayoutData : null ,
629
632
extendData : null ,
630
633
restyleData : null ,
631
- figure : { data : [ ] , layout : { } } ,
634
+ figure : { data : [ ] , layout : { } , frames : [ ] } ,
632
635
animate : false ,
633
636
animation_options : {
634
637
frame : {
0 commit comments