Plotly.react has the same signature as Plotly.newPlot above, and can be used in its place to create a plot, but when called again on the same04-06-2019will update it far more efficiently than Plotly.newPlot, which would destroy and recreate the plot. Plotly.react is as fast as Plotly.restyle/Plotly.relayout documented below.
Adding a uirevision attribute and then keeping it the same during the next call to Plotly.react ensures that user interactions persist.10-06-2019