whocov / trend_analysis_public

Public version of the trend analysis infrastructure
https://asmodee-infrastructure-handbook.netlify.app/
Other
2 stars 3 forks source link

Small suggestions for plots #3

Closed henryls1 closed 3 years ago

henryls1 commented 3 years ago
  1. Set limits to the net days above expected so it always goes from 0-7 rather than scales automatically each time
  2. You might have already tried this, but some experimentation with ggforce to get country names to be more readable like with PAHO? maybe the plot size could also be changed for the larger vs smaller regions as well?
thibautjombart commented 3 years ago

Thanks for this issue! The first point is now solved via 95489131e1b878ee103e9400615bfd2f1f6e802a.

As for 2) this is a tricky one. I fiddled a lot with parameters of ggrepel with no luck - it does impact the plot, but placement becomes erratic, still with a lot of overlap. ggforce looks great; which feature would you recommend trying?

I think some of the best solutions might be down to interactivity, best handled on the shiny side. But still happy to improve current static figures.

henryls1 commented 3 years ago

Sorry for the error, i meant ggrepel when i said ggforce - I am not super familar with ggforce to be honest.

I agree with the interactivity option, we could try somethin with highchartR or plotly maybe?

As for the static plot, perhaps for busy regions, the top x countries could be labeled and others not? or some sort of options related to this could be set up?

thibautjombart commented 3 years ago

Yes I was thinking plotly as it is ready out of the box for ggplot2 objects. It will not work in github as the platform disables JS inclusions in the README for security reasons, but will work nicely in shiny.

For the busy regions, previous iterations were doing this, but the crowded regions are usually the ones we are less interested in (at the bottom), so the operational impact is slim (and we then have to account for the countries removed in the text). I think for the plot options this would be great, but that may be best handled through interactivity, as a single fixed threshold is unlikely to work for all regions.

What do you think?

henryls1 commented 3 years ago

I think plotly seems like the logical choice to me - i like other interactive packages better style wise, but it's probably not worth reinventing how the plot is done.

I can think of two scenarios for the busy plots:

  1. Someone wants to see an overview - here would could only label the top x% in the y and x axes so it would automatically scale by region?
  2. Someone wants to see a specific subset of countries - use gghighlight to highlight and label that country/countries (via shiny)

On Tue, Apr 27, 2021 at 2:22 PM Thibaut Jombart @.***> wrote:

Yes I was thinking plotly as it is ready out of the box for ggplot2 objects. It will not work in github as the platform disables JS inclusions in the README for security reasons, but will work nicely in shiny.

For the busy regions, previous iterations were doing this, but the crowded regions are usually the ones we are less interested in (at the bottom), so the operational impact is slim (and we then have to account for the countries removed in the text). I think for the plot options this would be great, but that may be best handled through interactivity, as a single fixed threshold is unlikely to work for all regions.

What do you think?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whocov/trend_analysis_public/issues/3#issuecomment-827563408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDSUANNNWLRGMGJL65SYFLTK2UCBANCNFSM43TBEFHQ .

thibautjombart commented 3 years ago

This is now fixed in the interactive version of the plots on the app.