-
Notifications
You must be signed in to change notification settings - Fork 11
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
QC Hospitalisations by age #89
base: master
Are you sure you want to change the base?
Conversation
Places it next to MTL cases by age group figure. Limited to the last 16 weeks in order to not overcrowd the figure. Data is normalized to 100k per age group.
…tribution by age figures
This looks great, thanks! Added range sliders like for the other figures (instead of limiting data to last 16 weeks): Issues remaining:
|
Thanks! What I originally wanted to do is to start with an initial range of the last 16 weeks but because it does not zoom automatically the y-axis was too large and I ended up limiting it to the 16 weeks.
Is this for both figures? I think I removed the last 2 days of the hospitalization data because it is delayed and likely underreported.
The week number is the week number within the year. I added it because the data is weekly to show which week the data point corresponds to. But it could also just say "Week of yyyy-mm-dd". |
I tried Another problem with the range sliders is that there are added some additional empty dates at the beginning and end.
Removing |
Manually sets the min/max date range for the mtl_age_fig and qc_age_fig to the earliest/latest dates in the dataset.
I tried searching for a solution, but it seems that it is not yet implemented in Plotly: Also some discussion for plotly.js (but not solved yet): One possible solution could be to not use the Plotly rangeslider and instead use a Dash slider component outside the figure with a callback to redraw the Plotly figure, e.g. https://dash.plotly.com/basic-callbacks#dash-app-layout-with-figure-and-slider
That makes sense! I removed it initially because the week count labels overlaped with the date labels on the x axis (when the number of date labels increases above a certain number). I think adding "Week of yyyy-mm-dd" in the hover template title is a good option. The title of the plots also says the data is weekly.
Yes, that was it! Removing the last 2 days hides the last week of data (so currently the MTL plot goes until Dec 6 while the QC hospitalisations fig goes to Nov 29 if the last 2 days are removed). Not sure which is best, commented it out for now so that both figures end on the same date.
Not sure why those empty dates are being added (used the same function as all the other figures with a range slider), but manually setting the x axis range seems to resolve this. |
Adds weekly hospitalisations by age group (per 100k).
Hovering also shows the absolute number of new hospitalisations for that week.