diff --git a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx index 78d8d9aea..d145fed18 100644 --- a/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx +++ b/application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx @@ -48,6 +48,70 @@ function useQuery() { return React.useMemo(() => new URLSearchParams(search), [search]); } +const GetStrength = (score) => { + if (score < 5) return 'Strong'; + if (score > 20) return 'Weak'; + return 'Average'; +}; + +const GetStrengthColor = (score) => { + if (score < 5) return 'Green'; + if (score > 20) return 'Red'; + return 'Orange'; +}; + +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 +
+
+ + + +
+ + ); +}; + export const GapAnalysis = () => { const standardOptionsDefault = [{ key: '', text: '', value: undefined }]; const searchParams = useQuery(); @@ -64,18 +128,6 @@ export const GapAnalysis = () => { const [error, setError] = useState(null); const { apiUrl } = useEnvironment(); - const GetStrength = (score) => { - if (score < 5) return 'Strong'; - if (score > 20) return 'Weak'; - return 'Average'; - }; - - const GetStrengthColor = (score) => { - if (score < 5) return 'Green'; - if (score > 20) return 'Red'; - return 'Orange'; - }; - const GetStrongPathsCount = (paths) => Math.max(Object.values(paths).filter((x) => GetStrength(x.score) === 'Strong').length, 3); @@ -120,12 +172,13 @@ export const GapAnalysis = () => { }; return ( -
- - - -