1

This question is a followup to ggraph make filled arrow edges appear in legend (solved), but now I would like to add dynamic tooltips to the nodes to be able to show more information than can be done in a static image.

All the data, what I've tried so far & my R code is in this Rpubs document: https://rpubs.com/friendly/EDA-network

The script can be downloaded with the "code </>" button: https://rstudio-pubs-static.s3.amazonaws.com/912944_f40ed4eb53a242268ef57b7329d21d64.html#

Here is the network diagram I created using igraph and ggraph:

enter image description here

I tried using plotly::ggplotly() but most of the geoms used by ggraph are not recognized by ggplotly and all I got were points.

Here is a mockup of what I'd like to create showing a textbox tooltip when I hover over a node.

enter image description here

Can someone suggest either (a) how I can do this using the ggraph plot as a base or (b) a different network diagram package that could work.

user101089
  • 3,756
  • 1
  • 26
  • 53

1 Answers1

0

Not sure this helps, but for me it worked via:

ggg <- #output from ggraph
thism <- ggg + 
    ggiraph::geom_point_interactive(
         mapping = aes(x, y, tooltip = "string"), colour = "green",alpha=0,size=4)
htmlwidgets::saveWidget(
    girafe(ggobj = thism, width_svg = 20, height_svg = 20,
          options = list(opts_sizing(rescale = FALSE))),
"test2.html")
sheß
  • 484
  • 4
  • 20