wilkox / treemapify

🌳 Draw treemaps in ggplot2
http://wilkox.org/treemapify
213 stars 18 forks source link

use {ggtext} to customize labels in geom_treemap_text() #37

Open gruggeri opened 4 years ago

gruggeri commented 4 years ago

Hi,

Great package! I would like to be able to use {ggtext} to customize the geom_treemap_text(). For instance, when using HTML in the title of a plot, I would use the following code to render it:

+ theme(plot.title = ggtext::element_markdown())

Would it be possible to implement these features for assessing the text rendered with geom_treemap_text()?

Thanks

wilkox commented 4 years ago

Hi Giulia, thanks for your interest in treemapify and for the suggestion!

This is definitely a planned feature and I hope to add it soon. It requires an update to ggfittext, the package that handles text drawing in treemapify, to use the rich text grobs from the gridtext package (which power the rich text features in ggtext).

gruggeri commented 4 years ago

Awesome! Thanks for your reply! Looking forward then!

dickoa commented 2 years ago

Hi @wilkox,

Thanks for this great package. I wanted to know if you have now a way to rich text in geom_treemap_text. Let me know if there's something we can do to help.

Best,

wilkox commented 2 years ago

@dickoa I haven't yet added rich text to treemapify as I'm not totally happy with the implementation in ggfittext. However, as a workaround you can use the treemapify() function to generate a set of treemap tile coordinates, which you can then use to draw rich text labels with ggfittext's geom_fit_text().