From ac822ea153a2f2079e8256d8e38bb10c83825297 Mon Sep 17 00:00:00 2001 From: khansadaoudi Date: Wed, 6 Nov 2024 09:34:37 +0100 Subject: [PATCH] add more stats to the project --- src/components/project/StatisticsProject.vue | 42 +++++++++++++++----- src/i18n/en-us/index.ts | 4 ++ src/i18n/fr-fra/index.ts | 4 ++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/components/project/StatisticsProject.vue b/src/components/project/StatisticsProject.vue index c6f25250..973adac6 100644 --- a/src/components/project/StatisticsProject.vue +++ b/src/components/project/StatisticsProject.vue @@ -104,7 +104,7 @@ -
+
@@ -118,17 +118,31 @@
- - - Users' contributions + + +
+ {{ $t('projectStats.userContributionTitle') }} +
+
+ {{ $t('projectStats.userContributionCaption') }} +
- + -
- + +
+ {{ $t('projectStats.tokensDistributionTitle') }} +
+
+ {{ $t('projectStats.tokenDistributionCaption') }} +
+
+ + +
@@ -159,14 +173,20 @@ export default defineComponent({ }, data() { return { - labels: [] as string[], - values: [] as number[], + userLabels: [] as string[], + userTreesValues: [] as number[], } }, computed: { ...mapState(useStatisticStore, ['projectStats', 'topUserProgress', 'topUserProgressLabel']), projectTags() { return this.samples.map((sample) => Object.keys(sample.tags)).reduce((a: string[], b: string[]) => [...a, ...b], []); + }, + samplesNames() { + return this.samples.map((sample) => sample.sampleName); + }, + tokensNumberList() { + return this.samples.map((sample) => sample.tokens); } }, mounted() { @@ -183,8 +203,8 @@ export default defineComponent({ } return total }, {}); - this.labels = Object.keys(totalTreesByUser); - this.values = Object.values(totalTreesByUser); + this.userLabels = Object.keys(totalTreesByUser); + this.userTreesValues = Object.values(totalTreesByUser); }, } }); diff --git a/src/i18n/en-us/index.ts b/src/i18n/en-us/index.ts index 58c44dac..224eb9f6 100644 --- a/src/i18n/en-us/index.ts +++ b/src/i18n/en-us/index.ts @@ -502,6 +502,10 @@ export default { by: 'by', usedTags: 'Used tags', progressTooltip: 'Percentage of annotated sentences', + userContributionTitle: "Users' contributions", + userContributionCaption: "The total of users' trees in the project", + tokensDistributionTitle: 'Tokens distribution', + tokenDistributionCaption: 'Distribution of tokens per sample in the project', }, conllDial: { title: 'Conll Dialog', diff --git a/src/i18n/fr-fra/index.ts b/src/i18n/fr-fra/index.ts index 85822fe1..bf9523a4 100644 --- a/src/i18n/fr-fra/index.ts +++ b/src/i18n/fr-fra/index.ts @@ -504,6 +504,10 @@ export default { by: 'par', usedTags: 'Tags utilisés', progressTooltip: 'Pourcentage des phrases annotées', + userContributionTitle: "Les contributions des utilisateurs", + userContributionCaption: "Nombre total d'arbres d'utilisateurs dans le projet", + tokensDistributionTitle: 'Distribution des tokens', + tokenDistributionCaption: 'Distribution des tokens par échantillon dans le projet', }, conllDial: { title: 'Conll Dialog',