Skip to content

Commit

Permalink
Migrate SpaceView from a singular Component to an Archetype (#4522)
Browse files Browse the repository at this point in the history
### What

Just what the title says.
Best reviewed commit by commit.

### 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):
  * Full build: [app.rerun.io](https://app.rerun.io/pr/4522/index.html)
* Partial build:
[app.rerun.io](https://app.rerun.io/pr/4522/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
- Useful for quick testing when changes do not affect examples in any
way
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4522)
- [Docs
preview](https://rerun.io/preview/f43a2e5293d2ee590e9910247f6543f7439b2692/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/f43a2e5293d2ee590e9910247f6543f7439b2692/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 Dec 14, 2023
1 parent 003f167 commit 6658d95
Show file tree
Hide file tree
Showing 66 changed files with 2,636 additions and 1,044 deletions.
8 changes: 6 additions & 2 deletions crates/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
include "./blueprint/datatypes/query_expressions.fbs";
include "./blueprint/datatypes/space_view_component.fbs";

include "./blueprint/components/auto_layout.fbs";
include "./blueprint/components/auto_space_views.fbs";
include "./blueprint/components/entities_determined_by_user.fbs";
include "./blueprint/components/entity_properties_component.fbs";
include "./blueprint/components/name.fbs";
include "./blueprint/components/panel_view.fbs";
include "./blueprint/components/query_expressions.fbs";
include "./blueprint/components/space_view_component.fbs";
include "./blueprint/components/space_view_maximized.fbs";
include "./blueprint/components/space_view_origin.fbs";
include "./blueprint/components/space_view_class.fbs";
include "./blueprint/components/included_space_views.fbs";
include "./blueprint/components/included_queries.fbs";
include "./blueprint/components/viewport_layout.fbs";

include "./blueprint/archetypes/space_view_blueprint.fbs";
include "./blueprint/archetypes/viewport_blueprint.fbs";
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include "fbs/attributes.fbs";
include "rust/attributes.fbs";

include "rerun/datatypes.fbs";

namespace rerun.blueprint.archetypes;

// ---

/// The top-level description of the Viewport.
table SpaceViewBlueprint (
"attr.docs.unreleased",
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "Default"
) {
// --- Required ---

/// The class of the view.
class_identifier: rerun.blueprint.components.SpaceViewClass ("attr.rerun.component_required", order: 100);

// --- Optional ---

/// The name of the view.
display_name: rerun.blueprint.components.Name ("attr.rerun.component_optional", nullable, order: 200);

/// The "anchor point" of this space view.
///
/// The transform at this path forms the reference point for all scene->world transforms in this space view.
/// I.e. the position of this entity path in space forms the origin of the coordinate system in this space view.
/// Furthermore, this is the primary indicator for heuristics on what entities we show in this space view.
space_origin: rerun.blueprint.components.SpaceViewOrigin ("attr.rerun.component_optional", nullable, order: 300);

/// True if the user is has added entities themselves. False otherwise.
entities_determined_by_user: rerun.blueprint.components.EntitiesDeterminedByUser ("attr.rerun.component_optional", nullable, order: 400);

/// `BlueprintId`s of the `DataQuery`s that make up this `SpaceView`.
///
/// It determines which entities are part of the spaceview.
contents: rerun.blueprint.components.IncludedQueries ("attr.rerun.component_optional", nullable, order: 500);
}
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 the space view entities were manually edited.
table EntitiesDeterminedByUser (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: bool (order: 100);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
include "arrow/attributes.fbs";
include "docs/attributes.fbs";
include "python/attributes.fbs";
include "rust/attributes.fbs";

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

namespace rerun.blueprint.components;

// ---

/// A view of a space.

/// All the queries belonging to a given `SpaceView`.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table SpaceViewComponent (
table IncludedQueries (
"attr.docs.unreleased",
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive_only": "Clone"
"attr.rust.derive": "Default",
"attr.rust.repr": "transparent"
) {
component: rerun.blueprint.datatypes.SpaceViewComponent (order: 100);
query_ids: [rerun.datatypes.Uuid] (order: 100);
}
20 changes: 20 additions & 0 deletions crates/re_types/definitions/rerun/blueprint/components/name.fbs
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;

// ---

/// The name of a blueprint entity.
table Name (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: string (order: 100);
}
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;

// ---

/// The class of a `SpaceView`.
table SpaceViewClass (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "Default, PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: string (order: 100);
}
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;

// ---

/// The origin of a `SpaceView`.
table SpaceViewOrigin (
"attr.rerun.scope": "blueprint",
"attr.docs.unreleased",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord",
"attr.rust.repr": "transparent"
) {
value: rerun.datatypes.EntityPath (order: 100);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace rerun.datatypes;
table EntityPath (
"attr.arrow.transparent",
"attr.docs.unreleased",
"attr.rust.derive": "Default",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default",
"attr.rust.repr": "transparent",
"attr.rust.tuple_struct",
"attr.rust.override_crate": "re_types_core"
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/src/blueprint/archetypes/.gitattributes

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

4 changes: 2 additions & 2 deletions crates/re_types/src/blueprint/archetypes/mod.rs

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

Loading

0 comments on commit 6658d95

Please sign in to comment.