diff --git a/crates/re_query/src/latest_at/to_archetype/.gitattributes b/crates/re_query/src/latest_at/to_archetype/.gitattributes index dbd97e14fb15b..bd2e8c8bd9124 100644 --- a/crates/re_query/src/latest_at/to_archetype/.gitattributes +++ b/crates/re_query/src/latest_at/to_archetype/.gitattributes @@ -36,5 +36,5 @@ text_log.rs linguist-generated=true transform3d.rs linguist-generated=true view_coordinates.rs linguist-generated=true viewport_blueprint.rs linguist-generated=true -visible_time_range.rs linguist-generated=true +visible_time_ranges.rs linguist-generated=true visual_bounds.rs linguist-generated=true diff --git a/crates/re_query/src/latest_at/to_archetype/mod.rs b/crates/re_query/src/latest_at/to_archetype/mod.rs index bedfffd12055e..dbf5e55a975a0 100644 --- a/crates/re_query/src/latest_at/to_archetype/mod.rs +++ b/crates/re_query/src/latest_at/to_archetype/mod.rs @@ -34,5 +34,5 @@ mod text_log; mod transform3d; mod view_coordinates; mod viewport_blueprint; -mod visible_time_range; +mod visible_time_ranges; mod visual_bounds; diff --git a/crates/re_query/src/latest_at/to_archetype/visible_time_range.rs b/crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs similarity index 92% rename from crates/re_query/src/latest_at/to_archetype/visible_time_range.rs rename to crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs index dc6a90751404d..fad43a183504e 100644 --- a/crates/re_query/src/latest_at/to_archetype/visible_time_range.rs +++ b/crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs @@ -9,13 +9,13 @@ use crate::{LatestAtResults, PromiseResolver, PromiseResult}; use re_types_core::{Archetype, Loggable as _}; use std::sync::Arc; -impl crate::ToArchetype for LatestAtResults { +impl crate::ToArchetype for LatestAtResults { #[inline] fn to_archetype( &self, resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); + ) -> PromiseResult> { + re_tracing::profile_function!(::name()); // --- Required --- @@ -37,7 +37,7 @@ impl crate::ToArchetype for L // --- - let arch = re_types::blueprint::archetypes::VisibleTimeRange { ranges }; + let arch = re_types::blueprint::archetypes::VisibleTimeRanges { ranges }; PromiseResult::Ready(Ok(arch)) } diff --git a/crates/re_space_view/src/space_view.rs b/crates/re_space_view/src/space_view.rs index 11b3357abbe8e..98f90ac87d584 100644 --- a/crates/re_space_view/src/space_view.rs +++ b/crates/re_space_view/src/space_view.rs @@ -429,7 +429,7 @@ impl SpaceViewBlueprint { // * can't be specified in the data store // Here, we query the visual time range that serves as the default for all entities in this space. let (visible_time_range_archetype, _) = crate::query_view_property::< - blueprint_archetypes::VisibleTimeRange, + blueprint_archetypes::VisibleTimeRanges, >(self.id, blueprint, blueprint_query); let visible_time_range_archetype = visible_time_range_archetype.ok().flatten(); diff --git a/crates/re_space_view/src/space_view_contents.rs b/crates/re_space_view/src/space_view_contents.rs index e316015e81b17..c6c1a450a7940 100644 --- a/crates/re_space_view/src/space_view_contents.rs +++ b/crates/re_space_view/src/space_view_contents.rs @@ -557,7 +557,7 @@ impl DataQueryPropertyResolver<'_> { // Figure out relevant visual time range. let visible_time_range_archetype = blueprint - .latest_at_archetype::( + .latest_at_archetype::( &recursive_override_path, blueprint_query, ) diff --git a/crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs b/crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs index 7526a95231372..90069b9b51e21 100644 --- a/crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs +++ b/crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs @@ -9,18 +9,10 @@ namespace rerun.blueprint.archetypes; // --- -/// Configures what range of the timeline is shown on a view. +/// Configures what range of each timeline is shown on a view. /// -/// Whenever no visual time range applies, queries are done with "latest at" semantics. -/// This means that the view will, starting from the time cursor position, -/// query the latest data available for each component type. -/// -/// The default visual time range depends on the type of view this property applies to: -/// - For time series views, the default is to show the entire timeline. -/// - For any other view, the default is to apply latest-at semantics. -/// -/// The visual time range can be overridden also individually per entity. -table VisibleTimeRange ( +/// Refer to [`VisibleTimeRange`] component for more information. +table VisibleTimeRanges ( "attr.rerun.scope": "blueprint", "attr.rust.derive": "Default" ) { diff --git a/crates/re_types/definitions/rerun/blueprint/components/visible_time_range.fbs b/crates/re_types/definitions/rerun/blueprint/components/visible_time_range.fbs index f0d0e2ef3f966..5be623d061501 100644 --- a/crates/re_types/definitions/rerun/blueprint/components/visible_time_range.fbs +++ b/crates/re_types/definitions/rerun/blueprint/components/visible_time_range.fbs @@ -10,6 +10,16 @@ namespace rerun.blueprint.components; // --- /// The range of values on a given timeline that will be included in a view's query. +/// +/// Whenever no visual time range applies, queries are done with "latest at" semantics. +/// This means that the view will, starting from the time cursor position, +/// query the latest data available for each component type. +/// +/// The default visual time range depends on the type of view this property applies to: +/// - For time series views, the default is to show the entire timeline. +/// - For any other view, the default is to apply latest-at semantics. +/// +/// The visual time range(s) can be overridden also individually per entity. table VisibleTimeRange ( "attr.arrow.transparent", "attr.rerun.scope": "blueprint", diff --git a/crates/re_types/definitions/rerun/blueprint/views/spatial2d.fbs b/crates/re_types/definitions/rerun/blueprint/views/spatial2d.fbs index 1b76155252c63..9f0aaf7da4790 100644 --- a/crates/re_types/definitions/rerun/blueprint/views/spatial2d.fbs +++ b/crates/re_types/definitions/rerun/blueprint/views/spatial2d.fbs @@ -15,7 +15,7 @@ table Spatial2DView ( /// Somethings outside of these bounds may also be visible due to letterboxing. visual_bounds: rerun.blueprint.archetypes.VisualBounds (order: 2000); - /// Configures the range on the timeline shown by this view (unless specified differently per entity). - time_range: rerun.blueprint.archetypes.VisibleTimeRange (order: 10000); + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + time_ranges: rerun.blueprint.archetypes.VisibleTimeRanges (order: 10000); } diff --git a/crates/re_types/definitions/rerun/blueprint/views/spatial3d.fbs b/crates/re_types/definitions/rerun/blueprint/views/spatial3d.fbs index 27727f729b198..a95f9516928ce 100644 --- a/crates/re_types/definitions/rerun/blueprint/views/spatial3d.fbs +++ b/crates/re_types/definitions/rerun/blueprint/views/spatial3d.fbs @@ -11,6 +11,6 @@ table Spatial3DView ( /// Configuration for the background of the space view. background: rerun.blueprint.archetypes.Background (order: 1000); - /// Configures the range on the timeline shown by this view (unless specified differently per entity). - time_range: rerun.blueprint.archetypes.VisibleTimeRange (order: 2000); + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + time_ranges: rerun.blueprint.archetypes.VisibleTimeRanges (order: 10000); } diff --git a/crates/re_types/definitions/rerun/blueprint/views/time_series.fbs b/crates/re_types/definitions/rerun/blueprint/views/time_series.fbs index 802aa9e7c399e..4c8eca773e9bd 100644 --- a/crates/re_types/definitions/rerun/blueprint/views/time_series.fbs +++ b/crates/re_types/definitions/rerun/blueprint/views/time_series.fbs @@ -12,6 +12,6 @@ table TimeSeriesView ( /// Configures the legend of the plot. plot_legend: rerun.blueprint.archetypes.PlotLegend (order: 2000); - /// Configures the time range the plot covers (unless specified differently per entity). - time_range: rerun.blueprint.archetypes.VisibleTimeRange (order: 3000); + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + time_ranges: rerun.blueprint.archetypes.VisibleTimeRanges (order: 10000); } diff --git a/crates/re_types/src/blueprint/archetypes/.gitattributes b/crates/re_types/src/blueprint/archetypes/.gitattributes index 68aaa951e26e6..9349a1b6395ca 100644 --- a/crates/re_types/src/blueprint/archetypes/.gitattributes +++ b/crates/re_types/src/blueprint/archetypes/.gitattributes @@ -7,5 +7,5 @@ plot_legend.rs linguist-generated=true scalar_axis.rs linguist-generated=true space_view_blueprint.rs linguist-generated=true space_view_contents.rs linguist-generated=true -visible_time_range.rs linguist-generated=true +visible_time_ranges.rs linguist-generated=true visual_bounds.rs linguist-generated=true diff --git a/crates/re_types/src/blueprint/archetypes/mod.rs b/crates/re_types/src/blueprint/archetypes/mod.rs index 54edcb1af6a41..d6f30bda8fee1 100644 --- a/crates/re_types/src/blueprint/archetypes/mod.rs +++ b/crates/re_types/src/blueprint/archetypes/mod.rs @@ -6,8 +6,8 @@ mod plot_legend; mod scalar_axis; mod space_view_blueprint; mod space_view_contents; -mod visible_time_range; -mod visible_time_range_ext; +mod visible_time_ranges; +mod visible_time_ranges_ext; mod visual_bounds; pub use self::background::Background; @@ -15,5 +15,5 @@ pub use self::plot_legend::PlotLegend; pub use self::scalar_axis::ScalarAxis; pub use self::space_view_blueprint::SpaceViewBlueprint; pub use self::space_view_contents::SpaceViewContents; -pub use self::visible_time_range::VisibleTimeRange; +pub use self::visible_time_ranges::VisibleTimeRanges; pub use self::visual_bounds::VisualBounds; diff --git a/crates/re_types/src/blueprint/archetypes/visible_time_range.rs b/crates/re_types/src/blueprint/archetypes/visible_time_ranges.rs similarity index 76% rename from crates/re_types/src/blueprint/archetypes/visible_time_range.rs rename to crates/re_types/src/blueprint/archetypes/visible_time_ranges.rs index 00d514db5978f..917a3a565eb81 100644 --- a/crates/re_types/src/blueprint/archetypes/visible_time_range.rs +++ b/crates/re_types/src/blueprint/archetypes/visible_time_ranges.rs @@ -22,24 +22,16 @@ use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, MaybeOwnedComponentBatch}; use ::re_types_core::{DeserializationError, DeserializationResult}; -/// **Archetype**: Configures what range of the timeline is shown on a view. +/// **Archetype**: Configures what range of each timeline is shown on a view. /// -/// Whenever no visual time range applies, queries are done with "latest at" semantics. -/// This means that the view will, starting from the time cursor position, -/// query the latest data available for each component type. -/// -/// The default visual time range depends on the type of view this property applies to: -/// - For time series views, the default is to show the entire timeline. -/// - For any other view, the default is to apply latest-at semantics. -/// -/// The visual time range can be overridden also individually per entity. +/// Refer to [`VisibleTimeRange`] component for more information. #[derive(Clone, Debug, Default)] -pub struct VisibleTimeRange { +pub struct VisibleTimeRanges { /// The ranges of time to show for all given timelines based on sequence numbers. pub ranges: Vec, } -impl ::re_types_core::SizeBytes for VisibleTimeRange { +impl ::re_types_core::SizeBytes for VisibleTimeRanges { #[inline] fn heap_size_bytes(&self) -> u64 { self.ranges.heap_size_bytes() @@ -55,7 +47,7 @@ static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.blueprint.components.VisibleTimeRange".into()]); static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 1usize]> = - once_cell::sync::Lazy::new(|| ["rerun.blueprint.components.VisibleTimeRangeIndicator".into()]); + once_cell::sync::Lazy::new(|| ["rerun.blueprint.components.VisibleTimeRangesIndicator".into()]); static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 0usize]> = once_cell::sync::Lazy::new(|| []); @@ -64,29 +56,29 @@ static ALL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.blueprint.components.VisibleTimeRange".into(), - "rerun.blueprint.components.VisibleTimeRangeIndicator".into(), + "rerun.blueprint.components.VisibleTimeRangesIndicator".into(), ] }); -impl VisibleTimeRange { +impl VisibleTimeRanges { /// The total number of components in the archetype: 1 required, 1 recommended, 0 optional pub const NUM_COMPONENTS: usize = 2usize; } -/// Indicator component for the [`VisibleTimeRange`] [`::re_types_core::Archetype`] -pub type VisibleTimeRangeIndicator = ::re_types_core::GenericIndicatorComponent; +/// Indicator component for the [`VisibleTimeRanges`] [`::re_types_core::Archetype`] +pub type VisibleTimeRangesIndicator = ::re_types_core::GenericIndicatorComponent; -impl ::re_types_core::Archetype for VisibleTimeRange { - type Indicator = VisibleTimeRangeIndicator; +impl ::re_types_core::Archetype for VisibleTimeRanges { + type Indicator = VisibleTimeRangesIndicator; #[inline] fn name() -> ::re_types_core::ArchetypeName { - "rerun.blueprint.archetypes.VisibleTimeRange".into() + "rerun.blueprint.archetypes.VisibleTimeRanges".into() } #[inline] fn indicator() -> MaybeOwnedComponentBatch<'static> { - static INDICATOR: VisibleTimeRangeIndicator = VisibleTimeRangeIndicator::DEFAULT; + static INDICATOR: VisibleTimeRangesIndicator = VisibleTimeRangesIndicator::DEFAULT; MaybeOwnedComponentBatch::Ref(&INDICATOR) } @@ -124,19 +116,19 @@ impl ::re_types_core::Archetype for VisibleTimeRange { let array = arrays_by_name .get("rerun.blueprint.components.VisibleTimeRange") .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.blueprint.archetypes.VisibleTimeRange#ranges")?; + .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")?; ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.VisibleTimeRange#ranges")? + .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) .collect::>>() - .with_context("rerun.blueprint.archetypes.VisibleTimeRange#ranges")? + .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")? }; Ok(Self { ranges }) } } -impl ::re_types_core::AsComponents for VisibleTimeRange { +impl ::re_types_core::AsComponents for VisibleTimeRanges { fn as_component_batches(&self) -> Vec> { re_tracing::profile_function!(); use ::re_types_core::Archetype as _; @@ -150,8 +142,8 @@ impl ::re_types_core::AsComponents for VisibleTimeRange { } } -impl VisibleTimeRange { - /// Create a new `VisibleTimeRange`. +impl VisibleTimeRanges { + /// Create a new `VisibleTimeRanges`. #[inline] pub fn new( ranges: impl IntoIterator>, diff --git a/crates/re_types/src/blueprint/archetypes/visible_time_range_ext.rs b/crates/re_types/src/blueprint/archetypes/visible_time_ranges_ext.rs similarity index 95% rename from crates/re_types/src/blueprint/archetypes/visible_time_range_ext.rs rename to crates/re_types/src/blueprint/archetypes/visible_time_ranges_ext.rs index b5c0c533c482c..19952a4fe42db 100644 --- a/crates/re_types/src/blueprint/archetypes/visible_time_range_ext.rs +++ b/crates/re_types/src/blueprint/archetypes/visible_time_ranges_ext.rs @@ -1,8 +1,8 @@ use re_types_core::datatypes::TimeRange; -use super::VisibleTimeRange; +use super::VisibleTimeRanges; -impl VisibleTimeRange { +impl VisibleTimeRanges { /// Retrieves the time range for a given timeline. pub fn range_for_timeline(&self, timeline_name: &str) -> Option<&'_ TimeRange> { self.ranges diff --git a/crates/re_types/src/blueprint/components/visible_time_range.rs b/crates/re_types/src/blueprint/components/visible_time_range.rs index 8d0728b80db43..87c50d12b476a 100644 --- a/crates/re_types/src/blueprint/components/visible_time_range.rs +++ b/crates/re_types/src/blueprint/components/visible_time_range.rs @@ -23,6 +23,16 @@ use ::re_types_core::{ComponentBatch, MaybeOwnedComponentBatch}; use ::re_types_core::{DeserializationError, DeserializationResult}; /// **Component**: The range of values on a given timeline that will be included in a view's query. +/// +/// Whenever no visual time range applies, queries are done with "latest at" semantics. +/// This means that the view will, starting from the time cursor position, +/// query the latest data available for each component type. +/// +/// The default visual time range depends on the type of view this property applies to: +/// - For time series views, the default is to show the entire timeline. +/// - For any other view, the default is to apply latest-at semantics. +/// +/// The visual time range(s) can be overridden also individually per entity. #[derive(Clone, Debug, PartialEq, Eq)] #[repr(transparent)] pub struct VisibleTimeRange(pub crate::datatypes::VisibleTimeRange); diff --git a/crates/re_types/src/blueprint/views/spatial2d_view.rs b/crates/re_types/src/blueprint/views/spatial2d_view.rs index 75b6e96f4b368..2f93f350af83c 100644 --- a/crates/re_types/src/blueprint/views/spatial2d_view.rs +++ b/crates/re_types/src/blueprint/views/spatial2d_view.rs @@ -34,8 +34,8 @@ pub struct Spatial2DView { /// Somethings outside of these bounds may also be visible due to letterboxing. pub visual_bounds: crate::blueprint::archetypes::VisualBounds, - /// Configures the range on the timeline shown by this view (unless specified differently per entity). - pub time_range: crate::blueprint::archetypes::VisibleTimeRange, + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + pub time_ranges: crate::blueprint::archetypes::VisibleTimeRanges, } impl ::re_types_core::SizeBytes for Spatial2DView { @@ -43,14 +43,14 @@ impl ::re_types_core::SizeBytes for Spatial2DView { fn heap_size_bytes(&self) -> u64 { self.background.heap_size_bytes() + self.visual_bounds.heap_size_bytes() - + self.time_range.heap_size_bytes() + + self.time_ranges.heap_size_bytes() } #[inline] fn is_pod() -> bool { ::is_pod() && ::is_pod() - && ::is_pod() + && ::is_pod() } } diff --git a/crates/re_types/src/blueprint/views/spatial3d_view.rs b/crates/re_types/src/blueprint/views/spatial3d_view.rs index 4311b60d514d6..61cf8d48d8371 100644 --- a/crates/re_types/src/blueprint/views/spatial3d_view.rs +++ b/crates/re_types/src/blueprint/views/spatial3d_view.rs @@ -28,20 +28,20 @@ pub struct Spatial3DView { /// Configuration for the background of the space view. pub background: crate::blueprint::archetypes::Background, - /// Configures the range on the timeline shown by this view (unless specified differently per entity). - pub time_range: crate::blueprint::archetypes::VisibleTimeRange, + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + pub time_ranges: crate::blueprint::archetypes::VisibleTimeRanges, } impl ::re_types_core::SizeBytes for Spatial3DView { #[inline] fn heap_size_bytes(&self) -> u64 { - self.background.heap_size_bytes() + self.time_range.heap_size_bytes() + self.background.heap_size_bytes() + self.time_ranges.heap_size_bytes() } #[inline] fn is_pod() -> bool { ::is_pod() - && ::is_pod() + && ::is_pod() } } diff --git a/crates/re_types/src/blueprint/views/time_series_view.rs b/crates/re_types/src/blueprint/views/time_series_view.rs index dd90930c629fb..7336a160217c5 100644 --- a/crates/re_types/src/blueprint/views/time_series_view.rs +++ b/crates/re_types/src/blueprint/views/time_series_view.rs @@ -31,8 +31,8 @@ pub struct TimeSeriesView { /// Configures the legend of the plot. pub plot_legend: crate::blueprint::archetypes::PlotLegend, - /// Configures the time range the plot covers (unless specified differently per entity). - pub time_range: crate::blueprint::archetypes::VisibleTimeRange, + /// Configures which range on each timeline is shown by this view (unless specified differently per entity). + pub time_ranges: crate::blueprint::archetypes::VisibleTimeRanges, } impl ::re_types_core::SizeBytes for TimeSeriesView { @@ -40,14 +40,14 @@ impl ::re_types_core::SizeBytes for TimeSeriesView { fn heap_size_bytes(&self) -> u64 { self.axis_y.heap_size_bytes() + self.plot_legend.heap_size_bytes() - + self.time_range.heap_size_bytes() + + self.time_ranges.heap_size_bytes() } #[inline] fn is_pod() -> bool { ::is_pod() && ::is_pod() - && ::is_pod() + && ::is_pod() } } diff --git a/crates/re_viewer/src/ui/query_range_ui.rs b/crates/re_viewer/src/ui/query_range_ui.rs index d145401d22d5d..efe28c89d47f8 100644 --- a/crates/re_viewer/src/ui/query_range_ui.rs +++ b/crates/re_viewer/src/ui/query_range_ui.rs @@ -44,7 +44,7 @@ pub fn query_range_ui_space_view( } let property_path = entity_path_for_view_property::< - re_types::blueprint::archetypes::VisibleTimeRange, + re_types::blueprint::archetypes::VisibleTimeRanges, >(space_view.id, ctx.store_context.blueprint.tree()); let query_range = space_view.query_range( @@ -88,7 +88,7 @@ fn visible_time_range_ui( let visible_time_ranges = ctx .store_context .blueprint - .latest_at_archetype::( + .latest_at_archetype::( time_range_override_path, ctx.blueprint_query, ) @@ -132,7 +132,7 @@ fn save_visible_time_ranges( has_individual_range: bool, query_range: QueryRange, property_path: EntityPath, - mut visible_time_ranges: re_types::blueprint::archetypes::VisibleTimeRange, + mut visible_time_ranges: re_types::blueprint::archetypes::VisibleTimeRanges, ) { if has_individual_range { let time_range = match query_range { diff --git a/docs/content/reference/types/views/spatial2d_view.md b/docs/content/reference/types/views/spatial2d_view.md index c08a732621fd1..854cc9595453d 100644 --- a/docs/content/reference/types/views/spatial2d_view.md +++ b/docs/content/reference/types/views/spatial2d_view.md @@ -15,18 +15,10 @@ Configuration for the background of a view. Controls the visual bounds of a 2D space view. * range2d: The visible parts of a 2D space view, in the coordinate space of the scene. -### `VisibleTimeRange` -Configures what range of the timeline is shown on a view. +### `VisibleTimeRanges` +Configures what range of each timeline is shown on a view. -Whenever no visual time range applies, queries are done with "latest at" semantics. -This means that the view will, starting from the time cursor position, -query the latest data available for each component type. - -The default visual time range depends on the type of view this property applies to: -- For time series views, the default is to show the entire timeline. -- For any other view, the default is to apply latest-at semantics. - -The visual time range can be overridden also individually per entity. +Refer to [`VisibleTimeRange`] component for more information. * ranges: The ranges of time to show for all given timelines based on sequence numbers. diff --git a/docs/content/reference/types/views/spatial3d_view.md b/docs/content/reference/types/views/spatial3d_view.md index 99bf2153c105c..b8acc9c9a2e01 100644 --- a/docs/content/reference/types/views/spatial3d_view.md +++ b/docs/content/reference/types/views/spatial3d_view.md @@ -11,18 +11,10 @@ Configuration for the background of a view. * kind: The type of the background. Defaults to BackgroundKind.GradientDark. * color: Color used for BackgroundKind.SolidColor. -### `VisibleTimeRange` -Configures what range of the timeline is shown on a view. +### `VisibleTimeRanges` +Configures what range of each timeline is shown on a view. -Whenever no visual time range applies, queries are done with "latest at" semantics. -This means that the view will, starting from the time cursor position, -query the latest data available for each component type. - -The default visual time range depends on the type of view this property applies to: -- For time series views, the default is to show the entire timeline. -- For any other view, the default is to apply latest-at semantics. - -The visual time range can be overridden also individually per entity. +Refer to [`VisibleTimeRange`] component for more information. * ranges: The ranges of time to show for all given timelines based on sequence numbers. diff --git a/docs/content/reference/types/views/time_series_view.md b/docs/content/reference/types/views/time_series_view.md index 1bf560fbba656..09436f5040e56 100644 --- a/docs/content/reference/types/views/time_series_view.md +++ b/docs/content/reference/types/views/time_series_view.md @@ -16,18 +16,10 @@ Configuration for the legend of a plot. * corner: To what corner the legend is aligned. * visible: Whether the legend is shown at all. -### `VisibleTimeRange` -Configures what range of the timeline is shown on a view. +### `VisibleTimeRanges` +Configures what range of each timeline is shown on a view. -Whenever no visual time range applies, queries are done with "latest at" semantics. -This means that the view will, starting from the time cursor position, -query the latest data available for each component type. - -The default visual time range depends on the type of view this property applies to: -- For time series views, the default is to show the entire timeline. -- For any other view, the default is to apply latest-at semantics. - -The visual time range can be overridden also individually per entity. +Refer to [`VisibleTimeRange`] component for more information. * ranges: The ranges of time to show for all given timelines based on sequence numbers. diff --git a/rerun_cpp/src/rerun/blueprint/archetypes.hpp b/rerun_cpp/src/rerun/blueprint/archetypes.hpp index c3f26abe31850..2f11a6bd23a9f 100644 --- a/rerun_cpp/src/rerun/blueprint/archetypes.hpp +++ b/rerun_cpp/src/rerun/blueprint/archetypes.hpp @@ -10,5 +10,5 @@ #include "blueprint/archetypes/space_view_blueprint.hpp" #include "blueprint/archetypes/space_view_contents.hpp" #include "blueprint/archetypes/viewport_blueprint.hpp" -#include "blueprint/archetypes/visible_time_range.hpp" +#include "blueprint/archetypes/visible_time_ranges.hpp" #include "blueprint/archetypes/visual_bounds.hpp" diff --git a/rerun_cpp/src/rerun/blueprint/archetypes/.gitattributes b/rerun_cpp/src/rerun/blueprint/archetypes/.gitattributes index a6bc694440b23..074e39be8ce0f 100644 --- a/rerun_cpp/src/rerun/blueprint/archetypes/.gitattributes +++ b/rerun_cpp/src/rerun/blueprint/archetypes/.gitattributes @@ -17,7 +17,7 @@ space_view_contents.cpp linguist-generated=true space_view_contents.hpp linguist-generated=true viewport_blueprint.cpp linguist-generated=true viewport_blueprint.hpp linguist-generated=true -visible_time_range.cpp linguist-generated=true -visible_time_range.hpp linguist-generated=true +visible_time_ranges.cpp linguist-generated=true +visible_time_ranges.hpp linguist-generated=true visual_bounds.cpp linguist-generated=true visual_bounds.hpp linguist-generated=true diff --git a/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.cpp b/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.cpp similarity index 81% rename from rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.cpp rename to rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.cpp index 8acb09de078a7..25df2fdfe9d07 100644 --- a/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.cpp +++ b/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.cpp @@ -1,7 +1,7 @@ // DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs // Based on "crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs". -#include "visible_time_range.hpp" +#include "visible_time_ranges.hpp" #include "../../collection_adapter_builtins.hpp" @@ -9,8 +9,8 @@ namespace rerun::blueprint::archetypes {} namespace rerun { - Result> AsComponents::serialize( - const blueprint::archetypes::VisibleTimeRange& archetype + Result> AsComponents::serialize( + const blueprint::archetypes::VisibleTimeRanges& archetype ) { using namespace blueprint::archetypes; std::vector cells; @@ -22,7 +22,7 @@ namespace rerun { cells.push_back(std::move(result.value)); } { - auto indicator = VisibleTimeRange::IndicatorComponent(); + auto indicator = VisibleTimeRanges::IndicatorComponent(); auto result = DataCell::from_loggable(indicator); RR_RETURN_NOT_OK(result.error); cells.emplace_back(std::move(result.value)); diff --git a/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.hpp b/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.hpp similarity index 55% rename from rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.hpp rename to rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.hpp index 24985e5048304..159631fe0952e 100644 --- a/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_range.hpp +++ b/rerun_cpp/src/rerun/blueprint/archetypes/visible_time_ranges.hpp @@ -14,33 +14,26 @@ #include namespace rerun::blueprint::archetypes { - /// **Archetype**: Configures what range of the timeline is shown on a view. + /// **Archetype**: Configures what range of each timeline is shown on a view. /// - /// Whenever no visual time range applies, queries are done with "latest at" semantics. - /// This means that the view will, starting from the time cursor position, - /// query the latest data available for each component type. - /// - /// The default visual time range depends on the type of view this property applies to: - /// - For time series views, the default is to show the entire timeline. - /// - For any other view, the default is to apply latest-at semantics. - /// - /// The visual time range can be overridden also individually per entity. - struct VisibleTimeRange { + /// Refer to [`VisibleTimeRange`] component for more information. + struct VisibleTimeRanges { /// The ranges of time to show for all given timelines based on sequence numbers. Collection ranges; public: static constexpr const char IndicatorComponentName[] = - "rerun.blueprint.components.VisibleTimeRangeIndicator"; + "rerun.blueprint.components.VisibleTimeRangesIndicator"; /// Indicator component, used to identify the archetype when converting to a list of components. using IndicatorComponent = rerun::components::IndicatorComponent; public: - VisibleTimeRange() = default; - VisibleTimeRange(VisibleTimeRange&& other) = default; + VisibleTimeRanges() = default; + VisibleTimeRanges(VisibleTimeRanges&& other) = default; - explicit VisibleTimeRange(Collection _ranges + explicit VisibleTimeRanges( + Collection _ranges ) : ranges(std::move(_ranges)) {} }; @@ -54,10 +47,10 @@ namespace rerun { /// \private template <> - struct AsComponents { + struct AsComponents { /// Serialize all set component batches. static Result> serialize( - const blueprint::archetypes::VisibleTimeRange& archetype + const blueprint::archetypes::VisibleTimeRanges& archetype ); }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp b/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp index 092353f4cadc1..5cef3b7dcf5e1 100644 --- a/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp @@ -12,6 +12,16 @@ namespace rerun::blueprint::components { /// **Component**: The range of values on a given timeline that will be included in a view's query. + /// + /// Whenever no visual time range applies, queries are done with "latest at" semantics. + /// This means that the view will, starting from the time cursor position, + /// query the latest data available for each component type. + /// + /// The default visual time range depends on the type of view this property applies to: + /// - For time series views, the default is to show the entire timeline. + /// - For any other view, the default is to apply latest-at semantics. + /// + /// The visual time range(s) can be overridden also individually per entity. struct VisibleTimeRange { rerun::datatypes::VisibleTimeRange value; diff --git a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/.gitattributes b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/.gitattributes index d5870692f0616..3b8b39e5ad8f1 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/.gitattributes +++ b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/.gitattributes @@ -10,5 +10,5 @@ scalar_axis.py linguist-generated=true space_view_blueprint.py linguist-generated=true space_view_contents.py linguist-generated=true viewport_blueprint.py linguist-generated=true -visible_time_range.py linguist-generated=true +visible_time_ranges.py linguist-generated=true visual_bounds.py linguist-generated=true diff --git a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/__init__.py b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/__init__.py index 2b35827d41c80..4e2a2e25e3b7d 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/__init__.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/__init__.py @@ -10,7 +10,7 @@ from .space_view_blueprint import SpaceViewBlueprint from .space_view_contents import SpaceViewContents from .viewport_blueprint import ViewportBlueprint -from .visible_time_range import VisibleTimeRange +from .visible_time_ranges import VisibleTimeRanges from .visual_bounds import VisualBounds __all__ = [ @@ -22,6 +22,6 @@ "SpaceViewBlueprint", "SpaceViewContents", "ViewportBlueprint", - "VisibleTimeRange", + "VisibleTimeRanges", "VisualBounds", ] diff --git a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_range.py b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_ranges.py similarity index 63% rename from rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_range.py rename to rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_ranges.py index 44dd8675cc1db..559dc111a2ac1 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_range.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/archetypes/visible_time_ranges.py @@ -1,7 +1,7 @@ # DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/python/mod.rs # Based on "crates/re_types/definitions/rerun/blueprint/archetypes/visible_time_range.fbs". -# You can extend this class by creating a "VisibleTimeRangeExt" class in "visible_time_range_ext.py". +# You can extend this class by creating a "VisibleTimeRangesExt" class in "visible_time_ranges_ext.py". from __future__ import annotations @@ -14,28 +14,20 @@ from ...blueprint import components as blueprint_components from ...error_utils import catch_and_log_exceptions -__all__ = ["VisibleTimeRange"] +__all__ = ["VisibleTimeRanges"] @define(str=False, repr=False, init=False) -class VisibleTimeRange(Archetype): +class VisibleTimeRanges(Archetype): """ - **Archetype**: Configures what range of the timeline is shown on a view. + **Archetype**: Configures what range of each timeline is shown on a view. - Whenever no visual time range applies, queries are done with "latest at" semantics. - This means that the view will, starting from the time cursor position, - query the latest data available for each component type. - - The default visual time range depends on the type of view this property applies to: - - For time series views, the default is to show the entire timeline. - - For any other view, the default is to apply latest-at semantics. - - The visual time range can be overridden also individually per entity. + Refer to [`VisibleTimeRange`] component for more information. """ def __init__(self: Any, ranges: datatypes.VisibleTimeRangeArrayLike): """ - Create a new instance of the VisibleTimeRange archetype. + Create a new instance of the VisibleTimeRanges archetype. Parameters ---------- @@ -44,7 +36,7 @@ def __init__(self: Any, ranges: datatypes.VisibleTimeRangeArrayLike): """ - # You can define your own __init__ function as a member of VisibleTimeRangeExt in visible_time_range_ext.py + # You can define your own __init__ function as a member of VisibleTimeRangesExt in visible_time_ranges_ext.py with catch_and_log_exceptions(context=self.__class__.__name__): self.__attrs_init__(ranges=ranges) return @@ -57,8 +49,8 @@ def __attrs_clear__(self) -> None: ) @classmethod - def _clear(cls) -> VisibleTimeRange: - """Produce an empty VisibleTimeRange, bypassing `__init__`.""" + def _clear(cls) -> VisibleTimeRanges: + """Produce an empty VisibleTimeRanges, bypassing `__init__`.""" inst = cls.__new__(cls) inst.__attrs_clear__() return inst diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/visible_time_range.py b/rerun_py/rerun_sdk/rerun/blueprint/components/visible_time_range.py index 13c929bc83b47..965826a89984b 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/visible_time_range.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/visible_time_range.py @@ -12,7 +12,19 @@ class VisibleTimeRange(datatypes.VisibleTimeRange): - """**Component**: The range of values on a given timeline that will be included in a view's query.""" + """ + **Component**: The range of values on a given timeline that will be included in a view's query. + + Whenever no visual time range applies, queries are done with "latest at" semantics. + This means that the view will, starting from the time cursor position, + query the latest data available for each component type. + + The default visual time range depends on the type of view this property applies to: + - For time series views, the default is to show the entire timeline. + - For any other view, the default is to apply latest-at semantics. + + The visual time range(s) can be overridden also individually per entity. + """ # You can define your own __init__ function as a member of VisibleTimeRangeExt in visible_time_range_ext.py diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py index c527278b1b637..d5422559f394d 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial2d_view.py @@ -29,7 +29,7 @@ def __init__( | blueprint_components.BackgroundKindLike | None = None, visual_bounds: blueprint_archetypes.VisualBounds | None = None, - time_range: blueprint_archetypes.VisibleTimeRange | None = None, + time_ranges: blueprint_archetypes.VisibleTimeRanges | None = None, ) -> None: """ Construct a blueprint for a new Spatial2DView view. @@ -56,8 +56,8 @@ def __init__( Everything within these bounds are guaranteed to be visible. Somethings outside of these bounds may also be visible due to letterboxing. - time_range: - Configures the range on the timeline shown by this view (unless specified differently per entity). + time_ranges: + Configures which range on each timeline is shown by this view (unless specified differently per entity). """ @@ -72,10 +72,10 @@ def __init__( visual_bounds = blueprint_archetypes.VisualBounds(visual_bounds) properties["VisualBounds"] = visual_bounds - if time_range is not None: - if not isinstance(time_range, blueprint_archetypes.VisibleTimeRange): - time_range = blueprint_archetypes.VisibleTimeRange(time_range) - properties["VisibleTimeRange"] = time_range + if time_ranges is not None: + if not isinstance(time_ranges, blueprint_archetypes.VisibleTimeRanges): + time_ranges = blueprint_archetypes.VisibleTimeRanges(time_ranges) + properties["VisibleTimeRanges"] = time_ranges super().__init__( class_identifier="2D", origin=origin, contents=contents, name=name, visible=visible, properties=properties diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py index a0a2b6ed385ce..195870b4d8260 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/spatial3d_view.py @@ -60,7 +60,7 @@ def __init__( | datatypes.Rgba32Like | blueprint_components.BackgroundKindLike | None = None, - time_range: blueprint_archetypes.VisibleTimeRange | None = None, + time_ranges: blueprint_archetypes.VisibleTimeRanges | None = None, ) -> None: """ Construct a blueprint for a new Spatial3DView view. @@ -82,8 +82,8 @@ def __init__( Defaults to true if not specified. background: Configuration for the background of the space view. - time_range: - Configures the range on the timeline shown by this view (unless specified differently per entity). + time_ranges: + Configures which range on each timeline is shown by this view (unless specified differently per entity). """ @@ -93,10 +93,10 @@ def __init__( background = blueprint_archetypes.Background(background) properties["Background"] = background - if time_range is not None: - if not isinstance(time_range, blueprint_archetypes.VisibleTimeRange): - time_range = blueprint_archetypes.VisibleTimeRange(time_range) - properties["VisibleTimeRange"] = time_range + if time_ranges is not None: + if not isinstance(time_ranges, blueprint_archetypes.VisibleTimeRanges): + time_ranges = blueprint_archetypes.VisibleTimeRanges(time_ranges) + properties["VisibleTimeRanges"] = time_ranges super().__init__( class_identifier="3D", origin=origin, contents=contents, name=name, visible=visible, properties=properties diff --git a/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py b/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py index a741f8d676709..957154ba50da2 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/views/time_series_view.py @@ -25,7 +25,7 @@ def __init__( visible: blueprint_components.VisibleLike | None = None, axis_y: blueprint_archetypes.ScalarAxis | None = None, plot_legend: blueprint_archetypes.PlotLegend | blueprint_components.Corner2D | None = None, - time_range: blueprint_archetypes.VisibleTimeRange | None = None, + time_ranges: blueprint_archetypes.VisibleTimeRanges | None = None, ) -> None: """ Construct a blueprint for a new TimeSeriesView view. @@ -49,8 +49,8 @@ def __init__( Configures the vertical axis of the plot. plot_legend: Configures the legend of the plot. - time_range: - Configures the time range the plot covers (unless specified differently per entity). + time_ranges: + Configures which range on each timeline is shown by this view (unless specified differently per entity). """ @@ -65,10 +65,10 @@ def __init__( plot_legend = blueprint_archetypes.PlotLegend(plot_legend) properties["PlotLegend"] = plot_legend - if time_range is not None: - if not isinstance(time_range, blueprint_archetypes.VisibleTimeRange): - time_range = blueprint_archetypes.VisibleTimeRange(time_range) - properties["VisibleTimeRange"] = time_range + if time_ranges is not None: + if not isinstance(time_ranges, blueprint_archetypes.VisibleTimeRanges): + time_ranges = blueprint_archetypes.VisibleTimeRanges(time_ranges) + properties["VisibleTimeRanges"] = time_ranges super().__init__( class_identifier="TimeSeries",