thomasp85 / ggraph

Grammar of Graph Graphics
https://ggraph.data-imaginist.com
Other
1.08k stars 116 forks source link

Support for ggtext #297

Open fmgarciadiaz opened 3 years ago

fmgarciadiaz commented 3 years ago

Hi! Could it be possible to add support for ggtext rich text in the geom_node_text function? That'd be great!

fmgarciadiaz commented 3 years ago

That could be as simple as adding geom <- GeomRichTextoption in the geom_node_text function, and could provide the opportunity to add rich text and images to node description =)

kelly-sovacool commented 3 years ago

The default settings for fill, label.color, & label.padding in ggtext::GeomRichText behave more like ggraph::geom_node_label(). So using GeomRichText is very easy to do in geom_node_label() (I got a start here). But for within geom_node_text() I'm unsure how best to override the GeomRichText defaults to get rid of the fill & outline as a default behavior, and not override them if a user wants to manually override the defaults.

fmgarciadiaz commented 3 years ago

That's amazing! TRUE, geom_node_label is the way to go. =)