@@ -98,15 +98,18 @@ class PlotlyGraph extends Component {
98
98
) {
99
99
return Plotly . animate ( id , figure , animation_options ) ;
100
100
}
101
- return Plotly . react ( id , figure . data , clone ( figure . layout ) , config ) . then (
102
- ( ) => {
103
- if ( ! this . _hasPlotted ) {
104
- this . bindEvents ( ) ;
105
- Plotly . Plots . resize ( document . getElementById ( id ) ) ;
106
- this . _hasPlotted = true ;
107
- }
101
+ return Plotly . react ( id , {
102
+ data : figure . data ,
103
+ layout : clone ( figure . layout ) ,
104
+ frames : figure . frames ,
105
+ config : config ,
106
+ } ) . then ( ( ) => {
107
+ if ( ! this . _hasPlotted ) {
108
+ this . bindEvents ( ) ;
109
+ Plotly . Plots . resize ( document . getElementById ( id ) ) ;
110
+ this . _hasPlotted = true ;
108
111
}
109
- ) ;
112
+ } ) ;
110
113
}
111
114
112
115
extend ( props ) {
@@ -322,12 +325,12 @@ const graphPropTypes = {
322
325
* Plotly `figure` object. See schema:
323
326
* https://plot.ly/javascript/reference
324
327
* Only supports `data` array and `layout` object.
325
- * `config` is set separately by the `config` property,
326
- * and `frames` is not supported.
328
+ * `config` is set separately by the `config` property
327
329
*/
328
330
figure : PropTypes . exact ( {
329
331
data : PropTypes . arrayOf ( PropTypes . object ) ,
330
332
layout : PropTypes . object ,
333
+ frames : PropTypes . arrayOf ( PropTypes . object ) ,
331
334
} ) ,
332
335
333
336
/**
@@ -622,7 +625,7 @@ const graphDefaultProps = {
622
625
relayoutData : null ,
623
626
extendData : null ,
624
627
restyleData : null ,
625
- figure : { data : [ ] , layout : { } } ,
628
+ figure : { data : [ ] , layout : { } , frames : [ ] } ,
626
629
animate : false ,
627
630
animation_options : {
628
631
frame : {
0 commit comments