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

Improve icons integration with {ggwordcloud} #54

Open
mitchelloharawild opened this issue Mar 12, 2021 · 0 comments
Open

Improve icons integration with {ggwordcloud} #54

mitchelloharawild opened this issue Mar 12, 2021 · 0 comments

Comments

@mitchelloharawild
Copy link
Owner

Using icons as masks for a word cloud is pretty cool. Currently you need to use rsvg::rsvg() to format the icons appropriately for the mask argument of ggwordcloud::geom_text_wordcloud_area(). Some simpler function would be nice for this:

library(ggwordcloud)
#> Loading required package: ggplot2
set.seed(42)
ggplot(
  love_words,
  aes(
    label = word, size = speakers,
    color = speakers
  )
) +
  geom_text_wordcloud_area(
  mask = rsvg::rsvg(charToRaw(format(icons::fontawesome$solid$hourglass))),
  rm_outside = TRUE
  ) +
  scale_size_area(max_size = 40) +
  theme_minimal() +
  scale_color_gradient(low = "darkred", high = "red")
#> Some words could not fit on page. They have been removed.

Created on 2021-03-12 by the reprex package (v0.3.0)

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

1 participant