The underlying canvas element.
Returns true if the viewer is ready to connect to data sources.
Close recordings, and return the store ids of the ones that were closed.
Closing by URL also stops loading from it. This only removes recordings from the viewer: unsaved blueprint edits are lost.
await viewer.close("https://app.rerun.io/version/0.39.0/examples/dna.rrd");
await viewer.close("all");
Rejects with a ViewerControlError with the code NOT_FOUND if a recording is not open,
or nothing is loaded from a URL. Then nothing is closed.
This API is experimental, and may change between releases.
Get the active recording id.
Use the active_store_id of WebViewer.get_state instead.
Get the active timeline.
This always returns null if the recording can't be found.
Use the recording's current_time.timeline from WebViewer.get_state instead.
Read a blueprint.
If target is omitted, reads the blueprint of what is on screen.
A recording or table without a blueprint gets a default one.
This API is experimental, and may change between releases.
Optionaltarget: BlueprintTargetGet the current time.
The interpretation of time depends on what kind of timeline it is:
This always returns 0 if the recording or timeline can't be found.
The time is a whole number.
Use the timeline's current_time from WebViewer.get_state instead.
The assets of a dataset on a server, and the entities logged in each.
Rejects like WebViewer.get_dataset_schema.
This API is experimental, and may change between releases.
The entities of a dataset's segments on a server, and the components logged on them.
Nothing is opened or loaded.
Rejects with a ViewerControlError with the code FAILED_PRECONDITION if no dataset_url is given
and no dataset is on screen, and NOT_FOUND if the viewer does not know the dataset.
This API is experimental, and may change between releases.
Where the viewer is: a recording, a catalog entry, the settings, …
Pass it to WebViewer.set_location to come back to it later.
This is a Viewer URL, not the address of the web page.
A recording is reported as about:recording?app_id=…&recording_id=….
This API is experimental, and may change between releases.
The viewer's recent log messages, INFO and above, oldest first.
Pass the sequence of the last entry seen to only get what is new.
This API is experimental, and may change between releases.
Optionalafter_sequence: bigintGet the play state.
This always returns false if the recording can't be found.
Use the recording's play_state from WebViewer.get_state instead.
A recording's timelines, entities, and the components logged on them.
Use paths_only to see the shape of a large recording,
then entity_path for the components of the entities that matter.
Rejects with a ViewerControlError with the code NOT_FOUND if the recording is not open,
or nothing in it is at or below entity_path.
This API is experimental, and may change between releases.
What the viewer currently shows.
Covers the active recording, every open recording with its timelines, their time ranges and its time cursor, and every view of the current blueprint with the warnings and errors it reports.
This API is experimental, and may change between releases.
A table's columns in display order, hidden ones included.
Takes a dataset or table url from the servers of WebViewer.get_state.
If omitted, the table on screen.
This API is experimental, and may change between releases.
Optionaltable_url: stringGet the time range for a timeline.
This always returns null if the recording or timeline can't be found.
Use the timeline's time_range from WebViewer.get_state instead.
A recording's transform graph at its time cursor: its frames, and the edges between them. See Transforms & Coordinate Frames.
This API is experimental, and may change between releases.
Draw a pulsing outline around a rectangle, to point the user at something.
It pulses until the user clicks. Pass null to dismiss it.
This API is experimental, and may change between releases.
Optionallabel: stringThe command palette commands, sorted by id, or the ones named in ids, in that order.
Rejects with a ViewerControlError with the code NOT_FOUND if an id in ids is unknown.
This API is experimental, and may change between releases.
Unregister an event listener.
The event emitter relies on referential equality to store callbacks.
The callback passed in must be the exact same instance of the function passed in to on or once.
See ViewerEvent for a full list of available events.
Unregister an event listener.
The event emitter relies on referential equality to store callbacks.
The callback passed in must be the exact same instance of the function passed in to on or once.
See ViewerEvent for a full list of available events.
Register an event listener.
Returns a function which removes the listener when called.
See ViewerEvent for a full list of available events.
Register an event listener.
Returns a function which removes the listener when called.
See ViewerEvent for a full list of available events.
Register an event listener which runs only once.
Returns a function which removes the listener when called.
See ViewerEvent for a full list of available events.
Register an event listener which runs only once.
Returns a function which removes the listener when called.
See ViewerEvent for a full list of available events.
Open URLs: recording or blueprint files, rerun:// dataset URIs, server or catalog URLs,
or links into a recording.
A recording it opens becomes the active recording, unless navigate is false.
A location the viewer already has open is not loaded again, only shown.
Resolves once the initial load is done, or after about ten seconds, whichever comes first.
const { store_ids } = await viewer.open("https://app.rerun.io/version/0.39.0/examples/dna.rrd");
Rejects with a ViewerControlError with the code NOT_FOUND for an about:recording URL of a recording that is not loaded.
This API is experimental, and may change between releases.
Opens a new channel for sending log messages.
The channel can be used to incrementally push rrd chunks into the viewer.
used to identify the channel.
Force a panel to a specific state.
which panel to configure
which state to force the panel into
Run a command palette command by id, and return the command.
Resolves once the command is queued, not when it is done.
This API is experimental, and may change between releases.
Save the active blueprint as an .rbl byte stream.
The snapshot is selected when this method is called. Concatenate all stream byte sequences to obtain one valid file. An individual sequence is not independently accepted by WebViewer.open_channel.
Save the active recording as an .rrd byte stream.
The snapshot is selected when this method is called. Concatenate all stream byte sequences to obtain one valid file. An individual sequence is not independently accepted by WebViewer.open_channel.
Set the active recording id.
This is the same as clicking on the recording in the Viewer's left panel.
Use WebViewer.set_location with the recording's location from WebViewer.get_state instead.
Set the active timeline.
This does nothing if the recording or timeline can't be found.
Use WebViewer.set_time with timeline instead.
Replace a whole blueprint, in the form WebViewer.get_blueprint reads it.
Anything the blueprint leaves out is cleared, so read it first, and change what you need.
Rejects with a ViewerControlError with the code INVALID_ARGUMENT that says where the blueprint is wrong.
This API is experimental, and may change between releases.
Set the current time.
Equivalent to clicking on the timeline in the time panel at the specified time.
The interpretation of time depends on what kind of timeline it is:
This does nothing if the recording or timeline can't be found. A fractional time is rounded down.
Use WebViewer.set_time instead.
Show a location the viewer already has open.
Takes a location from WebViewer.get_location, or the location of a recording from WebViewer.get_state.
This only navigates, and never loads anything: use WebViewer.open for that.
Rejects with a ViewerControlError with the code NOT_FOUND if the viewer does not have it open,
and INVALID_ARGUMENT if it is not a location.
This API is experimental, and may change between releases.
Set the play state.
This does nothing if the recording can't be found.
Use WebViewer.set_time with play_state instead.
Move the time cursor, switch the active timeline, or play, pause, or follow the latest data.
await viewer.set_time({ timeline: "frame", sequence: 42, play_state: "playing" });
Rejects with a ViewerControlError with the code INVALID_ARGUMENT if the recording or
timeline doesn't exist, or if play_state is following and a time is set.
This API is experimental, and may change between releases.
Start the viewer.
URLs to .rrd files or gRPC connections to our SDK.
The element to attach the canvas onto.
Web Viewer configuration.
Stop the viewer, freeing all associated memory.
The same viewer instance may be started multiple times.
Take a screenshot of the viewer, or of one of its views, as a PNG.
Rejects with a ViewerControlError with the code INVALID_ARGUMENT if view_id is not a UUID,
NOT_FOUND if no such view is visible, and FAILED_PRECONDITION if the view is too small to capture.
This API is experimental, and may change between releases.
Toggle fullscreen mode.
This does nothing if allow_fullscreen was not set to true when starting the viewer.
Fullscreen mode works by updating the underlying <canvas> element's style:
position to fixedWhen fullscreen mode is toggled off, the style is restored to its previous values.
When fullscreen mode is toggled on, any other instance of the viewer on the page which is already in fullscreen mode is toggled off. This means that it doesn't have to be tracked manually.
This functionality can also be directly accessed in the viewer:
Toggle fullscreen UI command (accessible via the command palette, CTRL+P)Toggle panel overrides set via override_panel_state.
Optionalvalue: boolean | null
set to a specific value. Toggles the previous value if not provided.
Rerun Web Viewer
Data may be provided to the Viewer as:
viewer.start("https://app.rerun.io/version/0.41.0/examples/dna.rrd")viewer.start("rerun+http://127.0.0.1:9876/proxy")Callbacks may be attached for various events using WebViewer.on:
For the full list of available events, see ViewerEvent.
Methods that read or drive the Viewer, like WebViewer.get_state and WebViewer.set_time, return promises, because the Viewer handles each request on its next frame. Some requests take even longer, such as a screenshot, or opening a URL, which waits for the data to load. They are all async so that they work the same way.