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

Check legend overlap in maps #148

Closed caldwellst closed 2 months ago

caldwellst commented 2 months ago

In some instances, we get legend overlap in maps.

Placement is defined in the assets in update_iso3_map_settings.R. We are now no longer using the dynamic sizing for maps (they are all 6x4 inches). It might be worth simply placing the legend at the bottom/top or left/right of a plot rather than placing within the plot for a few countries.

caldwellst commented 2 months ago

image

caldwellst commented 2 months ago

Countries with the problem have legends on the inside of the plot, which doesn't work: https://github.com/OCHA-DAP/hdx-signals/blob/main/src-static/update_iso3_map_settings.R#L259. Also would be good to check what is happening in the Somalia example with the numerous white dots.

caldwellst commented 2 months ago

I think easiest solution would be that the legend placement is simply vertical and left unless the map has higher than 3/2 width/height ratio.

zackarno commented 2 months ago

so if w:h ratio is > 3/2 we go with landscape and put legend on bottom ?

what dimensions should we go with for landscape? whats the width limitation?

portrait: 4 x 6 in (w x h) landscape: ?

zackarno commented 2 months ago

ok was misunderstanding -- we always landscape now:

but i suppose if w/h ration is >3/2 we can still put legend on bottom -- probably a horizontal legend?

caldwellst commented 2 months ago

Yep, definitely horizontal! And yes, you got it sorry, meant alternative was bottom and horizontal!