diff --git a/components/content/ArticleSystemDistributionPlot.vue b/components/content/ArticleSystemDistributionPlot.vue index c644c73cb846df8258412e82123ad187feaa4d6c..b5bdbd3153ec459dc44a5873bfa040ddc0285374 100644 --- a/components/content/ArticleSystemDistributionPlot.vue +++ b/components/content/ArticleSystemDistributionPlot.vue @@ -64,7 +64,7 @@ const computedDistribution = computed(() => { const distribution = [] for (const [taxo, values] of itemsPerGroup.entries()) { if (toValFacetsPerRank[taxo] && toValFacetsPerRank[taxo] > 0) { - distribution.push({ taxo, size: (values.size / toValFacetsPerRank[taxo]) * 100 }) + distribution.push({ taxo, size: values.size, percent: (values.size / toValFacetsPerRank[taxo]) * 100 }) } } return distribution @@ -102,9 +102,16 @@ const distributionOptions = computed(() => { const { marginLeft, marginRight } = toValue(margin) return { ...toValue(margin), - y: { label: `% of genomes encoding ${toValue(page)?.title ?? 'the system'}` }, + y: { label: `Number of genomes encoding ${toValue(page)?.title ?? 'the system'}` }, x: { label: selectedTaxoRank.value, tickRotate: 45 }, - color: { scheme: "plasma", legend: true, reverse: true, domain: [0, 100], marginLeft: 10, label: "percentage" }, + color: { + scheme: "plasma", + legend: true, + reverse: true, + domain: [0, 100], + marginLeft: 10, + label: `% of genomes encoding ${toValue(page)?.title ?? 'the system'}`, + }, width: computedWidth.value - marginRight - marginLeft, marks: [ Plot.barY( @@ -112,7 +119,7 @@ const distributionOptions = computed(() => { { y: "size", x: "taxo", - fill: "size", + fill: "percent", tip: true, sort: { x: "-y" }, }, @@ -136,13 +143,13 @@ async function fetchSystemHits() { query: "", params: { facets: ["*"], - filter: [`type='${toValue(systemName)}'`], + filter: [`type = '${toValue(systemName)}'`], limit: 500000, } }) systemHits.value = data.value if (error.value) { - throw createError(`Cannot get hits on refseq for system: ${toValue(systemName)}`) + throw createError(`Cannot get hits on refseq for system: ${toValue(systemName)} `) } } @@ -158,7 +165,7 @@ async function fetchRefSeqTaxo() { }) refseqTaxo.value = data.value if (error.value) { - throw createError(`Cannot get refseq taxo: ${toValue(systemName)}`) + throw createError(`Cannot get refseq taxo: ${toValue(systemName)} `) } }