diff --git a/bindings/pydeck/docs/contributing.rst b/bindings/pydeck/docs/contributing.rst index efeb80afd32..15796a34d14 100644 --- a/bindings/pydeck/docs/contributing.rst +++ b/bindings/pydeck/docs/contributing.rst @@ -36,7 +36,40 @@ enable pydeck to run on JupyterLab and Jupyter Notebook locally: make init make prepare-jupyter -At this point, verify that this new local copy of pydeck works by running ``make test``. +Verify that this new local copy of pydeck works by running ``make test``. + +Local development in Jupyter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To test local changes to Pydeck in a Jupyter notebook, set up a virtual environment as +described above, then start a local Jupyter notebook: + +.. code-block:: bash + + jupyter notebook + +.. CAUTION:: + Additional steps (TODO) required to include local changes to deck.gl in a local Pydeck build. + +Local development in Google Colab +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To test local changes to Pydeck in a Google Colab notebook, first start a Jupyter runtime with +additional flags to trust WebSocket connections from the Colab frontend: + +.. code-block:: bash + + jupyter notebook \ + --NotebookApp.allow_origin='https://colab.research.google.com' \ + --port=8888 \ + --NotebookApp.port_retries=0 + +After the notebook starts, copy the full (localhost) URL printed to the console. In a Google +Colab notebook, select *Connect to a local runtime* from the additional connection options +dropdown, and provide the local URL when prompted. After a reload, the Colab notebook will have +access to the local Jupyter runtime and its local Pydeck build. + +For more information, refer to Google Colab's `documentation for local runtimes `__. Submitting a PR ^^^^^^^^^^^^^^^ diff --git a/bindings/pydeck/pydeck/io/html.py b/bindings/pydeck/pydeck/io/html.py index 8157b5d394a..188a017f2fb 100644 --- a/bindings/pydeck/pydeck/io/html.py +++ b/bindings/pydeck/pydeck/io/html.py @@ -113,7 +113,7 @@ def iframe_with_srcdoc(html_str, width="100%", height=500): def render_for_colab(html_str, iframe_height): from IPython.display import HTML, Javascript # noqa - js_height_snippet = f"google.colab.output.setIframeHeight({iframe_height}, true, {{minHeight: {iframe_height}}})" + js_height_snippet = f"google.colab.output.setIframeHeight({iframe_height}, true, {{minHeight: {iframe_height}, maxHeight: {iframe_height}}})" display(Javascript(js_height_snippet)) # noqa display(HTML(html_str)) # noqa