OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
5 stars 0 forks source link

Map Viz Issues #93

Closed zackarno closed 2 months ago

zackarno commented 3 months ago

Can use this issue to document map visualization as we iterate?

Was just using this took take notes as flipped through the map pngs so is not totally comprehensive and perhaps I can reorganize.

I'm putting the pngs I'm looking at in the drive here: Predictive Analytics/HDX Signals/tmp/20240516_map_test so we are looking at the same thing (I guess next time we can set a random seed).

Random important:

General

City placement

just flagging, 1. cities that fall outside of polygons, 2. a couple specific examples where text is hard to read (this is an issue that needs to be fixed more generally though).

PS & SID

Other issues/Ideas

hannahker commented 3 months ago

We should definitely adopt SID and PS <3 How were the bubbles generated for testing? I'm assuming it doesn't matter that most of them are outside a country's boundary?

caldwellst commented 3 months ago

would it be good to include neighboring countries?

For now, keeping extremely simple. Otherwise you start having to deal with edge matching, we don't actually care about the other countries there as the data is entirely to a specific country. Also, if we include other countries, we start needing to maybe include data in those places as well. Which could be nice for context, but I think maybe too complex as you can't necessarily associate cross-border events, so should probably be left to others.

SID

Agree on the SID, but not much we can do. If you have good ideas that create a general map fix for them that's good, but otherwise we wait til we have data and need to send an alert and likely just don't use a map. If they are too small, we don't care.

PS

Yes, good catch. In the generation script, I smooth out and simplify the polygons. Probably can reduce the smoothing based on size. Definitely something we should do, no need for a country list, just automate based on polygon size I think.

MWI: lots of slivers in poly looks funky

Yeah, strange, shall we infill them?

City label size seems to be changing with zoom. Lot's are illegible

Definitely not the case that Mailchimp is editing the PNGs. You can see that my machine produces plots like Mailchimp, I added a folder next to yours in tmp/seth_map_test.

bubble breaks - there are the occasional cases where there is just 1 or 2 bubbles in legend when you'd think there should be 2 or 3 (for example AFG).

I also don't have this problem, see my AFG map. Are you sure everything is running fine on your machine?

hannahker commented 3 months ago

@caldwellst @zackarno did you want me to try and generate the maps on my end?

caldwellst commented 3 months ago

Yes please! https://github.com/OCHA-DAP/hdx-signals/pull/75#issuecomment-2116074917

hannahker commented 3 months ago

Aha yes I remembered seeing the yesterday and then couldn't find where the comment was again 😆

zackarno commented 3 months ago

I also don't have this problem, see my AFG map. Are you sure everything is running fine on your machine?

yeah I'm just running the test/manual/maps/implement_map_test.R script without changing anything. I've tried running directly from terminal as well as R-studio and had the same issue in both

Oddly the only fix, the way that I could get it to reproduce the results of your 2 machines was to run this prior to the purrr$map() call intest/manual/maps/implement_map_test.R

showtext::showtext_opts(dpi = 300)

interestingly adjusting the dpi argument in ggsave() didn't have the desired effect. I wonder if somehow gghdx() is calling/initializing showtext differently on my machine and if that is a result of something in the {gghdx} package itself or something I've done by accident in the repo or elsewhere!

Also found this issue documenting the same: https://github.com/yixuan/showtext/issues/51

caldwellst commented 3 months ago

So annoying. Outside of Markdown, it shouldn't be ggsave() taking in the show text arg for DPI, but it's a mess. Reality is we should move to {ragg}, the modern text package, which deals with all of this and has consistent sizing from font/glyph size in R and pixel output. https://github.com/OCHA-DAP/gghdx/issues/31

Will try and get to this next week.

caldwellst commented 3 months ago

I think the only thing remaining in here is finding an alternative data source to the UN GeoData because it's far too simplified. Should close this and create a smaller, clearer issue so we remember to address that eventually.

hannahker commented 2 months ago

Closing this as main issue remaining is the visuals for small island locations. We'll address this as the need arises.