Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move selection panel UI to new re_selection_panel crate #6431

Merged
merged 4 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<picture>
<img src="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/1200w.png">
<img src="https://static.rerun.io/crates/6fa2652f031b744bb2f6ba3f09e2383378e9a372/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/6fa2652f031b744bb2f6ba3f09e2383378e9a372/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/6fa2652f031b744bb2f6ba3f09e2383378e9a372/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/6fa2652f031b744bb2f6ba3f09e2383378e9a372/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/6fa2652f031b744bb2f6ba3f09e2383378e9a372/1200w.png">
</picture>


Expand Down Expand Up @@ -131,6 +131,7 @@ Update instructions:
| re_viewer | The Rerun Viewer |
| re_viewport | The central viewport panel of the Rerun viewer. |
| re_time_panel | The time panel of the Rerun Viewer, allowing to control the displayed timeline & time. |
| re_selection_panel | The UI for the selection panel. |
| re_space_view | Types & utilities for defining Space View classes and communicating with the Viewport. |
| re_space_view_bar_chart | A Space View that shows a single bar chart. |
| re_space_view_dataframe | A Space View that shows the data contained in entities in a table. |
Expand Down
35 changes: 29 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4668,6 +4668,34 @@ dependencies = [
"thiserror",
]

[[package]]
name = "re_selection_panel"
version = "0.17.0-alpha.2"
dependencies = [
"egui",
"egui_tiles",
"itertools 0.12.0",
"nohash-hasher",
"once_cell",
"re_context_menu",
"re_data_store",
"re_data_ui",
"re_entity_db",
"re_log",
"re_log_types",
"re_renderer",
"re_space_view_spatial",
"re_space_view_time_series",
"re_tracing",
"re_types",
"re_types_core",
"re_ui",
"re_viewer_context",
"re_viewport_blueprint",
"serde",
"static_assertions",
]

[[package]]
name = "re_smart_channel"
version = "0.17.0-alpha.2"
Expand Down Expand Up @@ -5036,18 +5064,15 @@ dependencies = [
"egui",
"egui-wgpu",
"egui_plot",
"egui_tiles",
"ehttp",
"image",
"itertools 0.12.0",
"js-sys",
"once_cell",
"poll-promise",
"re_analytics",
"re_blueprint_tree",
"re_build_info",
"re_build_tools",
"re_context_menu",
"re_data_loader",
"re_data_source",
"re_data_store",
Expand All @@ -5062,6 +5087,7 @@ dependencies = [
"re_query",
"re_renderer",
"re_sdk_comms",
"re_selection_panel",
"re_smart_channel",
"re_space_view_bar_chart",
"re_space_view_dataframe",
Expand All @@ -5084,7 +5110,6 @@ dependencies = [
"ron",
"serde",
"serde_json",
"static_assertions",
"thiserror",
"time",
"wasm-bindgen",
Expand Down Expand Up @@ -5146,10 +5171,8 @@ dependencies = [
"image",
"itertools 0.12.0",
"nohash-hasher",
"once_cell",
"rayon",
"re_context_menu",
"re_data_ui",
"re_entity_db",
"re_log",
"re_log_types",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ re_log_types = { path = "crates/re_log_types", version = "=0.17.0-alpha.2", defa
re_memory = { path = "crates/re_memory", version = "=0.17.0-alpha.2", default-features = false }
re_query = { path = "crates/re_query", version = "=0.17.0-alpha.2", default-features = false }
re_renderer = { path = "crates/re_renderer", version = "=0.17.0-alpha.2", default-features = false }
re_selection_panel = { path = "crates/re_selection_panel", version = "=0.17.0-alpha.2", default-features = false }
re_sdk = { path = "crates/re_sdk", version = "=0.17.0-alpha.2", default-features = false }
re_sdk_comms = { path = "crates/re_sdk_comms", version = "=0.17.0-alpha.2", default-features = false }
re_smart_channel = { path = "crates/re_smart_channel", version = "=0.17.0-alpha.2", default-features = false }
Expand Down
44 changes: 44 additions & 0 deletions crates/re_selection_panel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[package]
authors.workspace = true
description = "The UI for the selection panel."
edition.workspace = true
homepage.workspace = true
license.workspace = true
name = "re_selection_panel"
publish = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"]

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true

[dependencies]
re_context_menu.workspace = true
re_data_store.workspace = true
re_data_ui.workspace = true
re_entity_db = { workspace = true, features = ["serde"] }
re_log.workspace = true
re_log_types.workspace = true
re_renderer.workspace = true
re_space_view_time_series.workspace = true
re_space_view_spatial.workspace = true
re_tracing.workspace = true
re_types_core.workspace = true
re_types.workspace = true
re_ui.workspace = true
re_viewer_context.workspace = true
re_viewport_blueprint.workspace = true

egui_tiles.workspace = true
egui.workspace = true
itertools.workspace = true
once_cell.workspace = true
nohash-hasher.workspace = true
serde = { workspace = true, features = ["derive"] }
static_assertions.workspace = true
10 changes: 10 additions & 0 deletions crates/re_selection_panel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# re_selection_panel

Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates.

[![Latest version](https://img.shields.io/crates/v/re_selection_panel.svg)](https://crates.io/crates/re_selection_panel?speculative-link)
[![Documentation](https://docs.rs/re_selection_panel/badge.svg)](https://docs.rs/re_selection_panel?speculative-link)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
![Apache](https://img.shields.io/badge/license-Apache-blue.svg)

The UI for the selection panel.
10 changes: 10 additions & 0 deletions crates/re_selection_panel/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! The UI for the selection panel.

mod override_ui;
mod query_range_ui;
mod selection_history_ui;
mod selection_panel;
mod space_view_entity_picker;
mod space_view_space_origin_ui;

pub use selection_panel::SelectionPanel;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use egui::RichText;

use re_ui::UICommand;
use re_viewer_context::{Item, ItemCollection, SelectionHistory};
use re_viewport_blueprint::ViewportBlueprint;
Expand Down Expand Up @@ -143,7 +144,9 @@ impl SelectionHistoryUi {
}
}
if sel.iter_items().count() == 1 {
item_kind_ui(ui, sel.iter_items().next().unwrap());
if let Some(item) = sel.iter_items().next() {
item_kind_ui(ui, item);
}
}
});
}
Expand Down
Loading
Loading