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, defaults=[], overrides={}, plot_legend=None)
Construct a blueprint for a new BarChartView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
plot_legend |
Configures the legend of the plot.
TYPE:
|
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, defaults=[], overrides={}, background=None, visual_bounds=None, time_ranges=None)
Construct a blueprint for a new Spatial2DView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
background |
Configuration for the background of the view.
TYPE:
|
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:
|
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:
|
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, defaults=[], overrides={}, background=None, time_ranges=None)
Construct a blueprint for a new Spatial3DView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
background |
Configuration for the background of the view.
TYPE:
|
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:
|
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 = np.random.randint(0, 256, (32, 240, 320, 3), dtype=np.uint8)
rr.log("tensor", rr.Tensor(tensor, dim_names=("batch", "x", "y", "channel")))
blueprint = rrb.Blueprint(
rrb.TensorView(
origin="tensor",
name="Tensor",
# Explicitly pick which dimensions to show.
slice_selection=rrb.TensorSliceSelection(
# Use the first dimension as width.
width=1,
# Use the second dimension as height and invert it.
height=rr.TensorDimensionSelection(dimension=2, invert=True),
# Set which indices to show for the other dimensions.
indices=[
rr.TensorDimensionIndexSelection(dimension=2, index=4),
rr.TensorDimensionIndexSelection(dimension=3, index=5),
],
# Show a slider for dimension 2 only. If not specified, all dimensions in `indices` will have sliders.
slider=[2],
),
# Set a scalar mapping with a custom colormap, gamma and magnification filter.
scalar_mapping=rrb.TensorScalarMapping(colormap="turbo", gamma=1.5, mag_filter="linear"),
# Fill the view, ignoring aspect ratio.
view_fit="fill",
),
collapse_panels=True,
)
rr.send_blueprint(blueprint)
def __init__(*, origin='/', contents='$origin/**', name=None, visible=None, defaults=[], overrides={}, slice_selection=None, scalar_mapping=None, view_fit=None)
Construct a blueprint for a new TensorView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
slice_selection |
How to select the slice of the tensor to show.
TYPE:
|
scalar_mapping |
Configures how scalars are mapped to color.
TYPE:
|
view_fit |
Configures how the selected slice should fit into the view.
TYPE:
|
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 archetypes.TextDocument
.
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, defaults=[], overrides={})
Construct a blueprint for a new TextDocumentView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
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 archetypes.TextLog
.
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, defaults=[], overrides={})
Construct a blueprint for a new TextLogView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
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 archetypes.Scalar
.
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), zoom_lock=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, defaults=[], overrides={}, axis_y=None, plot_legend=None, time_ranges=None)
Construct a blueprint for a new TimeSeriesView view.
PARAMETER | DESCRIPTION |
---|---|
origin |
The
TYPE:
|
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:
|
name |
The display name of the view.
TYPE:
|
visible |
Whether this view is visible. Defaults to true if not specified.
TYPE:
|
defaults |
List of default components or component batches to add to the space view. When an archetype in the view is missing a component included in this set, the value of default will be used instead of the normal fallback for the visualizer.
TYPE:
|
overrides |
Dictionary of overrides to apply to the space view. The key is the path to the entity where the override should be applied. The value is a list of component or component batches to apply to the entity. Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support
TYPE:
|
axis_y |
Configures the vertical axis of the plot.
TYPE:
|
plot_legend |
Configures the legend of the plot.
TYPE:
|
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:
|
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.