Skip to content

Commit

Permalink
make display of names toggle-able, like taxa (with isAdvancedView)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbbaker committed Mar 4, 2025
1 parent a8630ab commit fc86299
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/modules/otus/components/Panel/PanelStats/PanelStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
Taxa
</VTableHeaderCell>
<VTableHeaderCell
v-if="!hideNames"
title="Taxon names"
class="border-l border-base-border"
>
Names
</VTableHeaderCell>
<VTableHeaderCell
v-if="!hideNames"
colspan="2"
class="bg-base-foreground"
/>
Expand All @@ -42,13 +44,18 @@
>Total</VTableHeaderCell
>
<VTableHeaderCell
v-if="!hideNames"
title="Taxon names"
class="border-l border-base-border"
>
Total
</VTableHeaderCell>
<VTableHeaderCell> Valid </VTableHeaderCell>
<VTableHeaderCell> Invalid </VTableHeaderCell>
<VTableHeaderCell v-if="!hideNames">
Valid
</VTableHeaderCell>
<VTableHeaderCell v-if="!hideNames">
Invalid
</VTableHeaderCell>
</VTableHeaderRow>
</VTableHeader>
<VTableBody>
Expand All @@ -58,11 +65,11 @@
>
<VTableBodyCell class="capitalize">{{ rank }}</VTableBodyCell>
<VTableBodyCell v-if="isAdvancedView">{{ taxa }}</VTableBodyCell>
<VTableBodyCell class="border-l border-base-border">
<VTableBodyCell v-if="!hideNames" class="border-l border-base-border">
{{ names.invalid + names.valid }}
</VTableBodyCell>
<VTableBodyCell>{{ names.valid }}</VTableBodyCell>
<VTableBodyCell>{{ names.invalid }}</VTableBodyCell>
<VTableBodyCell v-if="!hideNames">{{ names.valid }}</VTableBodyCell>
<VTableBodyCell v-if="!hideNames">{{ names.invalid }}</VTableBodyCell>
</VTableBodyRow>
</VTableBody>
</VTable>
Expand Down Expand Up @@ -94,16 +101,31 @@ const props = defineProps({
otu: {
type: Object,
default: undefined
},
showTaxa: {
type: Boolean,
default: false
},
hideNames: {
type: Boolean,
default: false
}
})
const store = useOtuStore()
const isAdvancedView = ref(false)
const isAdvancedView = ref(props.showTaxa)
const hideNames = ref(props.hideNames)
const menuOptions = computed(() => [
{
label: isAdvancedView.value ? 'Hide taxa' : 'Show taxa',
action: () => (isAdvancedView.value = !isAdvancedView.value)
},
{
label: hideNames.value ? 'Show names' : 'Hide names',
action: () => (hideNames.value = !hideNames.value)
}
])
</script>

0 comments on commit fc86299

Please sign in to comment.