Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add historical data chart #251

Closed
hnykda opened this issue Mar 24, 2020 · 9 comments
Closed

Add historical data chart #251

hnykda opened this issue Mar 24, 2020 · 9 comments

Comments

@hnykda
Copy link
Contributor

hnykda commented Mar 24, 2020

This is a followup for #233 (so it's blocked by it) to actually visualize the data as a second chart (timeseries).

We'll want to add a second graph (to the "index" page? or where?), which shows the timeline in a particular country up to that point.

@hnykda hnykda changed the title Display historical data in the lines chart Add historical data chart Mar 24, 2020
@lagerros
Copy link
Contributor

lagerros commented Mar 24, 2020

Two suggestions:

  • A single, very wide graph, which includes both the extrapolation but starts from confirmed cases (this will break on mobile probably, and we're making a choice about being primarily desktop oriented)
  • Multiple columns (I still think this will probably be necessary as we keep adding on more information)

Worst case is probably to have a new graph underneath the current, which clashes with displaying explanations of the model

Might also get some inspiration from checking the timeline.js page

@mathijshenquet
Copy link
Contributor

mathijshenquet commented Mar 26, 2020

I think adding it in the same graph would be uninformative because of how tiny the current cases would look (unless you plot it in log scale, which is probably a bad default).

Another issue is that there is severe under reporting of cases (90%+ not reported) so the lines of the models would not match the datapoints. You could transform the datapoint by the estimated underreporting but that kind of goes against the spirit of combining predictions with observed datapoints.

I think its best to put it in a separate graph where we display: Reported active cases, estimated active cases inferred from the data, a piece of the model line. This could replace the 'Active Infections' section. Possibly add an indication to the prediction graph to show how they overlap.

@wolverdude
Copy link
Contributor

So to confirm: this will be a separate chart or part of the same one?

I personally feel it would be more compelling to include lines for confirmed & estimated historical cases on the forecasted chart so that people can see the trend lines for themselves.

But for viewing interventions, it's definitely best to have a separate chart that is logarithmically scaled. It would be great to do something like timeline.js, but I doubt it can be integrated with Plotly, but I could implement something functional though not quite as compelling using Plotly.

@mathijshenquet mathijshenquet self-assigned this Mar 28, 2020
@hnykda
Copy link
Contributor Author

hnykda commented Mar 28, 2020

I think that up until now we didn't want to include the historical to forecasted charts because the information is likely not that useful together (as confirmed are much lower than true active).

I think that #193 and this one is workable and the log scale makes sense here.

Regarding plotly vs. timeline.js. I believe that plotly with these two lines (deaths vs. confirmed) and then either:

  1. scatter/circles with hover on what it is (like really just something like https://plotly.com/javascript/time-series/ or https://plotly.com/javascript/shapes/#circle with hover tool displaying the details/link about the intervention)
  2. graph annotations: https://plotly.com/javascript/text-and-annotations/#multiple-annotations
  3. "true" timeline: https://stackoverflow.com/a/50646793/2319172

would be just the right thing and easy to do (my top candidate is simply 1, maybe combined with 2)

@lagerros
Copy link
Contributor

Hmm... I don't like 1., because it doesn't show you how long the interventions lasted for.

I think @jk3141 's sketch is the best style guidelines, but do understand if we'll have to make trade-offs due to what's feasible to build.

image

@hnykda
Copy link
Contributor Author

hnykda commented Mar 28, 2020

That design is nice in theory but it that:

  1. you have "the right amount" of interventions to display (as it doesn't scale very well with many items IMO, I know we wanted to add some labels to filter out, but I don't believe it could work if someone wouldn't manually really maintained that and kept up to date for each of the country, always guaranteeing it won't be "too much")
  2. you are able to tell the end of the intervention (how do you so for e.g.: "The Government proposes that airlines be able to receive credit guarantees in 2020 amounting to a maximum of SEK 5 billion..." or "The People’s Bank of China provided an additional 500 billion yuan (roughly US$71 billion) of liquidity into the country’s financial system on Tuesday, following 1.2 trillion yuan (over US$170 billion) the previous day"? )
  3. my prior is that it's hard to do in any charting system - have you ever seen it somewhere?

On the other hand, we could have mix of both.

@mathijshenquet
Copy link
Contributor

Hi, I have made a sketch of the dashboard like <@UV6G09Z39> was suggesting in #193
• I used the Oxford dataset as an example, but the code should work with our dataset too after some minimal tweaking. The severity of the measure implemented is a "traffic light" (green=no measures, yellow=some measures, red=lockdown-style measures). You can find it here : https://github.com/lorenzozanisi/covid-viz/blob/master/covid-viz.ipynb . If this can be of any help, I'm happy to keep working on it (the layout certainly needs improving). I'm using Python Bokeh
View in Slack

@hnykda
Copy link
Contributor Author

hnykda commented Apr 5, 2020

Updated in the original description

@hazarane
Copy link

Replaced by #477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants