benjeffery / react-plotlyjs

ReactJS / PlotlyJS integration. Draw plotly.js graphs in your react app.
MIT License
111 stars 29 forks source link

Can't update the data in my plot #1

Closed djkashtan closed 8 years ago

djkashtan commented 8 years ago

Hello,

I was able to get the polar scatter plot working, but I cannot figure out how to add new data to the plot without trouble. When I use setState it causes the plot to slap a new empty plot, not even the same type over top of the old plot. The old plot remains unchanged and underneath the new empty plot...

Let me know if you are able to update the plot's data and if so, could you post the code for doing it correctly? I could really use a polar scatter plot in my project :)

benjeffery commented 8 years ago

Hi, Not sure what you mean by "use setState" you should be able to change the props passed in to the "Plotly" element and the plot will update.

djkashtan commented 8 years ago

After more poking around in the code it looks like my issue has nothing to do with react-plotlyjs. It may be a plotly.js issue or just the way that I use plotly.js in react.