drag_network | R Documentation |
Drag the nodes of a network to update the layout of the network
drag_network(p, g = NULL)
p |
the network diagram as a ggplot/gg/ggraph object. |
g |
an corresponding igraph object. Default is to extract from the 'ggraph' attribute. |
an updated ggplot/gg/ggraph object
## Not run:
library(igraph)
library(ggraph)
flow_info <- data.frame(from = c(1,2,3,3,4,5,6),
to = c(5,5,5,6,7,6,7))
g = graph_from_data_frame(flow_info)
p <- ggraph(g, layout='nicely') + geom_node_point() + geom_edge_link()
pp <- drag_network(p)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.