benjeffery / react-plotlyjs

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

Update graph on config prop changes #7

Closed otisg closed 7 years ago

otisg commented 8 years ago

To address this from the README: "Changes to the 'config' prop will not update the graph currently."

EJBroeders commented 7 years ago

This bug is because of the if-statement on line 43. The fix is fairly straightforward, just delete the if-statement and create a new plot unconditionally.

Is there something against removing the if-statement? I Think that the componentDidUpdate-method only triggers if there is reason to create a new plot.

EJBroeders commented 7 years ago

poke

Is this project still maintained?

benjeffery commented 7 years ago

Yes! Sorry for not getting to this. Just on mobile now but will attempt to get to this today.

benjeffery commented 7 years ago

This was a hangover from when update tried to use redraw instead of newPlot. Should be fixed in 0.4.1, I kept the if, but added config to it and the newPlot

benjeffery commented 7 years ago

Reopen if you're not happy!