Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix position #1
Looking forward to the development of this package!. This is more of a feature request than an issue. I was just wondering if it is or will be possible to fix the position of a network layout. i.e. if you were to re-execute this code:
that the layout would always be the same? I don't think this is doable through igraph and perhaps that means also not possible here? My rationale is because it would be great to be able to update the same network temporally showing how edges change - this would only make sense visually if the nodes remain in the same place.
Ah... I just reread your post. You want to plot - change the graph and then plot again..? That is not fully as straightforward yet, but I'll most certainly add a layout = 'manual' in the near future. You can achieve it in igraph by supplying a two-column matrix as the layout in the plot function instead of the name of a layout function...
Currently with ggraph the workaround would be:
layout <- createLayout(graph = gr, layout = 'fr') ggraph(data=layout) + geom_edge_link() # etc... # do something to graph edges attr(layout, 'graph') <- gr ggraph(data=layout) + geom_edge_link() # etc...
Just as a bonus for filing the first issue I implemented it for you right away in 1a64476
# do something to create a data.frame with x and y positions for your nodes (e.g. using createLayout) ggraph(graph = gr, layout = 'manual', node.positions = nodes) + geom_edge_link() # Where 'nodes' are the data.frame with the node position