Skip to content

Views

rerun.blueprint.views

class BarChartView

Bases: SpaceView

View: A bar chart view.

Example
Use a blueprint to create a BarChartView.:

import rerun as rr
import rerun.blueprint as rrb

rr.init("rerun_example_bar_chart", spawn=True)
# It's recommended to log bar charts with the `rr.BarChart` archetype,
# but single dimensional tensors can also be used if a `BarChartView` is created explicitly.
rr.log("tensor", rr.Tensor([8, 4, 0, 9, 1, 4, 1, 6, 9, 0]))

# Create a bar chart view to display the chart.
blueprint = rrb.Blueprint(rrb.BarChartView(origin="tensor", name="Bar Chart"), collapse_panels=True)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None)

Construct a blueprint for a new BarChartView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class Spatial2DView

Bases: SpaceView

View: For viewing spatial 2D data.

Example
Use a blueprint to customize a Spatial2DView.:

import numpy as np
import rerun as rr
import rerun.blueprint as rrb

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

# Create a spiral of points:
n = 150
angle = np.linspace(0, 10 * np.pi, n)
spiral_radius = np.linspace(0.0, 3.0, n) ** 2
positions = np.column_stack((np.cos(angle) * spiral_radius, np.sin(angle) * spiral_radius))
colors = np.dstack((np.linspace(255, 255, n), np.linspace(255, 0, n), np.linspace(0, 255, n)))[0].astype(int)
radii = np.linspace(0.01, 0.7, n)

rr.log("points", rr.Points2D(positions, colors=colors, radii=radii))

# Create a Spatial2D view to display the points.
blueprint = rrb.Blueprint(
    rrb.Spatial2DView(
        origin="/",
        name="2D Scene",
        # Set the background color
        background=[105, 20, 105],
        # Note that this range is smaller than the range of the points,
        # so some points will not be visible.
        visual_bounds=rrb.VisualBounds2D(x_range=[-5, 5], y_range=[-5, 5]),
    ),
    collapse_panels=True,
)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None, background=None, visual_bounds=None, time_ranges=None)

Construct a blueprint for a new Spatial2DView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

background

Configuration for the background of the view.

TYPE: Background | Rgba32Like | BackgroundKindLike | None DEFAULT: None

visual_bounds

The visible parts of the scene, in the coordinate space of the scene.

Everything within these bounds are guaranteed to be visible. Somethings outside of these bounds may also be visible due to letterboxing.

TYPE: VisualBounds2D | None DEFAULT: None

time_ranges

Configures which range on each timeline is shown by this view (unless specified differently per entity).

If not specified, the default is to show the latest state of each component. If a timeline is specified more than once, the first entry will be used.

TYPE: VisibleTimeRanges | VisibleTimeRangeLike | Sequence[VisibleTimeRangeLike] | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class Spatial3DView

Bases: SpaceView

View: For viewing spatial 3D data.

Example
Use a blueprint to customize a Spatial3DView.:

import rerun as rr
import rerun.blueprint as rrb
from numpy.random import default_rng

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

# Create some random points.
rng = default_rng(12345)
positions = rng.uniform(-5, 5, size=[50, 3])
colors = rng.uniform(0, 255, size=[50, 3])
radii = rng.uniform(0.1, 0.5, size=[50])

rr.log("points", rr.Points3D(positions, colors=colors, radii=radii))
rr.log("box", rr.Boxes3D(half_sizes=[5, 5, 5], colors=0))

# Create a Spatial3D view to display the points.
blueprint = rrb.Blueprint(
    rrb.Spatial3DView(
        origin="/",
        name="3D Scene",
        # Set the background color to light blue.
        background=[100, 149, 237],
    ),
    collapse_panels=True,
)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None, background=None, time_ranges=None)

Construct a blueprint for a new Spatial3DView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

background

Configuration for the background of the view.

TYPE: Background | Rgba32Like | BackgroundKindLike | None DEFAULT: None

time_ranges

Configures which range on each timeline is shown by this view (unless specified differently per entity).

If not specified, the default is to show the latest state of each component. If a timeline is specified more than once, the first entry will be used.

TYPE: VisibleTimeRanges | VisibleTimeRangeLike | Sequence[VisibleTimeRangeLike] | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class TensorView

Bases: SpaceView

View: A view on a tensor of any dimensionality.

Example
Use a blueprint to create a TensorView.:

import numpy as np
import rerun as rr
import rerun.blueprint as rrb

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

tensor_one = np.random.randint(0, 256, (8, 6, 3, 5), dtype=np.uint8)
rr.log("tensors/one", rr.Tensor(tensor_one, dim_names=("width", "height", "channel", "batch")))
tensor_two = np.random.random_sample((10, 20, 30))
rr.log("tensors/two", rr.Tensor(tensor_two))

# Create a tensor view that displays both tensors (you can switch between them inside the view).
blueprint = rrb.Blueprint(rrb.TensorView(origin="/tensors", name="Tensors"), collapse_panels=True)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None)

Construct a blueprint for a new TensorView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class TextDocumentView

Bases: SpaceView

View: A view of a single text document, for use with the TextDocument archetype.

Example
Use a blueprint to show a text document.:

import rerun as rr
import rerun.blueprint as rrb

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

rr.log(
    "markdown",
    rr.TextDocument(
        '''
# Hello Markdown!
[Click here to see the raw text](recording://markdown:Text).

Basic formatting:

| **Feature**       | **Alternative** |
| ----------------- | --------------- |
| Plain             |                 |
| *italics*         | _italics_       |
| **bold**          | __bold__        |
| ~~strikethrough~~ |                 |
| `inline code`     |                 |

----------------------------------

## Support
- [x] [Commonmark](https://commonmark.org/help/) support
- [x] GitHub-style strikethrough, tables, and checkboxes
- Basic syntax highlighting for:
  - [x] C and C++
  - [x] Python
  - [x] Rust
  - [ ] Other languages

## Links
You can link to [an entity](recording://markdown),
a [specific instance of an entity](recording://markdown[#0]),
or a [specific component](recording://markdown:Text).

Of course you can also have [normal https links](https://github.com/rerun-io/rerun), e.g. <https://rerun.io>.

## Image
![A random image](https://picsum.photos/640/480)
'''.strip(),
        media_type=rr.MediaType.MARKDOWN,
    ),
)

# Create a text view that displays the markdown.
blueprint = rrb.Blueprint(rrb.TextDocumentView(origin="markdown", name="Markdown example"), collapse_panels=True)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None)

Construct a blueprint for a new TextDocumentView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class TextLogView

Bases: SpaceView

View: A view of a text log, for use with the TextLog archetype.

Example
Use a blueprint to show a TextLogView.:

import rerun as rr
import rerun.blueprint as rrb

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

rr.set_time_sequence("time", 0)
rr.log("log/status", rr.TextLog("Application started.", level=rr.TextLogLevel.INFO))
rr.set_time_sequence("time", 5)
rr.log("log/other", rr.TextLog("A warning.", level=rr.TextLogLevel.WARN))
for i in range(10):
    rr.set_time_sequence("time", i)
    rr.log("log/status", rr.TextLog(f"Processing item {i}.", level=rr.TextLogLevel.INFO))

# Create a text view that displays all logs.
blueprint = rrb.Blueprint(rrb.TextLogView(origin="/log", name="Text Logs"), collapse_panels=True)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None)

Construct a blueprint for a new TextLogView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.

class TimeSeriesView

Bases: SpaceView

View: A time series view for scalars over time, for use with the Scalars archetype.

Example
Use a blueprint to customize a TimeSeriesView.:

import math

import rerun as rr
import rerun.blueprint as rrb

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

# Log some trigonometric functions
rr.log("trig/sin", rr.SeriesLine(color=[255, 0, 0], name="sin(0.01t)"), static=True)
rr.log("trig/cos", rr.SeriesLine(color=[0, 255, 0], name="cos(0.01t)"), static=True)
rr.log("trig/cos", rr.SeriesLine(color=[0, 0, 255], name="cos(0.01t) scaled"), static=True)
for t in range(0, int(math.pi * 4 * 100.0)):
    rr.set_time_sequence("timeline0", t)
    rr.set_time_seconds("timeline1", t)
    rr.log("trig/sin", rr.Scalar(math.sin(float(t) / 100.0)))
    rr.log("trig/cos", rr.Scalar(math.cos(float(t) / 100.0)))
    rr.log("trig/cos_scaled", rr.Scalar(math.cos(float(t) / 100.0) * 2.0))

# Create a TimeSeries View
blueprint = rrb.Blueprint(
    rrb.TimeSeriesView(
        origin="/trig",
        # Set a custom Y axis.
        axis_y=rrb.ScalarAxis(range=(-1.0, 1.0), lock_range_during_zoom=True),
        # Configure the legend.
        plot_legend=rrb.PlotLegend(visible=False),
        # Set time different time ranges for different timelines.
        time_ranges=[
            # Sliding window depending on the time cursor for the first timeline.
            rrb.VisibleTimeRange(
                "timeline0",
                start=rrb.TimeRangeBoundary.cursor_relative(seq=-100),
                end=rrb.TimeRangeBoundary.cursor_relative(),
            ),
            # Time range from some point to the end of the timeline for the second timeline.
            rrb.VisibleTimeRange(
                "timeline1",
                start=rrb.TimeRangeBoundary.absolute(seconds=300.0),
                end=rrb.TimeRangeBoundary.infinite(),
            ),
        ],
    ),
    collapse_panels=True,
)

rr.send_blueprint(blueprint)

def __init__(*, origin='/', contents='$origin/**', name=None, visible=None, axis_y=None, plot_legend=None, time_ranges=None)

Construct a blueprint for a new TimeSeriesView view.

PARAMETER DESCRIPTION
origin

The EntityPath to use as the origin of this view. All other entities will be transformed to be displayed relative to this origin.

TYPE: EntityPathLike DEFAULT: '/'

contents

The contents of the view specified as a query expression. This is either a single expression, or a list of multiple expressions. See rerun.blueprint.archetypes.SpaceViewContents.

TYPE: SpaceViewContentsLike DEFAULT: '$origin/**'

name

The display name of the view.

TYPE: Utf8Like | None DEFAULT: None

visible

Whether this view is visible.

Defaults to true if not specified.

TYPE: VisibleLike | None DEFAULT: None

axis_y

Configures the vertical axis of the plot.

TYPE: ScalarAxis | None DEFAULT: None

plot_legend

Configures the legend of the plot.

TYPE: PlotLegend | Corner2D | None DEFAULT: None

time_ranges

Configures which range on each timeline is shown by this view (unless specified differently per entity).

If not specified, the default is to show the entire timeline. If a timeline is specified more than once, the first entry will be used.

TYPE: VisibleTimeRanges | VisibleTimeRangeLike | Sequence[VisibleTimeRangeLike] | None DEFAULT: None

def blueprint_path()

The blueprint path where this space view will be logged.

Note that although this is an EntityPath, is scoped to the blueprint tree and not a part of the regular data hierarchy.

def to_blueprint()

Convert this space view to a full blueprint.

def to_container()

Convert this space view to a container.