Skip to content

Minimal control of views through SDK #1889

@jleibs

Description

@jleibs

The long-term goal for controlling the UI is introduction of a blueprint store for most UI state: https://github.com/rerun-io/rerun/blob/main/design/blueprint_store.md

However, we can create immediate value for users (in particular in a notebook context) with just a subset of the functionality from the RFC.

In order of priority:

  • Specify panel state (collapsed or expanded) for the 3 panels
  • Specify selected timeline
  • Specify whether to enable auto-view creation (this should be one of the first things logged; probably part of init?)
  • Specify views to be created (view name, space root, and list of entity paths)
  • Specify entity properties

Notably this does not try to tackle:

  • View Layout
  • Data queries / filters
  • Data-overrides / defaults

Proposed API:

# Trivial
rr.view.Spatial2D(origin="world/camera")

# Implies
rr.view.Spatial2D(origin="world/camera", contents="$origin/**")

EntityPathExpressionLike: (str, Sequence[str], EntityPathExpression)
Spatial2D(origin: str, contents: EntityPathExpressoinLike = "$origin/**")

# Which is syntactic sugar for:
entities = rr.view.EntityPathExpression("$origin/**")
rr.view.Spatial2D(origin="world/camera", contents=entities)

# With extra data
rr.view.Spatial2D(origin="world/camera", contents="+$origin/** +/world/points")

# Or for python formatter clarity, allow lists:
rr.view.Spatial2D(
    origin="world/camera",
    contents=[
        "+$origin/**",
        "+/",
    ],
)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions