Notebook
rerun.notebook
Helper functions for converting streams to inline html.
class Viewer
A viewer embeddable in a notebook.
This viewer is a wrapper around the rerun_notebook.Viewer widget.
def __init__(*, width=None, height=None, url=None, blueprint=None, recording=None, use_global_recording=None)
Create a new Rerun viewer widget for use in a notebook.
Any data logged to the recording after initialization will be sent directly to the viewer.
This widget can be displayed by returning it at the end of your cells execution, or immediately
by calling rerun.notebook.Viewer.display.
| PARAMETER | DESCRIPTION |
|---|---|
width
|
The width of the viewer in pixels, or "auto". When set to "auto", scales to 100% of the notebook cell's width. |
height
|
The height of the viewer in pixels, or "auto". When set to "auto", scales using a 16:9 aspect ratio with |
url
|
Optional URL passed to the viewer for displaying its contents.
TYPE:
|
recording
|
Specifies the
TYPE:
|
blueprint
|
A blueprint object to send to the viewer. It will be made active and set as the default blueprint in the recording. Setting this is equivalent to calling
TYPE:
|
use_global_recording
|
If no explicit Settings this to Defaults to
TYPE:
|
def add_recording(recording=None, blueprint=None)
Adds a recording to the viewer.
If no recording is specified, the current active recording will be used.
NOTE: By default all calls to rr.init() will re-use the same recording_id, meaning
that your recordings will be merged together. If you want to keep them separate, you
should call rr.init("my_app_id", recording_id=uuid.uuid4()).
| PARAMETER | DESCRIPTION |
|---|---|
recording
|
Specifies the
TYPE:
|
blueprint
|
A blueprint object to send to the viewer. It will be made active and set as the default blueprint in the recording. Setting this is equivalent to calling
TYPE:
|
def close_url(url)
Close an open URL in the viewer.
Does nothing if the URL is not open.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL to close.
TYPE:
|
def display(block_until_ready=False)
Display the viewer in the notebook cell immediately.
| PARAMETER | DESCRIPTION |
|---|---|
block_until_ready
|
Whether to block until the viewer is ready to receive data. If this is
TYPE:
|
def open_url(url)
Open a URL in the viewer.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL to open. Must point to a valid data source.
TYPE:
|
def send_table(id, table)
Sends a table in the form of a dataframe to the viewer.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The name that uniquely identifies the table in the viewer. This name will also be shown in the recording panel.
TYPE:
|
table
|
The table data as an Arrow RecordBatch, list of RecordBatches, or a datafusion DataFrame.
TYPE:
|
def set_active_recording(*, recording_id)
Set the active recording for the viewer.
This is equivalent to clicking on the given recording in the blueprint panel.
| PARAMETER | DESCRIPTION |
|---|---|
recording_id
|
The ID of the recording to set the viewer to. Using this requires setting an explicit recording ID when creating the recording.
TYPE:
|
def set_application_blueprint(application_id, blueprint, *, make_active=True, make_default=True)
Set the blueprint for the given application.
| PARAMETER | DESCRIPTION |
|---|---|
application_id
|
The ID of the application to set the blueprint for.
TYPE:
|
blueprint
|
The blueprint to set for the application.
TYPE:
|
make_active
|
Whether to make the blueprint active.
If
TYPE:
|
make_default
|
Whether to make the blueprint the default blueprint for the application.
If
TYPE:
|
def set_time_ctrl(*, sequence=None, duration=None, timestamp=None, timeline=None, play=False)
Set the time control for the viewer.
You are expected to set at most ONE of the arguments sequence, duration, or timestamp.
| PARAMETER | DESCRIPTION |
|---|---|
sequence
|
Used for sequential indices, like
TYPE:
|
duration
|
Used for relative times, like
TYPE:
|
timestamp
|
Used for absolute time indices, like
TYPE:
|
play
|
Whether to start playing from the specified time point. Defaults to paused.
TYPE:
|
timeline
|
The name of the timeline to switch to. If not provided, time will remain on the current timeline.
TYPE:
|
def update_panels(*, top=None, blueprint=None, selection=None, time=None)
Partially update the state of panels in the viewer.
Valid states are the strings expanded, collapsed, hidden, default, and the value None.
Panels set to:
- None will be unchanged.
- expanded will be fully expanded, taking up the most space.
- collapsed will be smaller and simpler, omitting some information.
- hidden will be completely invisible, taking up no space.
- default will be reset to the default state.
The collapsed state is the same as the hidden state for panels
which do not support the collapsed state.
Setting the panel state using this function will also prevent the user from modifying that panel's state in the viewer.
| PARAMETER | DESCRIPTION |
|---|---|
top
|
State of the panel, positioned on the top of the viewer.
TYPE:
|
blueprint
|
State of the blueprint panel, positioned on the left side of the viewer.
TYPE:
|
selection
|
State of the selection panel, positioned on the right side of the viewer.
TYPE:
|
time
|
State of the time panel, positioned on the bottom side of the viewer.
TYPE:
|