Skip to content

Commit

Permalink
Include blueprint APIs for controlling panel expanded state (rerun-io…
Browse files Browse the repository at this point in the history
…#5484)

### What
These replace the old python_bridge APIs.

Also plumb through some missing components:
 - Viewport.auto_space_view
 - Viewport.auto_layout
 - SpaceView.display_name

Updated the old python blueprint example now that the bridge APIs are
gone.

Example code:
```python
        blueprint = Blueprint(
            Viewport(
                Grid(
                    Spatial2D(name="Rect 0", origin="/", contents=["image", "rect/0"]),
                    Spatial2D(name="Rect 1", origin="/", contents=["image", "rect/1"]),
                ),
                auto_space_views=args.auto_space_views,
            ),
            BlueprintPanel(expanded=False),
            SelectionPanel(expanded=False),
            TimePanel(expanded=False),
        )
```

### 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/5484/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5484/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/5484/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/5484)
- [Docs
preview](https://rerun.io/preview/f90df2a1f85ae651fa084f28d1fce9f8c10e9754/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/f90df2a1f85ae651fa084f28d1fce9f8c10e9754/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
jleibs authored Mar 13, 2024
1 parent e4f1fc9 commit 05d2b98
Show file tree
Hide file tree
Showing 55 changed files with 1,218 additions and 586 deletions.
3 changes: 2 additions & 1 deletion crates/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include "./blueprint/components/grid_columns.fbs";
include "./blueprint/components/included_content.fbs";
include "./blueprint/components/included_space_view.fbs";
include "./blueprint/components/lock_range_during_zoom.fbs";
include "./blueprint/components/panel_view.fbs";
include "./blueprint/components/panel_expanded.fbs";
include "./blueprint/components/query_expression.fbs";
include "./blueprint/components/root_container.fbs";
include "./blueprint/components/row_share.fbs";
Expand All @@ -22,6 +22,7 @@ include "./blueprint/components/visible.fbs";

include "./blueprint/archetypes/background_3d.fbs";
include "./blueprint/archetypes/container_blueprint.fbs";
include "./blueprint/archetypes/panel_blueprint.fbs";
include "./blueprint/archetypes/space_view_blueprint.fbs";
include "./blueprint/archetypes/space_view_contents.fbs";
include "./blueprint/archetypes/viewport_blueprint.fbs";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include "fbs/attributes.fbs";
include "rust/attributes.fbs";

namespace rerun.blueprint.archetypes;

// ---

/// Shared state for the 3 collapsible panels.
table PanelBlueprint (
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "Default",
"attr.rust.override_crate": "re_viewport"
) {
// --- Required ---

// --- Optional ---
/// Whether or not the panel is expanded.
expanded: rerun.blueprint.components.PanelExpanded ("attr.rerun.component_optional", nullable, order: 1000);

// TODO(jleibs): Add a float to track how expanded the panel is.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include "arrow/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.blueprint.components;

// ---

/// Whether an application panel is expanded or not.
struct PanelExpanded (
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct"
) {
expanded: rerun.datatypes.Bool (order: 100);
}

This file was deleted.

1 change: 1 addition & 0 deletions crates/re_types/definitions/rerun/datatypes.fbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include "./datatypes/angle.fbs";
include "./datatypes/annotation_info.fbs";
include "./datatypes/bool.fbs";
include "./datatypes/class_description.fbs";
include "./datatypes/class_description_map_elem.fbs";
include "./datatypes/class_id.fbs";
Expand Down
23 changes: 23 additions & 0 deletions crates/re_types/definitions/rerun/datatypes/bool.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include "arrow/attributes.fbs";
include "docs/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/attributes.fbs";

namespace rerun.datatypes;

// ---

/// A single boolean.
struct Bool (
"attr.arrow.transparent",
"attr.python.aliases": "bool",
"attr.rust.derive": "Copy, Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
"attr.docs.unreleased"
) {
value: bool (order: 100);
}
1 change: 1 addition & 0 deletions crates/re_types/src/blueprint/components/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/re_types/src/blueprint/components/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

150 changes: 150 additions & 0 deletions crates/re_types/src/blueprint/components/panel_expanded.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_types/src/datatypes/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/re_types/src/datatypes/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 05d2b98

Please sign in to comment.