diff --git a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx index eb5ad13e1..2d9d9af24 100644 --- a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx +++ b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx @@ -49,12 +49,14 @@ function useQuery() { } const GetStrength = (score) => { + if (score == 0) return 'Direct'; if (score < 5) return 'Strong'; if (score > 20) return 'Weak'; return 'Average'; }; const GetStrengthColor = (score) => { + if (score === 0) return '#D1B000'; if (score < 5) return 'Green'; if (score > 20) return 'Red'; return 'Orange'; @@ -63,52 +65,52 @@ const GetStrengthColor = (score) => { const GetResultLine = (path, gapAnalysis, key) => { let segmentID = gapAnalysis[key].start.id; return ( - - {getDocumentDisplayName(path.end, true)} } - > - - {getDocumentDisplayName(gapAnalysis[key].start, true)} - {path.path.map((segment) => { - const { text, nextID } = GetSegmentText(segment, segmentID); - segmentID = nextID; - return text; - })} - - - - ({GetStrength(path.score)}:{path.score}) - - } - > - - Generally: lower is better -
- {GetStrength(0)}: Closely connected likely to have - majority overlap -
- {GetStrength(6)}: Connected likely to have partial - overlap -
- {GetStrength(22)}: Weakly connected likely to have - small or no overlap -
-
+
- + {getDocumentDisplayName(path.end, true)} } + > + + {getDocumentDisplayName(gapAnalysis[key].start, true)} + {path.path.map((segment) => { + const { text, nextID } = GetSegmentText(segment, segmentID); + segmentID = nextID; + return text; + })} + + + + ({GetStrength(path.score)}:{path.score}) + + } + > + + Generally: lower is better +
+ {GetStrength(0)}: Directly Linked +
+ {GetStrength(3)}: Closely connected likely to have + majority overlap +
+ {GetStrength(6)}: Connected likely to have partial + overlap +
+ {GetStrength(22)}: Weakly connected likely to have + small or no overlap +
+
-
- +
); }; @@ -129,7 +131,12 @@ export const GapAnalysis = () => { const { apiUrl } = useEnvironment(); const GetStrongPathsCount = (paths) => - Math.max(Object.values(paths).filter((x) => GetStrength(x.score) === 'Strong').length, 3); + Math.max( + Object.values(paths).filter( + (x) => GetStrength(x.score) === 'Strong' || GetStrength(x.score) === 'Direct' + ).length, + 3 + ); useEffect(() => { const fetchData = async () => { @@ -223,16 +230,15 @@ export const GapAnalysis = () => { <> {Object.keys(gapAnalysis).map((key) => ( - -

- {getDocumentDisplayName(gapAnalysis[key].start, true)}{' '} - - - -

+ + +

+ {getDocumentDisplayName(gapAnalysis[key].start, true)} +

+
{Object.values(gapAnalysis[key].paths)