-
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 new blueprint archetype for AxisY configuration in a plot. (
#5028) ### What Part of * #4818 Introduce a new archetype for AxisY configuration in a plot. This contains 2 new components: - Range: defines a min / max value for the y-axis of the plot. - LockRangeDuringZoom: a boolean indicating whether the range should be locked during zoom In "LockRange" mode, the Y-axis of the plot will always be locked to the defined range, regardless of whether the range is Auto or a specified range. In the default mode, the user can zoom arbitrarily in a way that preserves the aspect ratio of the data. When the user **resets** the view, it will return to the defined range. ![image](https://github.com/rerun-io/rerun/assets/3312232/85778c80-295d-402b-8317-c5a4a7c7b21f) ### 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/5028/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5028/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/5028/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/5028) - [Docs preview](https://rerun.io/preview/4087df686e3211027cd6b2ae8dcc2633d8993f1b/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/4087df686e3211027cd6b2ae8dcc2633d8993f1b/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --------- Co-authored-by: Andreas Reich <[email protected]>
- Loading branch information
Showing
41 changed files
with
1,536 additions
and
6 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
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
28 changes: 28 additions & 0 deletions
28
crates/re_types/definitions/rerun/blueprint/archetypes/scalar_axis.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,28 @@ | ||
include "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/attributes.fbs"; | ||
|
||
namespace rerun.blueprint.archetypes; | ||
|
||
|
||
// --- | ||
|
||
/// Configuration for the scalar axis of a plot. | ||
table ScalarAxis ( | ||
"attr.docs.unreleased", | ||
"attr.rerun.scope": "blueprint", | ||
"attr.rust.derive": "Default" | ||
) { | ||
// --- Optional --- | ||
|
||
/// The range of the axis. | ||
/// | ||
/// If unset, the range well be automatically determined based on the queried data. | ||
range: rerun.components.Range1D ("attr.rerun.component_optional", nullable, order: 2100); | ||
|
||
/// Whether to lock the range of the axis during zoom. | ||
lock_range_during_zoom: rerun.blueprint.components.LockRangeDuringZoom ("attr.rerun.component_optional", nullable, order: 2200); | ||
} |
24 changes: 24 additions & 0 deletions
24
crates/re_types/definitions/rerun/blueprint/components/lock_range_during_zoom.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 "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/attributes.fbs"; | ||
|
||
namespace rerun.blueprint.components; | ||
|
||
// --- | ||
|
||
/// Indicate whether the range should be locked when zooming in on the data. | ||
/// | ||
/// Default is `false`, i.e. zoom will change the visualized range. | ||
struct LockRangeDuringZoom ( | ||
"attr.docs.unreleased", | ||
"attr.arrow.transparent", | ||
"attr.rerun.scope": "blueprint", | ||
"attr.rust.derive": "Copy, PartialEq, Eq", | ||
"attr.rust.repr": "transparent", | ||
"attr.rust.tuple_struct" | ||
) { | ||
lock_range: bool (order: 100); | ||
} |
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
Oops, something went wrong.