Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit fecf5c5

Browse files
authored
feat(gui): show missed annotations in quality statistics (#973)
1 parent 811338d commit fecf5c5

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

api-editor/gui/src/features/statistics/QualityStatistics.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
4545
const wrongOrRemovedBg = useColorModeValue('rgba(161, 56, 56, 0.2)', 'rgba(211, 104, 104, 0.2)');
4646
const wrongOrRemovedBorder = useColorModeValue('rgba(133, 47, 47, 1)', 'rgba(230, 153, 153, 1)');
4747

48+
const missedBg = useColorModeValue('rgba(114,56,161,0.2)', 'rgba(168,104,211,0.2)');
49+
const missedBorder = useColorModeValue('rgb(89,47,133)', 'rgb(193,153,230)');
50+
4851
const unsureBg = useColorModeValue('rgba(161, 144, 56, 0.2)', 'rgba(211, 186, 104, 0.2)');
4952
const unsureBorder = useColorModeValue('rgba(133, 122, 47, 1)', 'rgba(230, 215, 153, 1)');
5053

@@ -54,6 +57,8 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
5457
const textColor = useColorModeValue('#000', '#FFF');
5558

5659
const autogeneratedAnnotations = annotations.filter((it) => (it.authors ?? []).includes('$autogen$'));
60+
const manualAnnotations = annotations.filter((it) => !(it.authors ?? []).includes('$autogen$'));
61+
5762
const numberOfCorrectAnnotations = autogeneratedAnnotations.filter(
5863
(it) => !it.isRemoved && isCorrect(it) && (it.authors ?? []).length <= 1,
5964
).length;
@@ -63,6 +68,7 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
6368
const numberOfWrongOrRemovedAnnotations = autogeneratedAnnotations.filter(
6469
(it) => it.isRemoved || it.reviewResult === ReviewResult.Wrong,
6570
).length;
71+
const numberOfMissedAnnotations = manualAnnotations.filter((it) => !it.isRemoved && isCorrect(it)).length;
6672
const numberOfUnsureAnnotations = autogeneratedAnnotations.filter(
6773
(it) => !it.isRemoved && it.reviewResult === ReviewResult.Unsure,
6874
).length;
@@ -71,18 +77,26 @@ const QualityPieChart: React.FC<QualityPieChartProps> = function ({ annotationTy
7177
).length;
7278

7379
const data = {
74-
labels: ['Correct', 'Changed', 'Wrong or Removed', 'Unsure', 'Unchecked'],
80+
labels: ['Correct', 'Changed', 'Wrong or Removed', 'Missed', 'Unsure', 'Unchecked'],
7581
datasets: [
7682
{
7783
data: [
7884
numberOfCorrectAnnotations,
7985
numberOfChangedAnnotations,
8086
numberOfWrongOrRemovedAnnotations,
87+
numberOfMissedAnnotations,
8188
numberOfUnsureAnnotations,
8289
numberOfUncheckedAnnotations,
8390
],
84-
backgroundColor: [correctBg, changedBg, wrongOrRemovedBg, unsureBg, uncheckedBg],
85-
borderColor: [correctBorder, changedBorder, wrongOrRemovedBorder, unsureBorder, uncheckedBorder],
91+
backgroundColor: [correctBg, changedBg, wrongOrRemovedBg, missedBg, unsureBg, uncheckedBg],
92+
borderColor: [
93+
correctBorder,
94+
changedBorder,
95+
wrongOrRemovedBorder,
96+
missedBorder,
97+
unsureBorder,
98+
uncheckedBorder,
99+
],
86100
borderWidth: 1,
87101
},
88102
],

0 commit comments

Comments
 (0)