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 c5d0ec8 commit e56bcbc
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/visualizations/SpreadChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,24 @@ let renderExplainer (data: StatsData) =
|> Seq.toList |> List.head
|> fun (p, h) -> (p,h)

let box (title: string) times positive hospitalized =
let box (title: string) round 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 times with
| 0 -> Html.span ""
| 1 -> Html.span (sprintf "%d%s" (1<<<times) (chartText "timesAsMany"))
| _ -> Html.span (sprintf "%d%s" (1<<<times) (chartText "timesAsMany"))
match round with
| 0 -> ""
| _ -> caption
|> Html.span
]
Html.div [ Html.h4 (string positive); Html.p (chartText "activeCases") ]
Html.div [ Html.h4 (string hospitalized); Html.p (chartText "hospitalized") ]
Html.div [ Html.h4 (string positive)
Html.p (chartText "activeCases") ]
Html.div [ Html.h4 (string hospitalized)
Html.p (chartText "hospitalized") ]
]
]

Expand Down

0 comments on commit e56bcbc

Please sign in to comment.