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

add offset to food insecurity P labels (or legend) #189

Closed zackarno closed 1 week ago

zackarno commented 3 weeks ago

Can't read the P3 label in the latest email from today. We could either create an offset for the label from most recent date point or just have a 3 category legend?

image
caldwellst commented 2 weeks ago

Good catch! We are already using ggrepel::geom_text_repel(), it seems it hasn't worked in this instance. I didn't do an offset because often, the P5 data was 0%, so sat on the x-axis, so geom_text_repel() has the advantage of also lifting the label above the line, as well as away from the points. However, failed here! Maybe we could adjust the weight of the geom_point() values so that this doesn't happen again? I forget how the force is set in {ggrepel}, but I imagine there's a way to weight various geoms.

caldwellst commented 1 week ago

Addressed in #199. May continue to be finicky, but hard to tell until we come across new cases.