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 7178b92 commit 20a27b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/visualizations/SpreadChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ type ChartCfg = {
seriesLabel = chartText "relativeLabel"
yAxis = {| yAxisBase () with ``type``="logarithmic" |}
dataKey = fun dp ->
let daily = dp.Cases.ConfirmedToday |> Utils.zeroToNone
let total = dp.Cases.Active |> Utils.zeroToNone
let todayCases = dp.Cases.ConfirmedToday |> Utils.zeroToNone
let activeCases = dp.Cases.Active |> Utils.zeroToNone
let value =
(daily, total)
(todayCases, activeCases)
||> Option.map2 (fun daily total ->
let yesterday = total-daily
if yesterday < 2 then nan
Expand Down Expand Up @@ -216,12 +216,12 @@ let renderExplainer (data: StatsData) =
let curPositive, curHospitalized =
data
|> List.rev
|> Seq.choose (fun dp ->
|> List.choose (fun dp ->
match dp.Cases.Active, dp.StatePerTreatment.InHospital with
| Some p, Some h -> Some (p, h)
| _, _ -> None)
|> Seq.take 1
|> Seq.toList |> List.head
|> List.take 1
|> List.head
|> fun (p, h) -> (p,h)

let box (title: string) doublings positive hospitalized =
Expand Down

0 comments on commit 20a27b2

Please sign in to comment.