-
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.
Introduce a TimeSeries archetype and use it to control the plot legend (
#4867) ### What This is the basic pattern we expect to see for all of these view-configuration type tasks: - Add a new archetype / component - Add logic to the TimeSeries space-view-class implementation that both reads and writes the components directly from the blueprint store. This generally seems to be much easier to think about than dealing with the EntityProperties struct as this was handled previously as it's exclusively a contact between the TimeSeries archetype and the TimeSeriesSpaceView implementation. Open question: - Should we suffix all our view archetypes with something like `TimeSeriesView`? Needs #4609 to land first since I developed there before rebasing to main. Will be nice to come back and clean this up again once #3384 is done. ### 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/4867/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4867/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/4867/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 - [PR Build Summary](https://build.rerun.io/pr/4867) - [Docs preview](https://rerun.io/preview/d76ed7714f29407bc1d4a62779bfa2894a10fa90/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/d76ed7714f29407bc1d4a62779bfa2894a10fa90/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
42 changed files
with
1,353 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
24 changes: 24 additions & 0 deletions
24
crates/re_types/definitions/rerun/blueprint/archetypes/time_series.fbs
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,24 @@ | ||
include "fbs/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
|
||
namespace rerun.blueprint.archetypes; | ||
|
||
// --- | ||
|
||
/// The configuration options for a `TimeSeries` `SpaceView`. | ||
table TimeSeries ( | ||
"attr.docs.unreleased", | ||
"attr.rerun.scope": "blueprint", | ||
"attr.rust.derive": "Default" | ||
) { | ||
// --- Required --- | ||
|
||
/// Configuration information for the legend | ||
// TODO(jleibs): This should be optional, but we need at least one required component | ||
legend: rerun.blueprint.components.Legend ("attr.rerun.component_required", order: 1000); | ||
|
||
// --- Optional --- | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
crates/re_types/definitions/rerun/blueprint/components/legend.fbs
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,18 @@ | ||
include "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/attributes.fbs"; | ||
|
||
namespace rerun.blueprint.components; | ||
|
||
// --- | ||
|
||
/// Configuration for the legend of a plot. | ||
table Legend ( | ||
"attr.rerun.scope": "blueprint", | ||
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord" | ||
) { | ||
legend: rerun.blueprint.datatypes.Legend (order: 100); | ||
} |
39 changes: 39 additions & 0 deletions
39
crates/re_types/definitions/rerun/blueprint/datatypes/legend.fbs
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,39 @@ | ||
include "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/attributes.fbs"; | ||
|
||
namespace rerun.blueprint.datatypes; | ||
|
||
|
||
// TODO(#3384) | ||
/* | ||
enum LegendPosition: byte { | ||
LeftTop = 1, | ||
RightTop = 2, | ||
LeftBottom = 3, | ||
RightBottom = 4 | ||
} | ||
*/ | ||
|
||
// --- | ||
|
||
/// Configuration for the legend of a plot. | ||
table Legend ( | ||
"attr.rerun.scope": "blueprint", | ||
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord" | ||
) { | ||
/// Whether or not the legend should be displayed. | ||
visible: bool (order: 100); | ||
|
||
/// Where should the legend be located. | ||
/// | ||
/// Allowed values: | ||
/// - LeftTop = 1, | ||
/// - RightTop = 2, | ||
/// - LeftBottom = 3, | ||
/// - RightBottom = 4 | ||
location: ubyte (order: 200, nullable); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.