-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More context menu 4: create a new space view with selected entities (#…
…5411) ### What As the title says ☝🏻 * Fixes #5299 Also adds a "no action available for this selection" notice that got lost in #5392. Makes it very easy to bump into: - #5410 https://github.com/rerun-io/rerun/assets/49431240/d3bafbf4-3755-4f6f-b236-bd1d022b172f #### Design decisions - The origin of the newly created space view is set to "/" - Alternative 1: set it to the clicked item. Strong reject: too arcane, different results for the same multi-selection depending on which item is actually clicked. - Alternative 2: set it to the common ancestor of all selected entities. Weak reject: less predictable, occasionally wrong (but works around some visualisable issue we have with some space views). - We show a list of suggested space view classes. - The list is the *intersection* of the suggested classes for each of the selected entities. - For each entity, the suggested classes are determined based on the *union* of suggested classes for the entity itself, *and for every entity of its subtree*. This enables meaningful suggestion when selecting a pure TreePrefix. - The newly created space view is selected. #### Known "phenomenons" - 2D space views are rarely suggested, because of the origin is set to "/" and that's outside of a pinhole transform. - TODO: issue number? - Text Document and Text Log are often suggested for time series scalar, because of the `Text` document. - Tensor is recommended but will (sometime?) display nothing, e.g. `structure_from_motion` -> `/camera/image` - If enabled, Dataframe is always the top-most suggested Space View, because of the lexicographic sorting. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/5411/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5411/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/5411/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5411) - [Docs preview](https://rerun.io/preview/979f2768f87bd3e72b45c80ffd319b56661f138e/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/979f2768f87bd3e72b45c80ffd319b56661f138e/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
- Loading branch information
Showing
3 changed files
with
264 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
tests/python/release_checklist/check_context_menu_add_entity_to_new_space_view.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from __future__ import annotations | ||
|
||
import os | ||
import random | ||
from argparse import Namespace | ||
from uuid import uuid4 | ||
|
||
import numpy as np | ||
import rerun as rr | ||
|
||
README = """ | ||
# Context Menu - Add entity to new space view | ||
* Reset the blueprint. | ||
* Expend all space views and data result. | ||
* Right-click on the `boxes3d` entity and select "Add to new space view" -> "3D". Check a new space view is created _and selected_ with the boxes3d entity and origin set to root. | ||
* In each space view, right-click on the leaf entity, and check that "Add to new space view" recommends at least space views of the same kind. | ||
* Select both the `boxes3d` entity and the `text_logs` entity. Check no space view is recommended (except Dataframe if enabled). | ||
""" | ||
|
||
|
||
def log_readme() -> None: | ||
rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) | ||
|
||
|
||
def log_some_space_views() -> None: | ||
rr.set_time_sequence("frame_nr", 0) | ||
|
||
rr.log("boxes3d", rr.Boxes3D(centers=[[0, 0, 0], [1, 1.5, 1.15], [3, 2, 1]], half_sizes=[0.5, 1, 0.5] * 3)) | ||
rr.log("boxes2d", rr.Boxes2D(centers=[[0, 0], [1.3, 0.5], [3, 2]], half_sizes=[0.5, 1] * 3)) | ||
rr.log("text_logs", rr.TextLog("Hello, world!", level=rr.TextLogLevel.INFO)) | ||
rr.log("bars", rr.BarChart([1, 2, 3, 4, 5])) | ||
rr.log("tensor", rr.Tensor(np.random.rand(3, 4, 5))) | ||
|
||
for i in range(10): | ||
rr.set_time_sequence("frame_nr", i) | ||
rr.log("timeseries", rr.TimeSeriesScalar(random.randint(0, 100))) | ||
|
||
|
||
def run(args: Namespace) -> None: | ||
# TODO(cmc): I have no idea why this works without specifying a `recording_id`, but | ||
# I'm not gonna rely on it anyway. | ||
rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) | ||
|
||
log_readme() | ||
log_some_space_views() | ||
|
||
|
||
if __name__ == "__main__": | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="Interactive release checklist") | ||
rr.script_add_args(parser) | ||
args = parser.parse_args() | ||
run(args) |