Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the update mechanism for
ui.plotly
(#4317)
This PR tries to solve #4186 by calling the `update()` method in JavaScript explicitly rather than within the `updated` hook. It seems to resolve the problem described with the following code snippet: ```py ui.label('1. Manually zoom the plot') ui.button('2. Update the label', on_click=lambda: label.set_text(label.text + '.')) ui.button('3. Update the plot', on_click=lambda: plot.update()) ui.label('4. --> The plot resets unexpectedly') label = ui.label('...') plot = ui.plotly({'layout': {'uirevision': 'constant'}}) ``` Tests are passing and demos seem to work like before.
- Loading branch information