From ac6a060d581e0512ad623ae2e1a38c38868be40b Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Fri, 7 Feb 2025 15:54:48 +0100 Subject: [PATCH] improve update of `ui.plotly` --- nicegui/elements/plotly.py | 1 + nicegui/elements/plotly.vue | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/nicegui/elements/plotly.py b/nicegui/elements/plotly.py index b4e86098c..3e539049d 100644 --- a/nicegui/elements/plotly.py +++ b/nicegui/elements/plotly.py @@ -46,6 +46,7 @@ def update_figure(self, figure: Union[Dict, go.Figure]): def update(self) -> None: self._props['options'] = self._get_figure_json() super().update() + self.run_method('update') def _get_figure_json(self) -> Dict: if isinstance(self.figure, go.Figure): diff --git a/nicegui/elements/plotly.vue b/nicegui/elements/plotly.vue index 5d952bb83..a1ac94a87 100644 --- a/nicegui/elements/plotly.vue +++ b/nicegui/elements/plotly.vue @@ -8,9 +8,6 @@ export default { await import("plotly"); this.update(); }, - updated() { - this.update(); - }, methods: { update() { // wait for plotly to be loaded