Skip to content
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

Add ggtext::geom_textbox option to insert the annotation #45

Open
Edouard-Legoupil opened this issue Feb 14, 2022 · 2 comments
Open

Add ggtext::geom_textbox option to insert the annotation #45

Edouard-Legoupil opened this issue Feb 14, 2022 · 2 comments

Comments

@Edouard-Legoupil
Copy link

Great tool - thanks!!

Could be a nice improvement to add the option of getting the annotation R statement as ggtext::geom_textbox (together with related styling options...) as this would give a lot more options to style the annotation - ideally adding also the capacity to link the geom_textbox to the area of interest in the chart with a geom_curve arrows!

Currently did that manually - see example...

geom_curve(aes(xend = 10.9, yend = 2959.9, x = 6.9, y = 28668.7), size = 2, color = "tan", arrow = arrow(length = unit(0.07, "npc"))) + ggtext::geom_textbox(data = data.frame(x = 6.9, y = 28668.7, label = "Why so many people are using **other** category? \n Is there an important missing category ?"), mapping = aes(x = x, y = y, label = label), width = unit(0.6, "npc"), family = "Lato", size = 7, fill = "cornsilk", inherit.aes = FALSE)

@MattCowgill
Copy link
Owner

Thank you @Edouard-Legoupil, I'm glad you find the package useful.

I agree adding a ggtext::geom_textbox() option for an annotation layer would be good.

I see three options for this:

  1. Use ggtext::geom_textbox() for all text annotations;
  2. Offer a geom_textbox() option for an annotation (in the same way people can choose text / curve / etc)
  3. Detect whether the user has ggtext installed; if so, use geom_textbox(), if not use geom_text().

I guess I'm leaning towards (3) but would appreciate thoughts

@Edouard-Legoupil
Copy link
Author

Hi @MattCowgill thanks for considering the suggestion! Indeed agreed (3) !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants