style(participant-intersect): improve display
This commit is contained in:
parent
207f5ca080
commit
aef7fad5d8
@ -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..]
|
||||
|
||||
|
||||
@ -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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user