Skip to content

Commit 3866fb9

Browse files
committed
Remove overview card for inter annotator
1 parent 4060e81 commit 3866fb9

File tree

7 files changed

+4
-74
lines changed

7 files changed

+4
-74
lines changed

src/components/projects/projectId/overview/ProjectOverview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export default function ProjectOverview() {
108108
function getProjectStats() {
109109
const projectStatsCopy = { ...projectStats };
110110
projectStatsCopy.generalLoading = true;
111-
projectStatsCopy.interAnnotatorLoading = true;
112111
setProjectStats(projectStatsCopy);
113112
const labelingTaskId = overviewFilters.labelingTask?.id;
114113
const dataSliceFindId = overviewFilters.dataSlice?.id;

src/components/projects/projectId/overview/ProjectOverviewCards.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,30 @@ import LoadingIcon from "@/src/components/shared/loading/LoadingIcon";
22
import MultilineTooltip from "@/src/components/shared/multilines-tooltip/MultilineTooltip";
33
import { selectProjectId } from "@/src/reduxStore/states/project";
44
import { CardStats, CardStatsEnum, ProjectOverviewCardsProps } from "@/src/types/components/projects/projectId/project-overview/project-overview";
5-
import { NOT_AVAILABLE } from "@/src/util/constants";
65
import { Tooltip } from "@nextui-org/react";
7-
import { IconBottle, IconBulb, IconClick, IconScale } from "@tabler/icons-react";
6+
import { IconBottle, IconBulb, IconClick } from "@tabler/icons-react";
87
import { useRouter } from "next/router";
98
import { useSelector } from "react-redux";
109

1110
const CARDS_DATA = [
1211
{ color: 'yellow', stats: CardStatsEnum.MANUAL, label: 'Manually labeled', linkLabel: 'Continue labeling', link: 'labeling' },
1312
{ color: 'green', stats: CardStatsEnum.WEAK_SUPERVISION, label: 'Weakly supervised', linkLabel: 'Manage heuristics', link: 'heuristics' },
1413
{ color: 'red', stats: CardStatsEnum.INFORMATION_SOURCE, label: 'Heuristics', linkLabel: 'Manage heuristics', link: 'heuristics' },
15-
{ color: 'blue', stats: CardStatsEnum.INTER_ANNOTATOR, label: 'Inter annotator agreement', linkLabel: 'View records', link: 'data-browser' },
1614
];
1715

1816
export default function ProjectOverviewCards(props: ProjectOverviewCardsProps) {
1917
const router = useRouter();
2018
const projectId = useSelector(selectProjectId);
2119

2220
return (<div>
23-
<dl className="mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4">
21+
<dl className="mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3">
2422
{CARDS_DATA.map((card: CardStats) => (
2523
<div key={card.color} className="relative bg-white pt-5 px-4 pb-12 sm:pt-6 sm:px-6 shadow rounded-lg">
2624
<dt>
2725
<div className={`absolute bg-${card.color}-500 rounded-md p-3`}>
2826
{card.stats == CardStatsEnum.MANUAL && <IconClick className="h-6 w-6 text-white" />}
2927
{card.stats == CardStatsEnum.WEAK_SUPERVISION && <IconBottle className="h-6 w-6 text-white" />}
3028
{card.stats == CardStatsEnum.INFORMATION_SOURCE && <IconBulb className="h-6 w-6 text-white" />}
31-
{card.stats == CardStatsEnum.INTER_ANNOTATOR && <IconScale className="h-6 w-6 text-white" />}
3229
</div>
3330
<p className="ml-16 text-sm font-medium text-gray-500 truncate">{card.label}</p>
3431
</dt>
@@ -40,15 +37,12 @@ export default function ProjectOverviewCards(props: ProjectOverviewCardsProps) {
4037
{props.projectStats.generalPercent[card.stats]}
4138
</p>
4239
</Tooltip>}
43-
<Tooltip content={card.stats !== CardStatsEnum.INTER_ANNOTATOR ? props.projectStats.general[card.stats] : props.projectStats.interAnnotator}
40+
<Tooltip content={props.projectStats.general[card.stats]}
4441
placement="top" color="invert" className="cursor-auto">
4542
{(card.stats == CardStatsEnum.MANUAL || card.stats == CardStatsEnum.WEAK_SUPERVISION) &&
4643
<p className="text-2xl font-semibold text-gray-900">
4744
{props.projectStats.generalStats[card.stats]}
4845
</p>}
49-
{card.stats == CardStatsEnum.INTER_ANNOTATOR && <p className="text-2xl font-semibold text-gray-900">
50-
{props.projectStats.interAnnotatorStat == -1 ? NOT_AVAILABLE : props.projectStats.interAnnotatorStat}
51-
</p>}
5246
</Tooltip>
5347
</>
5448
)}

src/components/projects/projectId/overview/ProjectOverviewHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function ProjectOverviewHeader() {
3636

3737
return (
3838
<nav className="flex" aria-label="Breadcrumb">
39-
<ol role="list" className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-1 items-center">
39+
<ol role="list" className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-1 items-center">
4040
<li>
4141
<div className="flex items-center">
4242
<Tooltip placement="bottom" trigger="hover" color="invert" content={TOOLTIPS_DICT.PROJECT_OVERVIEW.TARGET_TYPE} className="relative z-10 cursor-auto">

src/services/base/project.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,6 @@ export function getGeneralProjectStats(projectId: string, labelingTaskId: string
3030
jsonFetchWrapper(finalUrl, FetchType.GET, onResult);
3131
}
3232

33-
export function getInterAnnotatorMatrix(projectId: string, labelingTaskId: string | null, sliceId: string | null, includeGoldStar: boolean | null, includeAllOrgUser: boolean | null, onResult: (result: any) => void) {
34-
35-
let finalUrl = `${projectEndpoint}/${projectId}/inter-annotator-matrix`;
36-
let somethingAdded = false;
37-
38-
if (labelingTaskId) {
39-
finalUrl += somethingAdded ? '&' : '?';
40-
finalUrl += "labeling_task_id=" + labelingTaskId;
41-
somethingAdded = true;
42-
}
43-
if (sliceId) {
44-
finalUrl += somethingAdded ? '&' : '?';
45-
finalUrl += "only_on_static_slice=" + sliceId;
46-
somethingAdded = true;
47-
}
48-
if (includeGoldStar) {
49-
finalUrl += somethingAdded ? '&' : '?';
50-
finalUrl += "include_gold_star=" + includeGoldStar;
51-
somethingAdded = true;
52-
}
53-
if (includeAllOrgUser) {
54-
finalUrl += somethingAdded ? '&' : '?';
55-
finalUrl += "include_all_org_user=" + includeAllOrgUser;
56-
somethingAdded = true;
57-
}
58-
jsonFetchWrapper(finalUrl, FetchType.GET, onResult);
59-
}
60-
6133

6234
export function getLabelDistribution(projectId: string, labelingTaskId: string | null, sliceId: string | null, onResult: (result: any) => void) {
6335

src/styles/components/projects/projectId/project-overview.module.css

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,4 @@
2424
font: 14px sans-serif;
2525
padding: 5px;
2626
text-align: center;
27-
}
28-
29-
.confusionMatrixTooltip {
30-
position: absolute;
31-
display: none;
32-
width: auto;
33-
height: auto;
34-
background: #F3F4F6;
35-
border: 0 none;
36-
border-radius: 4px;
37-
color: #0C052E;
38-
font: 14px sans-serif;
39-
padding: 5px;
40-
text-align: center;
41-
}
42-
43-
.annotatorMatrixTooltip {
44-
position: absolute;
45-
display: none;
46-
width: auto;
47-
height: auto;
48-
background: #F3F4F6;
49-
border: 0 none;
50-
border-radius: 4px;
51-
color: #0C052E;
52-
font: 14px sans-serif;
53-
padding: 5px;
54-
text-align: center;
5527
}

src/types/components/projects/projectId/project-overview/project-overview.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ export type ProjectStats = {
55
general: {};
66
generalPercent: {};
77
generalStats: {};
8-
interAnnotatorLoading: boolean;
9-
interAnnotator: string;
10-
interAnnotatorStat: number | string;
118
tooltipsArray?: any;
129
};
1310

@@ -27,7 +24,6 @@ export enum CardStatsEnum {
2724
MANUAL = "MANUAL",
2825
WEAK_SUPERVISION = "WEAK_SUPERVISION",
2926
INFORMATION_SOURCE = "INFORMATION_SOURCE",
30-
INTER_ANNOTATOR = "INTER_ANNOTATOR",
3127
}
3228

3329
export type ProjectOverviewFilters = {

src/util/components/projects/projectId/project-overview/project-overview-helper.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export function getEmptyProjectStats(): ProjectStats {
1515
[LabelSource.MANUAL]: NOT_AVAILABLE
1616
},
1717
generalStats: {},
18-
interAnnotatorLoading: false,
19-
interAnnotator: NOT_AVAILABLE,
20-
interAnnotatorStat: -1,
2118
tooltipsArray: []
2219
}
2320
}

0 commit comments

Comments
 (0)