Skip to content

Commit

Permalink
Fix applicability filters for bar chart & images
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 11, 2024
1 parent 07b8825 commit 95b9f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions crates/store/re_chunk/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ impl ChunkComponents {
.insert(component_desc, list_array);
}

/// Returns the first list array for the given component name.
///
/// It's undefined which one is returned if there are more than one component with this name.
#[inline]
pub fn get_by_component_name(
&self,
component_name: &ComponentName,
) -> Option<&Arrow2ListArray<i32>> {
self.get(component_name)
.and_then(|per_desc| per_desc.values().next())
}

#[inline]
pub fn get_by_descriptor(
&self,
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_view/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn diff_component_filter<T: re_types_core::Component>(
.diff
.chunk
.components()
.get_by_descriptor(&T::descriptor())
.get_by_component_name(&T::descriptor().component_name)
.map_or(false, |list_array| {
list_array
.iter()
Expand Down

0 comments on commit 95b9f38

Please sign in to comment.