Skip to content

Commit

Permalink
#606: more cleaning up of SpreadChart.fs a little
Browse files Browse the repository at this point in the history
  • Loading branch information
breki committed Oct 24, 2020
1 parent e56bcbc commit 7178b92
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/visualizations/SpreadChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,18 @@ let renderExplainer (data: StatsData) =
|> Seq.toList |> List.head
|> fun (p, h) -> (p,h)

let box (title: string) round positive hospitalized =
let box (title: string) doublings positive hospitalized =
Html.div [
prop.className "box"
prop.children [
Html.h3 title
let times = (1<<<round)
let timesAsManyText = (chartText "timesAsMany")
let caption = sprintf "%d%s" times timesAsManyText
Html.p [
match round with
match doublings with
| 0 -> ""
| _ -> caption
| _ ->
let times = 1<<<doublings
let timesAsManyText = chartText "timesAsMany"
sprintf "%d%s" times timesAsManyText
|> Html.span
]
Html.div [ Html.h4 (string positive)
Expand All @@ -260,7 +260,9 @@ let renderExplainer (data: StatsData) =
chartText "inThreeWeeks", 3
chartText "inFourWeeks", 4 ]
|> List.map (fun (title, doublings) ->
box title doublings (curPositive <<< doublings) (curHospitalized <<< doublings)
box title doublings
(curPositive <<< doublings)
(curHospitalized <<< doublings)
)
]
]
Expand Down

0 comments on commit 7178b92

Please sign in to comment.