diff --git a/docs/report/006.ipynb b/docs/report/006.ipynb index 405027fb..f68a60ca 100644 --- a/docs/report/006.ipynb +++ b/docs/report/006.ipynb @@ -475,7 +475,8 @@ "Making 3D Plotly plots interactive with {mod}`ipywidgets` is quite similar to the previous examples with {mod}`matplotlib`. Two recommendations are:\n", "\n", "1. Set `continuous_update=False`, because {mod}`plotly` is slower than {mod}`matplotlib` in updating the figure.\n", - "2. Save the camera orientation and update it after calling `Figure.show()`." + "2. Save the camera orientation and update it after calling `Figure.show()`.\n", + "3. When embedding the notebook a static webpage with [MyST-NB](https://myst-nb.readthedocs.io), avoid calling `Figure.show()` through [`ipywidgets.interactive_output()`](https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html), because it causes the notebook to hang in some cycle (see CI for [ComPWA/compwa-org@d9240f1](https://github.com/ComPWA/compwa-org/pull/208/commits/d9240f1)). In the example below, the `update_plotly()` function is aborted if the notebook is run through Sphinx. " ] }, { @@ -515,9 +516,14 @@ " name=\"Surface\",\n", ")\n", "plotly_fig = go.Figure(data=[plotly_surface])\n", + "plotly_fig.update_layout(height=500)\n", + "if STATIC_WEB_PAGE:\n", + " plotly_fig.show()\n", "\n", "\n", "def update_plotly(a, b):\n", + " if STATIC_WEB_PAGE:\n", + " return\n", " Z = numpy_function(X, Y, a, b)\n", " camera_orientation = plotly_fig.layout.scene.camera\n", " plotly_fig.update_traces(\n",