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

Hide graph edges from individual graph node ui #8511

Merged
merged 2 commits into from
Dec 18, 2024
Merged
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
16 changes: 15 additions & 1 deletion crates/viewer/re_data_ui/src/instance_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl DataUi for InstancePath {
.filter(|c| c.is_indicator_component())
.count();

let components = latest_at(db, query, entity_path, &components);
let mut components = latest_at(db, query, entity_path, &components);

if components.is_empty() {
ui_layout.label(
Expand Down Expand Up @@ -96,6 +96,20 @@ impl DataUi for InstancePath {
),
);
} else {
// TODO(#7026): Instances today are too poorly defined:
// For many archetypes it makes sense to slice through all their component arrays with the same index.
// However, there are cases when there are multiple dimensions of slicing that make sense.
// This is most obvious for meshes & graph nodes where there are different dimensions for vertices/edges/etc.
//
// For graph nodes this is particularly glaring since our indicices imply nodes today and
// unlike with meshes it's very easy to hover & select individual nodes.
// In order to work around the GraphEdges showing up associated with random nodes, we just hide them here.
// (this is obviously a hack and these relationships should be formalized such that they are accessible to the UI, see ticket link above)
if !self.is_all() {
components
.retain(|(component, _chunk)| component != &components::GraphEdge::name());
}

component_list_ui(
ctx,
ui,
Expand Down
Loading