-
Notifications
You must be signed in to change notification settings - Fork 545
refactor: Move examples for notebook viewer and callbacks to examples/python
#11416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ntjohnson1
merged 6 commits into
rerun-io:main
from
Weijun-H:10711-move-notebook-example
Oct 6, 2025
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2b01719
refactor: Move examples for notebook viewer and callbacks to examples…
Weijun-H 5c60d73
chore
Weijun-H 42a8d85
chore: Use rerun.notebook
Weijun-H 9df19b1
chore: Clean up
Weijun-H cad446a
Add thumbnails
ntjohnson1 be205cd
Fix thumbnail dims
ntjohnson1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!--[metadata] | ||
title = "Notebook: viewer callbacks" | ||
tags = ["Notebook", "Interactive", "Callbacks", "3D"] | ||
thumbnail = "https://static.rerun.io/notebook_callbacks_placeholder/8b6d2c9a4b2c37a1baf7826dbf0fef1cb2f6b77d/480w.png" | ||
thumbnail_dimensions = [480, 480] | ||
channel = "main" | ||
--> | ||
|
||
## Overview | ||
|
||
This notebook demonstrates how to react to user interactions coming from the embedded Rerun Viewer widget. It logs a dynamic 3D point cloud, listens for timeline, time, and selection events, and surfaces them in real time using Jupyter widgets. | ||
|
||
You need the separate support package [`rerun-notebook`](https://pypi.org/project/rerun-notebook/) to use this feature. Typically this is installed using: | ||
|
||
```bash | ||
pip install "rerun-sdk[notebook]" | ||
``` | ||
|
||
Check out the [minimal notebook example](https://rerun.io/examples/integrations/notebook) for a quick start. | ||
|
||
## Background | ||
|
||
This notebook spins up a colorful point cloud and pipes it into the viewer so you can experiment with callbacks in real time. As the camera, timeline, and selection change, [`Viewer.on_event`](https://www.rerun.io/docs/reference/sdk/rerun_notebook#rerun.notebook.Viewer.on_event) emits rich event payloads that we translate into friendly [`ipywidgets`](https://ipywidgets.readthedocs.io/) readouts. | ||
|
||
Scrub the timeline, pick individual points, or activate entire views to see how each interaction updates the labels—handy for building responsive dashboards or debugging custom tooling around the Rerun Viewer. | ||
|
||
## Running in Jupyter | ||
|
||
First, install the requirements (this includes Jupyter, the Rerun SDK, and the notebook support package): | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Then, open the notebook: | ||
|
||
```bash | ||
jupyter notebook notebook_callbacks.ipynb | ||
``` | ||
|
||
Interact with the viewer by scrubbing the timeline and selecting points or views; the widgets underneath will update instantly to mirror the viewer state. |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rerun-sdk[notebook] | ||
ipywidgets | ||
numpy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!--[metadata] | ||
title = "Notebook: viewer" | ||
tags = ["Notebook", "Widget", "3D"] | ||
thumbnail = "https://static.rerun.io/notebook_viewer_placeholder/0e4e4540ff6f271da663886b5c2f3a1dbd7b3b2f/480w.png" | ||
ntjohnson1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
thumbnail_dimensions = [480, 360] | ||
channel = "main" | ||
ntjohnson1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--> | ||
|
||
## Overview | ||
|
||
This notebook shows the easiest way to embed the Rerun Viewer widget inside a Jupyter notebook. Instead of logging new data, it loads a pre-recorded `.rrd` file and renders the scene inline, making it perfect for demos, documentation, or quick inspections of existing captures. | ||
|
||
You need the separate support package [`rerun-notebook`](https://pypi.org/project/rerun-notebook/) to use this feature. Typically this is installed using: | ||
|
||
```bash | ||
pip install "rerun-sdk[notebook]" | ||
``` | ||
|
||
Check out the [minimal notebook example](https://rerun.io/examples/integrations/notebook) for a quick start. | ||
|
||
## Background | ||
|
||
In this notebook we are loading a pre-recorded `.rrd` file into the Rerun Viewer widget. The viewer streams the capture and allows you to interact with the 3D scene directly in your browser. You can orbit, zoom, and inspect the scene without needing to run any additional applications. | ||
|
||
## Running in Jupyter | ||
|
||
First, install the requirements (this includes Jupyter, the Rerun SDK, and the notebook support package): | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Then, open the notebook: | ||
|
||
```bash | ||
jupyter notebook notebook_viewer.ipynb | ||
``` | ||
|
||
When the notebook launches, the embedded viewer will stream the remote mesh capture so you can orbit, zoom, and inspect the scene directly inside the notebook. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"ename": "TypeError", | ||
ntjohnson1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"evalue": "Viewer.__init__() got an unexpected keyword argument 'panel_states'", | ||
"output_type": "error", | ||
"traceback": [ | ||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | ||
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", | ||
"Cell \u001b[0;32mIn[1], line 5\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01m__future__\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m annotations\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21;01mrerun\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mnotebook\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m Viewer\n\u001b[0;32m----> 5\u001b[0m \u001b[43mViewer\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[43m \u001b[49m\u001b[43mwidth\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mauto\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[43m \u001b[49m\u001b[43mheight\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mauto\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhttps://app.rerun.io/version/nightly/examples/raw_mesh.rrd\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 9\u001b[0m \u001b[43m \u001b[49m\u001b[43mpanel_states\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\n\u001b[1;32m 10\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mblueprint\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhidden\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mselection\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhidden\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 12\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtime\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcollapsed\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 13\u001b[0m \u001b[43m \u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[43m)\u001b[49m\n", | ||
"\u001b[0;31mTypeError\u001b[0m: Viewer.__init__() got an unexpected keyword argument 'panel_states'" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from __future__ import annotations\n", | ||
"\n", | ||
"from rerun.notebook import Viewer\n", | ||
"\n", | ||
"Viewer(\n", | ||
" width=\"auto\",\n", | ||
" height=\"auto\",\n", | ||
" url=\"https://app.rerun.io/version/nightly/examples/raw_mesh.rrd\",\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rerun-sdk[notebook] |
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.