Skip to content

Commit

Permalink
fix: repeated annotated object names (#958)
Browse files Browse the repository at this point in the history
#810

Removes duplicate object names from the list using a `Set`

## Demos

### Before

<img width="1328" alt="image"
src="https://github.com/user-attachments/assets/ca573fc1-8167-421e-87b4-9a3f236c8cd1">

### After

<img width="1328" alt="image"
src="https://github.com/user-attachments/assets/552b3719-7050-4002-8a80-ccda0f015ac4">
  • Loading branch information
codemonkey800 authored Jul 29, 2024
1 parent 53f348a commit 7d039d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions frontend/packages/data-portal/app/components/Run/RunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,13 @@ export function RunHeader() {
{
label: i18n.annotatedObjects,
inline: true,
values: run.tomogram_stats
.flatMap((stats) => stats.annotations)
.map((annotation) => annotation.object_name),
values: Array.from(
new Set(
run.tomogram_stats
.flatMap((stats) => stats.annotations)
.map((annotation) => annotation.object_name),
),
),
},
]}
/>
Expand Down

0 comments on commit 7d039d8

Please sign in to comment.