esc
Start typing to search the docs
Navigate Open

React to events in the Viewer

Can I add buttons or sliders that call my Python script?

Not in the native Viewer. The native Viewer has no user-defined widgets (buttons, sliders, text fields), and it does not send events (such as selection changes) back to a Python logging script. See missing features.

Here is what you can do instead.

Callbacks in the web Viewer and in notebooks

We support registering callbacks to Viewer events, such as selection and time changes, in these environments:

In both cases, you can build your own widgets in the host page or notebook (for example with ipywidgets), and use them to control the Viewer.

Callbacks in Rust

For users extending the Viewer through the Rust re_viewer crate, there are two options:

Drive the Viewer from Python

The experimental rerun.experimental.ViewerClient connects to a running Viewer and controls it from Python. It can open and close recordings, move the time cursor, start and stop playback, read and replace the blueprint, and take screenshots. It can also read a snapshot of the Viewer state (open recordings, the time cursor, and the views), but not the current selection. See Control playback and drive the Viewer from code.