diff --git a/components/content/RefseqDb.vue b/components/content/RefseqDb.vue
index 850a747028a510861f961a11fd78a57e33ff2053..3a7bb77ad111cd55db19c966d1e4e3d9cfd2837e 100644
--- a/components/content/RefseqDb.vue
+++ b/components/content/RefseqDb.vue
@@ -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 [] }
})