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 with stages
in 9 minutes and 28 seconds
......@@ -227,8 +227,9 @@ const defaultBarPlotOptions = computed(() => {
// system distri
const computedSystemDistribution = computed(() => {
if (toValue(msResult)?.facetDistribution?.type) {
return Object.entries(toValue(msResult).facetDistribution.type)
const allHitsVal = toValue(allHits)
if (allHitsVal?.facetDistribution?.type) {
return Object.entries(allHitsVal.facetDistribution.type)
.map(([key, value]) => {
return {
type: key,
......@@ -264,18 +265,21 @@ const computedDistriSystemOptions = computed(() => {
// Taxo distri
const computedTaxonomyDistribution = computed(() => {
const toValSelectedTaxoRank = toValue(selectedTaxoRank)
const toValFacetsPerRank = toValue(msResult)?.facetDistribution?.[toValSelectedTaxoRank]
const toValFacetsPerRank = toValue(allHits)?.facetDistribution?.[toValSelectedTaxoRank]
if (toValFacetsPerRank) {
const listFacetsPerRank = Object.entries(toValFacetsPerRank)
const result = new Array(listFacetsPerRank.length);
for (let i = 0; listFacetsPerRank.length; i++) {
const [key, value] = listFacetsPerRank[i]
result[i] = {
[toValSelectedTaxoRank]: key,
count: value
if (listFacetsPerRank.length > 0) {
const result = new Array(listFacetsPerRank.length);
for (let i = 0; i < listFacetsPerRank.length; i++) {
const [key, value] = listFacetsPerRank[i]
result[i] = {
[toValSelectedTaxoRank]: key,
count: value
}
}
return result.sort()
}
return result.sort()
else { return [] }
} else { return [] }
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment