Plotly js with reveal js, plots on next slide doesn't take the chart size automatically

I am using plotlyJs with reveal js. I provide the chart data from an api call. In the default landing page the graphs do appear properly, but when I slide to the next page the chart has size of 100px by 100px. If I zoom the page the chart appears. I was using plotly.newplot initially and tried using plotly.react and plotly.restyle. Thanks in advance for the support.