@@ -104,15 +104,18 @@ class PlotlyGraph extends Component {
104104 ) {
105105 return Plotly . animate ( id , figure , animation_options ) ;
106106 }
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 ;
114117 }
115- ) ;
118+ } ) ;
116119 }
117120
118121 extend ( props ) {
@@ -327,13 +330,13 @@ const graphPropTypes = {
327330 /**
328331 * Plotly `figure` object. See schema:
329332 * 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
333335 */
334336 figure : PropTypes . exact ( {
335337 data : PropTypes . arrayOf ( PropTypes . object ) ,
336338 layout : PropTypes . object ,
339+ frames : PropTypes . arrayOf ( PropTypes . object ) ,
337340 } ) ,
338341
339342 /**
@@ -628,7 +631,7 @@ const graphDefaultProps = {
628631 relayoutData : null ,
629632 extendData : null ,
630633 restyleData : null ,
631- figure : { data : [ ] , layout : { } } ,
634+ figure : { data : [ ] , layout : { } , frames : [ ] } ,
632635 animate : false ,
633636 animation_options : {
634637 frame : {
0 commit comments