diff --git a/examples/jupyter/pangeo_forge.ipynb b/examples/jupyter/pangeo_forge.ipynb index 7da50427..7a46ec2c 100644 --- a/examples/jupyter/pangeo_forge.ipynb +++ b/examples/jupyter/pangeo_forge.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "b0844d55", "metadata": {}, "outputs": [], @@ -33,8 +33,6 @@ "builder = DatasetBuilder()\n", "builder.import_config(config)\n", "\n", - "# TODO: awaiting viewer should not await auto render\n", - "\n", "# Show viewer in cell output\n", "await builder.viewer.ready\n", "builder.viewer.ui" diff --git a/pan3d/dataset_viewer.py b/pan3d/dataset_viewer.py index 7f3d404e..adebbf6f 100644 --- a/pan3d/dataset_viewer.py +++ b/pan3d/dataset_viewer.py @@ -59,6 +59,7 @@ def __init__( self.plot_view = None self.actor = None self.ctrl.get_plotter = lambda: self.plotter + self.ctrl.on_client_connected.add(self.on_ready) self.state.update(initial_state) self.state.ready() @@ -80,6 +81,10 @@ def __init__( def start(self, **kwargs): self.ui.server.start(**kwargs) + def on_ready(self, **kwargs): + self.state.render_auto = True + self._mesh_changed() + @property async def ready(self) -> None: await self.ui.ready @@ -235,7 +240,7 @@ async def plot_mesh(self) -> None: self.state.ui_loading = True self.state.ui_unapplied_changes = False - await asyncio.sleep(0) + await asyncio.sleep(1) with self.state: self.plotter.clear() diff --git a/pan3d/utils.py b/pan3d/utils.py index 57171e56..789ce582 100644 --- a/pan3d/utils.py +++ b/pan3d/utils.py @@ -49,7 +49,7 @@ def has_gpu_rendering(): "ui_action_message": None, "ui_action_config_file": None, "ui_current_time_string": "", - "render_auto": True, + "render_auto": False, "render_x_scale": 1, "render_y_scale": 1, "render_z_scale": 1,