Skip to content

Commit

Permalink
Merge pull request #1110 from AI4Bharat/ana-mas
Browse files Browse the repository at this point in the history
task analytics for superchecker
  • Loading branch information
ishvindersethi22 authored Oct 4, 2024
2 parents a20440d + de9059f commit 67afb18
Show file tree
Hide file tree
Showing 11 changed files with 653 additions and 150 deletions.
10 changes: 6 additions & 4 deletions src/redux/reducers/Progress/TaskAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import C from "../../constants";

let initialState = {
data: [],
originalData: [],
};

const diffAnnotationReview = (payload) => {
Expand All @@ -14,7 +13,11 @@ const diffAnnotationReview = (payload) => {
languages: (value?.language),
annotation_cumulative_tasks_count: (value?.ann_cumulative_tasks_count),
review_cumulative_tasks_count: (value?.rew_cumulative_tasks_count),
diff_annotation_review: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count)
sup_cumulative_tasks_count : (value?.sup_cumulative_tasks_count),
diff_annotation_rev_sup: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count),
diff_annotation_rev: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count),
diff_annotation_sup: (value?.ann_cumulative_tasks_count - value?.sup_cumulative_tasks_count),
diff_rev:(value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count),
};
})
})
Expand All @@ -29,8 +32,7 @@ const reducer = (state = initialState, action) => {
switch (action.type) {
case C.FETCH_TASK_ANALYTICS_DATA:
const data = diffAnnotationReview(action.payload);
return { ...state, originalData: action.payload, data };

return { ...state, data };

default:
return {
Expand Down
6 changes: 5 additions & 1 deletion src/redux/reducers/WorkspaceDetails/GetTaskAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const diffAnnotationReview = (payload) => {
languages: (value?.language),
annotation_cumulative_tasks_count: (value?.ann_cumulative_tasks_count),
review_cumulative_tasks_count: (value?.rew_cumulative_tasks_count),
diff_annotation_review: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count)
sup_cumulative_tasks_count : (value?.sup_cumulative_tasks_count),
diff_annotation_rev_sup: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count),
diff_annotation_rev: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count),
diff_annotation_sup: (value?.ann_cumulative_tasks_count - value?.sup_cumulative_tasks_count),
diff_rev:(value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count),
};
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export default function MetaAnalytics(props) {
</Select>
</FormControl>
{/* <Grid item xs={12} sm={12} md={12} lg={12} xl={12} container justifyContent="space-between" alignItems="center"> */}
<CustomButton label="Submit" sx={{ width: "120px" }} onClick={handleSubmit} disabled={loading} />
<Box display="flex" alignItems="center">
<CustomButton
<CustomButton label="Submit" sx={{ width: "120px" }} onClick={handleSubmit} />
<Box display="flex" sx={{ width: { xs: "100px", md: "120px" }, height: "40px", marginRight: 1 }}alignItems="center">
<CustomButton
onClick={handleClick}
disabled={loading}
sx={{ marginRight: 1 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function SentanceCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Sentance Count
Total Annotated Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalSentanceCount &&
Expand All @@ -117,7 +117,7 @@ export default function SentanceCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Annotation Sentance Count
Pending Review Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalAnnotationSentanceCount &&
Expand All @@ -126,7 +126,7 @@ export default function SentanceCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Quality/Reviewed Sentance Count
Review Completed Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalReviewSentanceCount &&
Expand Down Expand Up @@ -218,4 +218,4 @@ export default function SentanceCountMetaAnalyticsChart(props) {
</Paper>
</Box>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {

export default function WordCountMetaAnalyticsChart(props) {
const {analyticsData,graphCategory} = props
console.log(analyticsData);

const classes = DatasetStyle();
const [totalWordCount, setTotalWordCount] = useState();
const [totalAnnotationWordCount, setTotalAnnotationWordCount] = useState();
Expand Down Expand Up @@ -214,7 +212,7 @@ export default function WordCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Word Count
Total Annotated Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalWordCount &&
Expand All @@ -223,7 +221,7 @@ export default function WordCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Annotation Word Count
Pending Review Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalAnnotationWordCount &&
Expand All @@ -232,7 +230,7 @@ export default function WordCountMetaAnalyticsChart(props) {
</Box>
<Box className={classes.topBarInnerBox}>
<Typography style={{ fontSize: "0.875rem", fontWeight: "400" }}>
Total Quality/Reviewed Word Count
Review Completed Count
</Typography>
<Typography style={{ fontSize: "1.125rem", fontWeight: "400" }}>
{totalReviewWordCount &&
Expand Down
Loading

0 comments on commit 67afb18

Please sign in to comment.