From 40c2a631c05afdabef6c517ba77e24dce163dd2e Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Mon, 11 Dec 2023 12:09:15 +0100 Subject: [PATCH 01/13] Initial draft for DataSpaceView --- Cargo.lock | 21 ++ Cargo.toml | 1 + crates/re_space_view_data/Cargo.toml | 33 +++ crates/re_space_view_data/README.md | 10 + crates/re_space_view_data/src/lib.rs | 8 + .../src/space_view_class.rs | 192 ++++++++++++++++++ .../src/view_part_system.rs | 38 ++++ crates/re_viewer/Cargo.toml | 1 + crates/re_viewer/src/app.rs | 1 + 9 files changed, 305 insertions(+) create mode 100644 crates/re_space_view_data/Cargo.toml create mode 100644 crates/re_space_view_data/README.md create mode 100644 crates/re_space_view_data/src/lib.rs create mode 100644 crates/re_space_view_data/src/space_view_class.rs create mode 100644 crates/re_space_view_data/src/view_part_system.rs diff --git a/Cargo.lock b/Cargo.lock index d85440b638d4..4b6dfc25186c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4810,6 +4810,26 @@ dependencies = [ "re_viewer_context", ] +[[package]] +name = "re_space_view_data" +version = "0.12.0-alpha.1+dev" +dependencies = [ + "egui", + "egui_extras", + "itertools 0.11.0", + "re_arrow_store", + "re_data_store", + "re_data_ui", + "re_log", + "re_log_types", + "re_query", + "re_renderer", + "re_tracing", + "re_types", + "re_ui", + "re_viewer_context", +] + [[package]] name = "re_space_view_spatial" version = "0.12.0-alpha.1+dev" @@ -5106,6 +5126,7 @@ dependencies = [ "re_smart_channel", "re_space_view", "re_space_view_bar_chart", + "re_space_view_data", "re_space_view_spatial", "re_space_view_tensor", "re_space_view_text_document", diff --git a/Cargo.toml b/Cargo.toml index 5635932fb8e4..4162b62cdb21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ re_sdk_comms = { path = "crates/re_sdk_comms", version = "=0.12.0-alpha.1", defa re_smart_channel = { path = "crates/re_smart_channel", version = "=0.12.0-alpha.1", default-features = false } re_space_view = { path = "crates/re_space_view", version = "=0.12.0-alpha.1", default-features = false } re_space_view_bar_chart = { path = "crates/re_space_view_bar_chart", version = "=0.12.0-alpha.1", default-features = false } +re_space_view_data = { path = "crates/re_space_view_data", version = "=0.12.0-alpha.1", default-features = false } re_space_view_spatial = { path = "crates/re_space_view_spatial", version = "=0.12.0-alpha.1", default-features = false } re_space_view_tensor = { path = "crates/re_space_view_tensor", version = "=0.12.0-alpha.1", default-features = false } re_space_view_text_log = { path = "crates/re_space_view_text_log", version = "=0.12.0-alpha.1", default-features = false } diff --git a/crates/re_space_view_data/Cargo.toml b/crates/re_space_view_data/Cargo.toml new file mode 100644 index 000000000000..1d1bf92aae8b --- /dev/null +++ b/crates/re_space_view_data/Cargo.toml @@ -0,0 +1,33 @@ +[package] +authors.workspace = true +description = "A Space View that shows the data contained in entities in a table." +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = "re_space_view_data" +publish = true +readme = "README.md" +repository.workspace = true +rust-version.workspace = true +version.workspace = true +include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"] + +[package.metadata.docs.rs] +all-features = true + +[dependencies] +re_arrow_store.workspace = true +re_data_store.workspace = true +re_data_ui.workspace = true +re_log.workspace = true +re_log_types.workspace = true +re_query.workspace = true +re_renderer.workspace = true +re_tracing.workspace = true +re_types.workspace = true +re_ui.workspace = true +re_viewer_context.workspace = true + +egui_extras.workspace = true +egui.workspace = true +itertools.workspace = true diff --git a/crates/re_space_view_data/README.md b/crates/re_space_view_data/README.md new file mode 100644 index 000000000000..6d5538a04edb --- /dev/null +++ b/crates/re_space_view_data/README.md @@ -0,0 +1,10 @@ +# re_space_view_data + +Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. + +[![Latest version](https://img.shields.io/crates/v/re_space_view_data.svg)](https://crates.io/crates/re_space_view_data) +[![Documentation](https://docs.rs/re_space_view_data/badge.svg)](https://docs.rs/re_space_view_data) +![MIT](https://img.shields.io/badge/license-MIT-blue.svg) +![Apache](https://img.shields.io/badge/license-Apache-blue.svg) + +A Space View that shows the data contained in entities in a table. diff --git a/crates/re_space_view_data/src/lib.rs b/crates/re_space_view_data/src/lib.rs new file mode 100644 index 000000000000..bffd367603cd --- /dev/null +++ b/crates/re_space_view_data/src/lib.rs @@ -0,0 +1,8 @@ +//! Rerun `Data` Space View +//! +//! A Space View that shows the data contained in entities in a table. + +mod space_view_class; +mod view_part_system; + +pub use space_view_class::DataSpaceView; diff --git a/crates/re_space_view_data/src/space_view_class.rs b/crates/re_space_view_data/src/space_view_class.rs new file mode 100644 index 000000000000..c47e191455d7 --- /dev/null +++ b/crates/re_space_view_data/src/space_view_class.rs @@ -0,0 +1,192 @@ +use crate::view_part_system::EmptySystem; +use egui_extras::Column; +use itertools::Itertools; +use re_data_store::{EntityProperties, InstancePath}; +use re_log_types::EntityPath; +use re_query::get_component_with_instances; +use re_viewer_context::{ + AutoSpawnHeuristic, PerSystemEntities, SpaceViewClass, SpaceViewClassRegistryError, + SpaceViewId, SpaceViewSystemExecutionError, UiVerbosity, ViewContextCollection, + ViewPartCollection, ViewQuery, ViewerContext, +}; + +#[derive(Default)] +pub struct DataSpaceView; + +impl SpaceViewClass for DataSpaceView { + type State = (); + + const IDENTIFIER: &'static str = "Data"; + const DISPLAY_NAME: &'static str = "Data"; + + fn icon(&self) -> &'static re_ui::Icon { + //TODO(ab): fix that icon + &re_ui::icons::SPACE_VIEW_TEXTBOX + } + + fn help_text(&self, _re_ui: &re_ui::ReUi) -> egui::WidgetText { + "Show the data contained in entities in a table.".into() + } + + fn on_register( + &self, + system_registry: &mut re_viewer_context::SpaceViewSystemRegistry, + ) -> Result<(), SpaceViewClassRegistryError> { + system_registry.register_part_system::() + } + + fn preferred_tile_aspect_ratio(&self, _state: &Self::State) -> Option { + None + } + + fn layout_priority(&self) -> re_viewer_context::SpaceViewClassLayoutPriority { + re_viewer_context::SpaceViewClassLayoutPriority::Low + } + + fn auto_spawn_heuristic( + &self, + _ctx: &ViewerContext<'_>, + _space_origin: &EntityPath, + _ent_paths: &PerSystemEntities, + ) -> re_viewer_context::AutoSpawnHeuristic { + AutoSpawnHeuristic::NeverSpawn + } + + fn selection_ui( + &self, + _ctx: &ViewerContext<'_>, + _ui: &mut egui::Ui, + _state: &mut Self::State, + _space_origin: &EntityPath, + _space_view_id: SpaceViewId, + _root_entity_properties: &mut EntityProperties, + ) { + } + + fn ui( + &self, + ctx: &ViewerContext<'_>, + ui: &mut egui::Ui, + _state: &mut Self::State, + _root_entity_properties: &EntityProperties, + _view_ctx: &ViewContextCollection, + _parts: &ViewPartCollection, + query: &ViewQuery<'_>, + _draw_data: Vec, + ) -> Result<(), SpaceViewSystemExecutionError> { + re_tracing::profile_function!(); + + let entities: Vec<_> = query + .iter_all_data_results() + .filter(|data_result| data_result.resolved_properties.visible) + .map(|data_result| &data_result.entity_path) + .unique() + .cloned() + .collect(); + + let store = ctx.store_db.store(); + let latest_at_query = query.latest_at_query(); + + // for each entity, this does the union of all instance keys of all components + let all_instances: Vec<_> = entities + .iter() + .flat_map(|entity| { + store + .all_components(&query.timeline, entity) + .unwrap_or_default() + .into_iter() + .filter(|comp| !comp.is_indicator_component()) + .flat_map(|comp| { + get_component_with_instances(store, &latest_at_query, entity, comp) + .map(|(_, comp_inst)| comp_inst.instance_keys()) + .unwrap_or_default() + }) + .filter(|instance_key| !instance_key.is_splat()) + .map(|instance_key| InstancePath::instance(entity.clone(), instance_key)) + }) + .unique() + .collect(); + + let all_components: Vec<_> = entities + .iter() + .flat_map(|entity| { + store + .all_components(&query.timeline, entity) + .unwrap_or_default() + }) + .unique() + .filter(|comp| !comp.is_indicator_component()) + .collect(); + + egui::ScrollArea::both() + .auto_shrink([false, false]) + .show(ui, |ui| { + egui::Frame { + inner_margin: egui::Margin::same(5.0), + ..Default::default() + } + .show(ui, |ui| { + egui_extras::TableBuilder::new(ui) + .columns( + Column::auto_with_initial_suggestion(200.0), + all_components.len() + 1, + ) + .resizable(true) + .vscroll(false) + .auto_shrink([false, true]) + .striped(true) + .header(re_ui::ReUi::table_line_height(), |mut row| { + row.col(|ui| { + ui.strong("Entity"); + }); + + for comp in &all_components { + row.col(|ui| { + ui.strong(comp.short_name()); + }); + } + }) + .body(|body| { + body.rows( + re_ui::ReUi::table_line_height(), + all_instances.len(), + |idx, mut row| { + let instance = &all_instances[idx]; + + row.col(|ui| { + ui.label(format!("{instance}")); + }); + + for comp in &all_components { + row.col(|ui| { + if let Some((_, comp_inst)) = + get_component_with_instances( + store, + &latest_at_query, + &instance.entity_path, + *comp, + ) + { + ctx.component_ui_registry.ui( + ctx, + ui, + UiVerbosity::Small, + &latest_at_query, + &instance.entity_path, + &comp_inst, + &instance.instance_key, + ); + } else { + ui.weak("-"); + } + }); + } + }, + ); + }); + }); + }); + + Ok(()) + } +} diff --git a/crates/re_space_view_data/src/view_part_system.rs b/crates/re_space_view_data/src/view_part_system.rs new file mode 100644 index 000000000000..33bcd2c4557a --- /dev/null +++ b/crates/re_space_view_data/src/view_part_system.rs @@ -0,0 +1,38 @@ +use re_types::ComponentNameSet; +use re_viewer_context::{ + IdentifiedViewSystem, SpaceViewSystemExecutionError, ViewContextCollection, ViewPartSystem, + ViewQuery, ViewerContext, +}; + +/// An empty system to accept all entities in the space view +#[derive(Default)] +pub struct EmptySystem {} + +impl IdentifiedViewSystem for EmptySystem { + fn identifier() -> re_viewer_context::ViewSystemIdentifier { + "Empty".into() + } +} + +impl ViewPartSystem for EmptySystem { + fn required_components(&self) -> ComponentNameSet { + std::iter::empty().collect() + } + + fn indicator_components(&self) -> ComponentNameSet { + std::iter::empty().collect() + } + + fn execute( + &mut self, + _ctx: &ViewerContext<'_>, + _query: &ViewQuery<'_>, + _view_ctx: &ViewContextCollection, + ) -> Result, SpaceViewSystemExecutionError> { + Ok(vec![]) + } + + fn as_any(&self) -> &dyn std::any::Any { + self + } +} diff --git a/crates/re_viewer/Cargo.toml b/crates/re_viewer/Cargo.toml index 69a2cd780b45..f1cf589f0a08 100644 --- a/crates/re_viewer/Cargo.toml +++ b/crates/re_viewer/Cargo.toml @@ -53,6 +53,7 @@ re_renderer = { workspace = true, default-features = false } re_smart_channel.workspace = true re_space_view.workspace = true re_space_view_bar_chart.workspace = true +re_space_view_data.workspace = true re_space_view_spatial.workspace = true re_space_view_tensor.workspace = true re_space_view_text_document = { workspace = true, features = ["markdown"] } diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index 23800a15bc2e..19959f23c051 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -1158,6 +1158,7 @@ fn populate_space_view_class_registry_with_builtin( ) -> Result<(), SpaceViewClassRegistryError> { re_tracing::profile_function!(); space_view_class_registry.add_class::()?; + space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; From 8c38b5bcbc1db650660bba2b303060d1bdb5a333 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Mon, 11 Dec 2023 15:14:52 +0100 Subject: [PATCH 02/13] Gate registry of the data space view behind a (dynamic) feature flag --- crates/re_viewer/src/app.rs | 34 +++++++++--- crates/re_viewer/src/ui/rerun_menu.rs | 19 ++++++- crates/re_viewer_context/src/app_options.rs | 5 ++ .../re_viewer_context/src/command_sender.rs | 3 ++ .../space_view/space_view_class_registry.rs | 53 +++++++++++++------ 5 files changed, 92 insertions(+), 22 deletions(-) diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index 19959f23c051..613deb7569e2 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -8,8 +8,8 @@ use re_smart_channel::{ReceiveSet, SmartChannelSource}; use re_ui::{toasts, UICommand, UICommandSender}; use re_viewer_context::{ command_channel, AppOptions, CommandReceiver, CommandSender, ComponentUiRegistry, - DynSpaceViewClass, PlayState, SpaceViewClassRegistry, SpaceViewClassRegistryError, - StoreContext, SystemCommand, SystemCommandSender, + DynSpaceViewClass, PlayState, SpaceViewClass, SpaceViewClassRegistry, + SpaceViewClassRegistryError, StoreContext, SystemCommand, SystemCommandSender, }; use crate::{ @@ -185,9 +185,10 @@ impl App { analytics.on_viewer_started(&build_info, app_env); let mut space_view_class_registry = SpaceViewClassRegistry::default(); - if let Err(err) = - populate_space_view_class_registry_with_builtin(&mut space_view_class_registry) - { + if let Err(err) = populate_space_view_class_registry_with_builtin( + &mut space_view_class_registry, + state.app_options(), + ) { re_log::error!( "Failed to populate Space View type registry with built-in Space Views: {}", err @@ -375,6 +376,22 @@ impl App { } } } + SystemCommand::EnableExperimentalDataframeSpaceView(enabled) => { + let result = if enabled { + self.space_view_class_registry + .add_class::() + } else { + self.space_view_class_registry + .remove_class(&re_space_view_data::DataSpaceView::IDENTIFIER.into()) + }; + + if let Err(err) = result { + re_log::warn_once!( + "Failed to {} experimental dataframe space view: {err}", + if enabled { "enable" } else { "disable" } + ); + } + } } } @@ -1155,16 +1172,21 @@ impl eframe::App for App { /// Add built-in space views to the registry. fn populate_space_view_class_registry_with_builtin( space_view_class_registry: &mut SpaceViewClassRegistry, + app_options: &AppOptions, ) -> Result<(), SpaceViewClassRegistryError> { re_tracing::profile_function!(); space_view_class_registry.add_class::()?; - space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; + + if app_options.experimental_dataframe_space_view { + space_view_class_registry.add_class::()?; + } + Ok(()) } diff --git a/crates/re_viewer/src/ui/rerun_menu.rs b/crates/re_viewer/src/ui/rerun_menu.rs index 31f1fc847277..32fad56aa8ac 100644 --- a/crates/re_viewer/src/ui/rerun_menu.rs +++ b/crates/re_viewer/src/ui/rerun_menu.rs @@ -4,7 +4,7 @@ use egui::{NumExt as _, Widget}; use re_log_types::TimeZone; use re_ui::{ReUi, UICommand}; -use re_viewer_context::StoreContext; +use re_viewer_context::{StoreContext, SystemCommand, SystemCommandSender}; use crate::App; @@ -207,6 +207,23 @@ impl App { } } + if self + .re_ui + .checkbox( + ui, + &mut self.state.app_options.experimental_dataframe_space_view, + "(experimental) Dataframe Space View", + ) + .on_hover_text("Enable the experimental dataframe space view.") + .clicked() + { + self.command_sender + .send_system(SystemCommand::EnableExperimentalDataframeSpaceView( + self.state.app_options.experimental_dataframe_space_view, + )); + ui.close_menu(); + } + #[cfg(debug_assertions)] { ui.separator(); diff --git a/crates/re_viewer_context/src/app_options.rs b/crates/re_viewer_context/src/app_options.rs index adb7a921d221..ef18d1c43875 100644 --- a/crates/re_viewer_context/src/app_options.rs +++ b/crates/re_viewer_context/src/app_options.rs @@ -14,6 +14,9 @@ pub struct AppOptions { #[cfg(not(target_arch = "wasm32"))] pub experimental_space_view_screenshots: bool, + /// Enable experimental dataframe space views. + pub experimental_dataframe_space_view: bool, + /// Displays an overlay for debugging picking. pub show_picking_debug_overlay: bool, @@ -35,6 +38,8 @@ impl Default for AppOptions { #[cfg(not(target_arch = "wasm32"))] experimental_space_view_screenshots: false, + experimental_dataframe_space_view: false, + show_picking_debug_overlay: false, show_blueprint_in_timeline: false, diff --git a/crates/re_viewer_context/src/command_sender.rs b/crates/re_viewer_context/src/command_sender.rs index b05631f6e05f..a2b10d2a8bb8 100644 --- a/crates/re_viewer_context/src/command_sender.rs +++ b/crates/re_viewer_context/src/command_sender.rs @@ -32,6 +32,9 @@ pub enum SystemCommand { /// but is tracked manually to ensure self-consistency if the blueprint /// is both modified and changed in the same frame. UpdateBlueprint(StoreId, Vec), + + /// Enable or disable the experimental dataframe space views. + EnableExperimentalDataframeSpaceView(bool), } /// Interface for sending [`SystemCommand`] messages. diff --git a/crates/re_viewer_context/src/space_view/space_view_class_registry.rs b/crates/re_viewer_context/src/space_view/space_view_class_registry.rs index 3e679dcc38ce..09ecc52104d3 100644 --- a/crates/re_viewer_context/src/space_view/space_view_class_registry.rs +++ b/crates/re_viewer_context/src/space_view/space_view_class_registry.rs @@ -10,14 +10,17 @@ use super::space_view_class_placeholder::SpaceViewClassPlaceholder; #[derive(Debug, thiserror::Error)] #[allow(clippy::enum_variant_names)] pub enum SpaceViewClassRegistryError { - #[error("Space View with class name {0:?} was already registered.")] - DuplicateClassName(SpaceViewClassIdentifier), + #[error("Space View with class identifier {0:?} was already registered.")] + DuplicateClassIdentifier(SpaceViewClassIdentifier), - #[error("A Context System with name {0:?} was already registered.")] - NameAlreadyInUseForContextSystem(&'static str), + #[error("A Context System with identifier {0:?} was already registered.")] + IdentifierAlreadyInUseForContextSystem(&'static str), - #[error("A View Part System with name {0:?} was already registered.")] - NameAlreadyInUseForViewSystem(&'static str), + #[error("A View Part System with identifier {0:?} was already registered.")] + IdentifierAlreadyInUseForViewSystem(&'static str), + + #[error("Space View with class identifier {0:?} was not registered.")] + UnknownClassIdentifier(SpaceViewClassIdentifier), } /// System registry for a space view class. @@ -42,9 +45,11 @@ impl SpaceViewSystemRegistry { ) -> Result<(), SpaceViewClassRegistryError> { // Name should also not overlap with part systems. if self.parts.contains_key(&T::identifier()) { - return Err(SpaceViewClassRegistryError::NameAlreadyInUseForViewSystem( - T::identifier().as_str(), - )); + return Err( + SpaceViewClassRegistryError::IdentifierAlreadyInUseForViewSystem( + T::identifier().as_str(), + ), + ); } if let std::collections::hash_map::Entry::Vacant(e) = self.contexts.entry(T::identifier()) { @@ -52,7 +57,7 @@ impl SpaceViewSystemRegistry { Ok(()) } else { Err( - SpaceViewClassRegistryError::NameAlreadyInUseForContextSystem( + SpaceViewClassRegistryError::IdentifierAlreadyInUseForContextSystem( T::identifier().as_str(), ), ) @@ -68,7 +73,7 @@ impl SpaceViewSystemRegistry { // Name should also not overlap with context systems. if self.parts.contains_key(&T::identifier()) { return Err( - SpaceViewClassRegistryError::NameAlreadyInUseForContextSystem( + SpaceViewClassRegistryError::IdentifierAlreadyInUseForContextSystem( T::identifier().as_str(), ), ); @@ -78,9 +83,11 @@ impl SpaceViewSystemRegistry { e.insert(Box::new(|| Box::::default())); Ok(()) } else { - Err(SpaceViewClassRegistryError::NameAlreadyInUseForViewSystem( - T::identifier().as_str(), - )) + Err( + SpaceViewClassRegistryError::IdentifierAlreadyInUseForViewSystem( + T::identifier().as_str(), + ), + ) } } @@ -160,7 +167,23 @@ impl SpaceViewClassRegistry { let type_name = entry.class.identifier(); if self.registry.insert(type_name, entry).is_some() { - return Err(SpaceViewClassRegistryError::DuplicateClassName(type_name)); + return Err(SpaceViewClassRegistryError::DuplicateClassIdentifier( + type_name, + )); + } + + Ok(()) + } + + /// Removes a space view class from the registry. + pub fn remove_class( + &mut self, + type_name: &SpaceViewClassIdentifier, + ) -> Result<(), SpaceViewClassRegistryError> { + if self.registry.remove(type_name).is_none() { + return Err(SpaceViewClassRegistryError::UnknownClassIdentifier( + *type_name, + )); } Ok(()) From c825f397705c970a6b4510ce5faf5a9a24d40885 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Mon, 11 Dec 2023 15:26:19 +0100 Subject: [PATCH 03/13] Renamed to DataframeSpaceView --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../README.md | 0 .../src/lib.rs | 2 +- .../src/space_view_class.rs | 8 ++++---- .../src/view_part_system.rs | 0 crates/re_viewer/Cargo.toml | 2 +- crates/re_viewer/src/app.rs | 9 +++++---- 9 files changed, 15 insertions(+), 14 deletions(-) rename crates/{re_space_view_data => re_space_view_dataframe}/Cargo.toml (96%) rename crates/{re_space_view_data => re_space_view_dataframe}/README.md (100%) rename crates/{re_space_view_data => re_space_view_dataframe}/src/lib.rs (76%) rename crates/{re_space_view_data => re_space_view_dataframe}/src/space_view_class.rs (97%) rename crates/{re_space_view_data => re_space_view_dataframe}/src/view_part_system.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 4b6dfc25186c..b5f61530a275 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4811,7 +4811,7 @@ dependencies = [ ] [[package]] -name = "re_space_view_data" +name = "re_space_view_dataframe" version = "0.12.0-alpha.1+dev" dependencies = [ "egui", @@ -5126,7 +5126,7 @@ dependencies = [ "re_smart_channel", "re_space_view", "re_space_view_bar_chart", - "re_space_view_data", + "re_space_view_dataframe", "re_space_view_spatial", "re_space_view_tensor", "re_space_view_text_document", diff --git a/Cargo.toml b/Cargo.toml index 4162b62cdb21..6aa48e751a11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ re_sdk_comms = { path = "crates/re_sdk_comms", version = "=0.12.0-alpha.1", defa re_smart_channel = { path = "crates/re_smart_channel", version = "=0.12.0-alpha.1", default-features = false } re_space_view = { path = "crates/re_space_view", version = "=0.12.0-alpha.1", default-features = false } re_space_view_bar_chart = { path = "crates/re_space_view_bar_chart", version = "=0.12.0-alpha.1", default-features = false } -re_space_view_data = { path = "crates/re_space_view_data", version = "=0.12.0-alpha.1", default-features = false } +re_space_view_dataframe = { path = "crates/re_space_view_dataframe", version = "=0.12.0-alpha.1", default-features = false } re_space_view_spatial = { path = "crates/re_space_view_spatial", version = "=0.12.0-alpha.1", default-features = false } re_space_view_tensor = { path = "crates/re_space_view_tensor", version = "=0.12.0-alpha.1", default-features = false } re_space_view_text_log = { path = "crates/re_space_view_text_log", version = "=0.12.0-alpha.1", default-features = false } diff --git a/crates/re_space_view_data/Cargo.toml b/crates/re_space_view_dataframe/Cargo.toml similarity index 96% rename from crates/re_space_view_data/Cargo.toml rename to crates/re_space_view_dataframe/Cargo.toml index 1d1bf92aae8b..e1553728b17d 100644 --- a/crates/re_space_view_data/Cargo.toml +++ b/crates/re_space_view_dataframe/Cargo.toml @@ -4,7 +4,7 @@ description = "A Space View that shows the data contained in entities in a table edition.workspace = true homepage.workspace = true license.workspace = true -name = "re_space_view_data" +name = "re_space_view_dataframe" publish = true readme = "README.md" repository.workspace = true diff --git a/crates/re_space_view_data/README.md b/crates/re_space_view_dataframe/README.md similarity index 100% rename from crates/re_space_view_data/README.md rename to crates/re_space_view_dataframe/README.md diff --git a/crates/re_space_view_data/src/lib.rs b/crates/re_space_view_dataframe/src/lib.rs similarity index 76% rename from crates/re_space_view_data/src/lib.rs rename to crates/re_space_view_dataframe/src/lib.rs index bffd367603cd..1bbc9de9e34e 100644 --- a/crates/re_space_view_data/src/lib.rs +++ b/crates/re_space_view_dataframe/src/lib.rs @@ -5,4 +5,4 @@ mod space_view_class; mod view_part_system; -pub use space_view_class::DataSpaceView; +pub use space_view_class::DataframeSpaceView; diff --git a/crates/re_space_view_data/src/space_view_class.rs b/crates/re_space_view_dataframe/src/space_view_class.rs similarity index 97% rename from crates/re_space_view_data/src/space_view_class.rs rename to crates/re_space_view_dataframe/src/space_view_class.rs index c47e191455d7..c7d1356eefc7 100644 --- a/crates/re_space_view_data/src/space_view_class.rs +++ b/crates/re_space_view_dataframe/src/space_view_class.rs @@ -11,13 +11,13 @@ use re_viewer_context::{ }; #[derive(Default)] -pub struct DataSpaceView; +pub struct DataframeSpaceView; -impl SpaceViewClass for DataSpaceView { +impl SpaceViewClass for DataframeSpaceView { type State = (); - const IDENTIFIER: &'static str = "Data"; - const DISPLAY_NAME: &'static str = "Data"; + const IDENTIFIER: &'static str = "Dataframe"; + const DISPLAY_NAME: &'static str = "Dataframe"; fn icon(&self) -> &'static re_ui::Icon { //TODO(ab): fix that icon diff --git a/crates/re_space_view_data/src/view_part_system.rs b/crates/re_space_view_dataframe/src/view_part_system.rs similarity index 100% rename from crates/re_space_view_data/src/view_part_system.rs rename to crates/re_space_view_dataframe/src/view_part_system.rs diff --git a/crates/re_viewer/Cargo.toml b/crates/re_viewer/Cargo.toml index f1cf589f0a08..177e326496ce 100644 --- a/crates/re_viewer/Cargo.toml +++ b/crates/re_viewer/Cargo.toml @@ -53,7 +53,7 @@ re_renderer = { workspace = true, default-features = false } re_smart_channel.workspace = true re_space_view.workspace = true re_space_view_bar_chart.workspace = true -re_space_view_data.workspace = true +re_space_view_dataframe.workspace = true re_space_view_spatial.workspace = true re_space_view_tensor.workspace = true re_space_view_text_document = { workspace = true, features = ["markdown"] } diff --git a/crates/re_viewer/src/app.rs b/crates/re_viewer/src/app.rs index 613deb7569e2..f5017b85a5f3 100644 --- a/crates/re_viewer/src/app.rs +++ b/crates/re_viewer/src/app.rs @@ -379,10 +379,11 @@ impl App { SystemCommand::EnableExperimentalDataframeSpaceView(enabled) => { let result = if enabled { self.space_view_class_registry - .add_class::() + .add_class::() } else { - self.space_view_class_registry - .remove_class(&re_space_view_data::DataSpaceView::IDENTIFIER.into()) + self.space_view_class_registry.remove_class( + &re_space_view_dataframe::DataframeSpaceView::IDENTIFIER.into(), + ) }; if let Err(err) = result { @@ -1184,7 +1185,7 @@ fn populate_space_view_class_registry_with_builtin( space_view_class_registry.add_class::()?; if app_options.experimental_dataframe_space_view { - space_view_class_registry.add_class::()?; + space_view_class_registry.add_class::()?; } Ok(()) From b8afb96ac5ad355e5cb8d05772d518f48ed467d5 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Mon, 11 Dec 2023 15:30:33 +0100 Subject: [PATCH 04/13] Update ARCHITECTURE.md --- ARCHITECTURE.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 14baea5c4b79..70aee9ba72da 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -88,11 +88,11 @@ Of course, this will only take us so far. In the future we plan on caching queri Here is an overview of the crates included in the project: - - - - - + + + + +