Customize your visualization

This page explains how the Viewer turns logged data into a visualization, and how to change that per view, from the UI or from code. It also covers entity path filters, visible time ranges, annotation context, and text labels.

How a view draws your data

Diagram of a view blueprint: entities and component mappings (fed by overrides and defaults) go into visualizers that render the view

In the Rerun Viewer, visualizations happen within views, which are defined by their blueprint.

The first step for a view to display its content is to determine which entities are involved. This is determined by the entity path filter, which is part of the view blueprint. The query is run against the chunk store to generate the list of view entities.

Views rely on visualizers to display each of their entities. For example, 3D views use the Points3D visualizer to display 3D point clouds, and time series views use the SeriesLines visualizer to display time series line plots. Which visualizers are available is highly dependent on the specific kind of view. For example, the SeriesLines visualizer only exists for time series views — not, e.g., for 3D views.

For a given view, each entity's components determine which visualizers are available. For most visualizers, this is decided by Arrow datatype. The visualizer is available when the entity has a component with the datatype of the visualizer's required input, whatever that component is named. By default, visualizers are selected for entities logged with a corresponding archetype. For example, in a 3D view, an entity logged with the Points3D archetype results in the Points3D visualizer being selected by default. This happens because the components of an archetype are tagged with the archetype's name. With a few exceptions, archetypes are directly associated with a single visualizer, but it's also possible to add multiple visualizers of the same type to a given entity via blueprints or the UI.

Then, each selected visualizer determines the values for its inputs. For example, the Points3D visualizer reads, among others, Points3D:positions (Position3D), Points3D:radii (Radius), and Points3D:colors (Color).

Choose visualizers

Sometimes it makes sense to explicitly set the visualizers, to change the way entities are visualized.

Here is how to force a SeriesPoints visualizer for /trig/sin, in addition to the default SeriesLines visualizer:

"""Log a scalar over time and override the visualizer."""

from math import cos, sin, tau

import rerun as rr
import rerun.blueprint as rrb

rr.init("rerun_example_series_line_overrides", spawn=True)

# Log the data on a timeline called "step".
for t in range(int(tau * 2 * 10.0)):
    rr.set_time("step", sequence=t)

    rr.log("trig/sin", rr.Scalars(sin(float(t) / 10.0)))
    rr.log("trig/cos", rr.Scalars(cos(float(t) / 10.0)))

# Use the SeriesPoints visualizer for the sin series.
rr.send_blueprint(
    rrb.TimeSeriesView(
        overrides={
            "trig/sin": [rr.SeriesLines(), rr.SeriesPoints()],
        },
    ),
)

The view now displays a series of points in addition to connecting the values with lines. Here is how the visualizers are displayed in the user interface:

SeriesPoints visualizer in the selection panel with scalars, colors, markers set to Circle, names, visible_series and marker_sizes

The next section describes how to precisely control what data each visualizer operates on, to fully customize the contents of a view.

For component mappings and nested selectors, see Remap your data.

Where a visualizer input gets its value

A visualizer normally reads components from the recording. If a value is missing, it can use a view default; you can also override a value for an entity or remap an input to another component. Required inputs, such as point positions, must be available for the visualizer to draw data.

Set a value for one entity

An override sets a custom value for one entity in one view. A common way of customizing a visualization is by setting custom values, for example for visualizers that expect a Color component. In the UI this can be done via the visualizer UI, by clicking and modifying the color component, or by selecting "Add custom" from the Source dropdown.

When such a customization is defined, it automatically changes the component's source for this visualizer to point to this new custom value.

The Source dropdown menu allows quick toggling between the different input representations. By clicking on "Add custom" you can set a custom value:

Source dropdown for the Boxes2D colors component, listing Boxes2D:colors, View default and the highlighted Add custom option

You then can use the color picker to determine a color:

Color picker open on the colors component of a Boxes2D visualizer, set to bright green (R 71, G 255, B 0)

