Add notebook integration getting-started example#39
Merged
Conversation
Adds a new self-contained Jupyter notebook tutorial under `jupyter_notebooks/getting_started/` that mirrors the "Using the integration" and "Layout Management" sections of https://docs.foxglove.dev/docs/notebook. The notebook is Colab-first: dependencies are installed via `%pip install "foxglove-sdk[notebook]"` in the first cell so it runs end-to-end in a fresh kernel with no external assets. Cells cover: - Creating a notebook buffer with `foxglove.init_notebook_buffer()` - Logging messages with explicit `log_time` and rendering them in the embedded Foxglove viewer - Logging richer 3D scene data via `SceneUpdateChannel` - Building a single-panel layout programmatically with the `foxglove.layouts` API - Composing `SplitContainer` and `TabContainer` to drive a 3D scene + plot side-by-side from real data Also extends `.utils/generate_readme.py` and the README template to support a new `colab_url` front-matter field so Colab links can be surfaced in the auto-generated root README, and regenerates README.md to include the new tutorial. Co-authored-by: Roman Shtylman <defunctzombie@users.noreply.github.com>
Match the data_platform tutorial's Colab badge style: link directly to the notebook in this repo via the https://colab.research.google.com/github/<org>/<repo>/blob/<branch>/<path> pattern instead of waiting on a separately-generated Colab share URL. Also wires the same URL into the README front-matter as colab_url so the auto-generated root README surfaces a 'Open in Colab' bullet for this tutorial. Co-authored-by: Roman Shtylman <defunctzombie@users.noreply.github.com>
The minimal /hello example was opening the embedded viewer with the default empty layout, leaving the user looking at no panels and no data even though the buffer was full of /hello messages. Pre-configure a single Raw Messages panel pointed at /hello so the viewer renders the buffered data immediately. This is also a nice teaser for the Layout Management section later in the notebook. Co-authored-by: Roman Shtylman <defunctzombie@users.noreply.github.com>
Same fix as the previous commit but for the SceneUpdate cube example: ship a Layout with a ThreeDeePanel subscribed to /scene (and a base grid layer) so the embedded viewer immediately renders the animated cube instead of opening on an empty default layout. Co-authored-by: Roman Shtylman <defunctzombie@users.noreply.github.com>
surbina
reviewed
May 2, 2026
| "id": "191d273b", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## Where to next\n", |
There was a problem hiding this comment.
Thoughts on adding a link to the Playground?
Contributor
Author
There was a problem hiding this comment.
🤔 For now I'll defer. We don't promote playground and its a very different experience than notebooks (no external libraries).
surbina
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new self-contained Jupyter notebook tutorial under
jupyter_notebooks/getting_started/that mirrors the Using the integration and Layout Management sections of the Foxglove notebook docs, so we have a runnable companion the docs and external posts can link to.The notebook is Colab-first: dependencies are installed via
%pip install "foxglove-sdk[notebook]"in the first cell, so it runs end-to-end in a fresh Colab kernel with no external assets.What's in the notebook
jupyter_notebooks/getting_started/GettingStarted.ipynb, 12 cells:%pip install -q "foxglove-sdk[notebook]"./hellocounter example mirroring the docs verbatim, including thelog_timewarning.SceneUpdateChannelcube example so the embedded viewer has something visually meaningful to render.Layout(content=MarkdownPanel(...), variables=...)example.TabContainer > SplitContainerlayout pairing aThreeDeePanel(/scene) with aPlotPanel(/hello.count) so the container API is shown driving real data.data_platformnotebook, and our Discord.Per discussion, this PR intentionally does not cover:
nb_buffer.clear()) subsectionviewer.refresh()) subsectionopaque_layoutworkflowEasy follow-ups if we want them later.
Other changes
jupyter_notebooks/getting_started/README.md— folder README with front-matter (title + short description +colab_url), a Colab badge, and local-run instructions. The Colab badge uses the samehttps://colab.research.google.com/github/<org>/<repo>/blob/<branch>/<path>pattern asdata_platform/README.md, pointing at this repo'smainbranch — so it works as soon as the PR merges, no separately-generated Colab share URL required..utils/generate_readme.py+.utils/README_template.md.j2— adds support for a newcolab_urlfront-matter field so Colab links can be surfaced as a 📓 bullet in the auto-generated root README. Backwards-compatible: existing tutorials that don't setcolab_urlare unaffected.README.md— regenerated to include the new tutorial and its Colab bullet.Testing
GettingStarted.ipynbend-to-end withjupyter nbconvert --executeagainstfoxglove-sdk[notebook]==0.22.x. Every cell runs without errors or stderr output.foxglove.layoutsclasses used (Layout,MarkdownPanel,MarkdownConfig,SplitContainer,SplitItem,TabContainer,TabItem,ThreeDeePanel,ThreeDeeConfig,PlotPanel,PlotConfig,PlotSeries,BaseRendererSceneUpdateTopicSettings,BaseRendererGridLayerSettings) exist in the installed SDK..utils/generate_readme.pyis idempotent after thecolab_urlchange.The embedded Foxglove widget is an Anywidget that loads the viewer in the browser, so it doesn't render meaningfully in headless
nbconvert— the validation here is that the Python in every cell completes cleanly. Real visual validation will happen when the Colab link is opened post-merge.Rendered notebook (HTML preview)
GettingStarted.ipynb rendered to HTML
To show artifacts inline, enable in settings.