Skip to content
Snippets Groups Projects
Commit 5358a8e8 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Fix bug display distry

parent b4c3d7ee
No related branches found
No related tags found
No related merge requests found
Pipeline #132002 waiting for manual action
...@@ -227,8 +227,9 @@ const defaultBarPlotOptions = computed(() => { ...@@ -227,8 +227,9 @@ const defaultBarPlotOptions = computed(() => {
// system distri // system distri
const computedSystemDistribution = computed(() => { const computedSystemDistribution = computed(() => {
if (toValue(msResult)?.facetDistribution?.type) { const allHitsVal = toValue(allHits)
return Object.entries(toValue(msResult).facetDistribution.type) if (allHitsVal?.facetDistribution?.type) {
return Object.entries(allHitsVal.facetDistribution.type)
.map(([key, value]) => { .map(([key, value]) => {
return { return {
type: key, type: key,
...@@ -264,18 +265,21 @@ const computedDistriSystemOptions = computed(() => { ...@@ -264,18 +265,21 @@ const computedDistriSystemOptions = computed(() => {
// Taxo distri // Taxo distri
const computedTaxonomyDistribution = computed(() => { const computedTaxonomyDistribution = computed(() => {
const toValSelectedTaxoRank = toValue(selectedTaxoRank) const toValSelectedTaxoRank = toValue(selectedTaxoRank)
const toValFacetsPerRank = toValue(msResult)?.facetDistribution?.[toValSelectedTaxoRank] const toValFacetsPerRank = toValue(allHits)?.facetDistribution?.[toValSelectedTaxoRank]
if (toValFacetsPerRank) { if (toValFacetsPerRank) {
const listFacetsPerRank = Object.entries(toValFacetsPerRank) const listFacetsPerRank = Object.entries(toValFacetsPerRank)
const result = new Array(listFacetsPerRank.length); if (listFacetsPerRank.length > 0) {
for (let i = 0; listFacetsPerRank.length; i++) { const result = new Array(listFacetsPerRank.length);
const [key, value] = listFacetsPerRank[i] for (let i = 0; i < listFacetsPerRank.length; i++) {
result[i] = { const [key, value] = listFacetsPerRank[i]
[toValSelectedTaxoRank]: key, result[i] = {
count: value [toValSelectedTaxoRank]: key,
count: value
}
} }
return result.sort()
} }
return result.sort() else { return [] }
} else { return [] } } else { return [] }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment