View source: R/visualization.R
extractLayout | R Documentation |
Given a ggraph
plot, extract the coordinate layout of
the graph nodes as a two-column matrix.
extractLayout(plot)
plot |
An object of class |
Equivalent to as.matrix(plot$data[c("x", "y")])
.
A matrix with two columns and one row per network node. Each row contains the Cartesian coordinates of the corresponding node.
Brian Neal (Brian.Neal@ucsf.edu)
Hai Yang, Jason Cham, Brian Neal, Zenghua Fan, Tao He and Li Zhang. (2023). NAIR: Network Analysis of Immune Repertoire. Frontiers in Immunology, vol. 14. doi: 10.3389/fimmu.2023.1181825
set.seed(42)
toy_data <- simulateToyData()
net <- buildRepSeqNetwork(toy_data, "CloneSeq", print_plots = TRUE)
my_layout <- extractLayout(net$plots[[1]])
# same as `graph_layout` element in the plot list
all.equal(my_layout, net$plots$graph_layout, check.attributes = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.