Note that any direct edit on any component of the visualizer will always set the source to "Custom".

The following snippet shows how the same customization can be achieved with the blueprint API:

"""Override a component."""

import rerun as rr
import rerun.blueprint as rrb

rr.init("rerun_example_component_override", spawn=True)

# Data logged to the data store.
rr.log("boxes/1", rr.Boxes2D(centers=[0, 0], sizes=[1, 1], colors=[255, 0, 0]))
rr.log("boxes/2", rr.Boxes2D(centers=[2, 0], sizes=[1, 1], colors=[255, 0, 0]))

rr.send_blueprint(
    rrb.Spatial2DView(
        # Override the values from the data store for the first box.
        overrides={
            "boxes/1": rr.Boxes2D(colors=[0, 255, 0]),
        },
    ),
)

Set a default for a view

You can also force a visualizer to use a specific source kind. Setting the source to Default makes the visualizer ignore any store data and use the view's default instead:

# Red sine:
# * set the name via an override
# * explicitly use the view's default for color
# * everything else uses the automatic component mappings,
#   so it will pick up scalars from the store.
rr.SeriesLines(names="sine (store)").visualizer(
    mappings=[
        VisualizerComponentMapping(
            target="SeriesLines:colors",
            source_kind=ComponentSourceKind.Default,
        ),
    ]
),

View defaults

The viewer picks default component values based on a wide variety of different heuristics, ranging from simple local properties like an entity's name all the way to things like the size of a view's bounding box or how many plots are within it.

Sometimes, it makes sense to set a custom default value that is applied across all visualizers of a view, to avoid redundant blueprint definitions.

This can be done through the UI by selecting the view in question and specifying a new default there:

Component defaults section of a selected view, with a Pinhole image_plane_distance default set to 5.00

A custom default value set this way will show up on the respective visualizers:

Source dropdown for image_plane_distance with View default selected and Add custom as the other option

This is how it is achieved with the blueprint API:

"""Add a component default."""

import rerun as rr
import rerun.blueprint as rrb

rr.init("rerun_example_component_override", spawn=True)

# Data logged to the data store.
rr.log("boxes/1", rr.Boxes2D(centers=[0, 0], sizes=[1, 1], colors=[255, 0, 0]))
rr.log("boxes/2", rr.Boxes2D(centers=[2, 0], sizes=[1, 1]))

rr.send_blueprint(
    rrb.Spatial2DView(
        overrides={"boxes/1": rr.Boxes2D(colors=[0, 255, 0])},
        # Add a default value for all Color components in this view
        defaults=[rr.Boxes2D.from_fields(colors=[0, 0, 255])],
    ),
)

Here, the /boxes/2 entity is no longer logged with a color value, but a default box color is added to the blueprint. Here is how the user interface represents its visualizer:

Boxes2D visualizer in the selection panel with a blue colors value whose Source is set to View default

And as before, this also shows up in the View's component defaults.

Component defaults section of a view listing a blue colors default for Boxes2D

Override path rules

Keys in overrides={…} must be full entity paths from the root. They do not support $origin or wildcards such as /**.

Entity path filter

Use an entity path filter to focus a view on part of your recording, such as one camera or a robot's trajectory, while leaving out unrelated or debug data. The filter selects entities by their paths without changing the recording, so different views can show different subsets of the same data.

A filter is a list of include and exclude rules. Each rule can match one entity or an entire subtree, so you do not need to list every entity separately.

View origin

A view's origin is an entity path that filter rules can refer to as $origin.

In 2D and 3D views, the origin also gives the default target frame: the frame that the view shows all data in. Data gets to that frame through transforms, which come from the entity hierarchy or from named transform frames.

You can now set the target frame directly, so the transforms in a view no longer depend on its origin. For this reason, the origin will be deprecated in an upcoming version.

Filter syntax

Use + to include a path, - to exclude it, and /** to match a path and all its descendants. See entity path filter syntax for how matching rules are combined.

In the Viewer

Select a view to edit its entity path filter in the right-hand selection panel. The filter editor shows one rule per line.

Rerun Viewer with a 3D helix view selected and the entity path filter in the selection panel including helix/** and excluding scaffolding

In the SDK

Set the view's contents parameter to a list or iterable of filter rules, with each rule written as a separate string. The filter shown above would be written as:

rrb.Spatial3DView(contents=["+ helix/**", "- helix/structure/scaffolding"])

origin substitution

Filter rules can use $origin to refer to the view's origin.

For example, the filter above could be rewritten as:

rrb.Spatial3DView(origin="helix", contents=["+ $origin/**", "- $origin/structure/scaffolding"])

Recording properties are excluded by default

Every view's entity path filter implicitly excludes __properties/**, where recording properties are stored. So + /** does not show them. To include them in a view, add the rule + __properties/** to the view's contents explicitly.

Hide or exclude an entity

Use the eye icon in the blueprint panel to hide or show an entity interactively. To hide an entity (and its children) by default in a view, use the EntityBehavior blueprint archetype as an override. The entity is still part of the view, so the user can show it again by clicking the eye icon in the blueprint panel. You can also make entities non-interactive, so that they cannot be hovered or selected in the view.

"""Configure interactivity & visibility of entities."""

import rerun as rr
import rerun.blueprint as rrb

rr.init("rerun_example_entity_behavior", spawn=True)

# Use `EntityBehavior` to override visibility & interactivity of entities
# in the blueprint.
rr.send_blueprint(
    rrb.Spatial2DView(
        overrides={
            "hidden_subtree": rrb.EntityBehavior(visible=False),
            "hidden_subtree/not_hidden": rrb.EntityBehavior(visible=True),
            "non_interactive_subtree": rrb.EntityBehavior(interactive=False),
        }
    )
)

rr.log("hidden_subtree", rr.Points2D(positions=(0, 0), radii=0.5))
rr.log("hidden_subtree/also_hidden", rr.LineStrips2D(strips=[(-1, 1), (1, -1)]))
rr.log("hidden_subtree/not_hidden", rr.LineStrips2D(strips=[(1, 1), (-1, -1)]))
rr.log("non_interactive_subtree", rr.Boxes2D(centers=(0, 0), half_sizes=(1, 1)))
rr.log(
    "non_interactive_subtree/also_non_interactive",
    rr.Boxes2D(centers=(0, 0), half_sizes=(0.5, 0.5)),
)

EntityBehavior currently only has an effect when you set it in the blueprint, as above. Logging it together with your data does nothing.

To remove an entity from a view completely, exclude it in the view's entity path filter instead, for example with contents=["+ /**", "- /debug/**"].

Visible time ranges

By default, a 2D or 3D view shows the latest value of each entity at the time cursor. TimeSeriesView and StateTimelineView show the whole timeline by default. To show history instead (trails, trajectories, accumulated point clouds, or a scrolling plot window), set a visible time range on the view or on single entities.

Visible time ranges work on these views:

How VisibleTimeRange works

VisibleTimeRange takes three parameters:

  • timeline: the timeline that the range applies to. It must match the timeline that your data is logged on, for example the name you pass to rr.set_time. If you only use the built-in timestamps, use "log_time" (or "log_tick", if you enabled it with rr.set_log_tick_enabled(True) or RERUN_LOG_TICK=1).
  • start: the start of the range.
  • end: the end of the range.

Set start and end with a TimeRangeBoundary:

  • TimeRangeBoundary.cursor_relative(): relative to the time cursor. Use this for sliding windows.
  • TimeRangeBoundary.absolute(): a fixed time.
  • TimeRangeBoundary.infinite(): unbounded. For example, start=rrb.TimeRangeBoundary.infinite() and end=rrb.TimeRangeBoundary.cursor_relative() show all data up to the cursor.

cursor_relative() and absolute() take one keyword argument that matches the kind of timeline:

  • seconds or nanos: for timelines set with rr.set_time(…, duration=…) or rr.set_time(…, timestamp=…).
  • seq: for timelines set with rr.set_time(…, sequence=…).

You can pass one VisibleTimeRange or a list of them, one per timeline. The range for the active timeline is used.

Set the time range per entity

To give one entity a different range than the rest of the view, add a VisibleTimeRanges override for its entity path:

trajectory_view = rrb.Spatial3DView(
    origin="/",
    overrides={
        "/world/robot/trajectory": rrb.VisibleTimeRanges(
            timeline="time",
            start=rrb.TimeRangeBoundary.infinite(),
            end=rrb.TimeRangeBoundary.cursor_relative(),
        ),
    },
)

See Override path rules for the required entity paths.

You can also set time ranges in the Viewer: select a view or an entity, and edit "Visible time range" in the selection panel.

Missing or persistent data

See Why does my data disappear? and Latest-at semantics for data that is missing or stays visible.

Query range and axis window

A visible time range controls which data a view queries, while a plot's axis window controls what part of the time axis is visible. See Query range and axis window.

Show history in 2D and 3D

2D history

By default, a 2D view shows the latest value of each entity at the time cursor. Set time_ranges on Spatial2DView to show trails or accumulate data over time. The 3D history example below also applies to 2D views: replace Spatial3DView with Spatial2DView.

3D trails

Pass a VisibleTimeRange to the time_ranges parameter of the view:

"""Log line strips over time and view a sliding window (e.g. trajectories)."""

import math

import rerun as rr
import rerun.blueprint as rrb


def point(t: float, phase: float) -> list[float]:
    # Sample a point on a helix.
    angle = 0.5 * t + phase
    return [math.cos(angle), math.sin(angle), 0.1 * t]


rr.init("rerun_example_line_strips3d_time_window", spawn=True)

# Configure the visible time range in the blueprint.
# You can also override this per entity.
rr.send_blueprint(
    rrb.Spatial3DView(
        origin="/",
        time_ranges=rrb.VisibleTimeRange(
            "time",
            start=rrb.TimeRangeBoundary.cursor_relative(seconds=-5.0),
            end=rrb.TimeRangeBoundary.cursor_relative(),
        ),
    )
)

# Log the line strip increments with timestamps.
for i in range(600):
    t0 = i / 30.0
    t1 = (i + 1) / 30.0

    rr.set_time("time", duration=t1)
    rr.log(
        "trails",
        rr.LineStrips3D(
            [
                [point(t0, 0.0), point(t1, 0.0)],
                [point(t0, math.pi), point(t1, math.pi)],
            ],
            colors=[[255, 120, 0], [0, 180, 255]],
            radii=0.02,
        ),
    )

Everything logged in the 5 seconds before the time cursor is now drawn at once. This is how you draw trails: log one short line segment or one point per time step, and let the time range accumulate them.

To pan and zoom the time axis of several plots together, set link on the TimeAxis of each view:

rrb.Vertical(
    rrb.TimeSeriesView(origin="/imu", axis_x=rrb.TimeAxis(link="LinkToGlobal")),
    rrb.TimeSeriesView(origin="/motors", axis_x=rrb.TimeAxis(link="LinkToGlobal")),
)

All views with link="LinkToGlobal" share one time axis range. This works for TimeSeriesView and the time_view of StateTimelineView. The default is "Independent".

Annotation context

Any visualization that assigns an identifier ("Class ID") to an instance or entity can benefit from using Annotations. By using an Annotation Context, you can associate labels and colors with a given class and then re-use that class across entities.

This is particularly useful for visualizing the output of classification algorithms (as demonstrated by the Detect and Track Objects example), but can be used more generally for any kind of reoccurring categorization within a Rerun recording.

viewer screenshot showing various tracked objects and their class ids

Keypoints & keypoint connections

Rerun allows you to define keypoints within a class. Each keypoint can define its own properties (colors, labels, etc.) that overwrite its parent class.

A typical example usage of keypoints is annotating the joints of a skeleton within a pose detection. In that case, the entire detected pose/skeleton is assigned a Class ID and each joint within gets a Keypoint ID.

You can also define connections between keypoints as part of your annotation class description. The Viewer will draw the connecting lines for all connected keypoints whenever that class is used. Just as with labels and colors this allows you to use the same connection information on any instance of that class in your scene.

Keypoints are currently only applicable to 2D and 3D points.

keypoint shown on a 3D skeleton

Logging an annotation context

Annotation Context is typically logged as static data, but can change over time if needed.

The Annotation Context is defined as a list of Class Descriptions that define how classes are styled (as well as optional keypoint style and connection).

Annotation contexts are logged with:

import rerun as rr

rr.init("rerun_example_annotation_context_connections")

# Annotation context with two classes, using two labeled classes, of which
# ones defines a color.
rr.log(
    "masks",  # Applies to all entities below "masks".
    rr.AnnotationContext(
        [
            rr.AnnotationInfo(id=0, label="Background"),
            rr.AnnotationInfo(id=1, label="Person", color=(255, 0, 0)),
        ],
    ),
    static=True,
)

# Annotation context with simple keypoints & keypoint connections.
rr.log(
    "detections",  # Applies to all entities below "detections".
    rr.ClassDescription(
        info=rr.AnnotationInfo(0, label="Snake"),
        keypoint_annotations=[
            rr.AnnotationInfo(id=i, color=(0, 28 * i, 0)) for i in range(10)
        ],
        keypoint_connections=[(i, i + 1) for i in range(9)],
    ),
    static=True,
)

Affected entities

Each entity that uses a Class ID component (and optionally Keypoint ID components) will look for the nearest ancestor in the entity path hierarchy that has an Annotation Context defined.

For fields that support annotation context, the Viewer automatically uses recorded values when available, otherwise annotation context when Class IDs or Keypoint IDs are present. You can also select annotation context explicitly with a visualizer component mapping. Once annotation context is selected as the source for a field, recorded values for that field are ignored. The Viewer resolves values from Class IDs and Keypoint IDs, then uses the view default or visualizer fallback when the annotation context does not define a value.

See the 2D view for segmentation colors and image overlays.

Text labels in 2D and 3D

This section covers label placement, visibility, and limitations in 2D and 3D views.

Add labels

Many 2D and 3D archetypes have a labels field: Points2D, Points3D, Boxes2D, Boxes3D, Arrows2D, Arrows3D, LineStrips2D, LineStrips3D, Ellipses2D, Ellipsoids3D, Capsules3D, and Cylinders3D.

rr.log(
    "detections",
    rr.Boxes2D(
        mins=[[10, 10], [80, 40]],
        sizes=[[50, 30], [40, 40]],
        labels=["car", "person"],
    ),
)
  • With one label per instance, each instance gets its own label.
  • With a single label, it is placed once, at the center of the entity.

Labels can also come from an annotation context, through class IDs.

Why are my labels not shown?

By default, labels are only shown when the entity has a single label, or when it has few instances. This keeps large point clouds readable. To always show them, set show_labels=True:

rr.log("points", rr.Points3D(positions, labels=names, show_labels=True))

You can also toggle show_labels in the Viewer: select the entity and change it in the visualizer section of the selection panel.

A standalone text label

There is no archetype for text alone. To place a label at a position in 2D or 3D, log a single point with a label, and make the point small:

rr.log("world/label", rr.Points3D([[1.0, 2.0, 0.5]], labels="Start", radii=0.001))

Limitations

Labels are drawn at a fixed screen size. You cannot change the font size or the font, and labels do not scale with the zoom level. See missing features.