style(participant-intersect): improve display

This commit is contained in:
Gregor Kleen 2020-02-26 21:07:04 +01:00
parent 207f5ca080
commit aef7fad5d8
2 changed files with 5 additions and 3 deletions

View File

@ -140,10 +140,12 @@ postParticipantsIntersectR = do
intersectionHotness :: _ -> _ -> _ -> Centi
intersectionHotness intersections lCid uCid
| sumSize == 0 = 0
| otherwise = realToFrac . max 0 . min 1 $ 2 * intersectSize % sumSize
| intersectSize == 0 = 0
| otherwise = realToFrac . (0.5 +) . (0.5 *) . max 0 . min 1 $ 2 * intersectSize % sumSize
where
sumSize = intersections ! (lCid, lCid) + intersections ! (uCid, uCid)
sumSize = (min `on` (intersections !)) (lCid, lCid) (uCid, uCid)
intersectSize = symmIntersection intersections lCid uCid
showNumber n lCid uCid = n /= 0 || lCid == uCid
lIxed = zip [0..]

View File

@ -22,5 +22,5 @@ $maybe (courses, intersections) <- intersectionsRes
$else
$with n <- symmIntersection intersections lCid uCid
<td .table__td .text--center :uCid == lCid:.table__td--automatic :uCid /= lCid:.heated :uCid /= lCid:style="--hotness: #{toPathPiece (intersectionHotness intersections lCid uCid)}">
$if n /= 0
$if showNumber n lCid uCid
#{n}