ggnetwork
ggnetwork copied to clipboard
Support `graphlayouts`
https://cran.r-project.org/package=graphlayouts
Seems to work out of the box:
library(igraph)
library(graphlayouts)
g <- sample_islands(9,20,0.4,9)
g <- simplify(g)
ggplot(ggnetwork(g, layout = graphlayouts::layout_with_stress(g))) +
geom_edges(aes(x=x,xend=xend,y=y,yend=yend)) +
geom_nodes(aes(x,y))