- Native ggplot2 interface for igraph objects
- Optimized geoms for large-scale network visualization
- Dual-anchor normalization for precise node and edge alignment
- Spatial alignment of networks with reference maps and images
RGraphSpace is an R package that generates ggplot2 graphics for igraph objects (Csardi and Nepusz 2006), scaling nodes and edges to a unit space. The package implements new ggplot2 prototypes (Wickham 2016) optimized for large-scale network visualization, enabling extensive customization of aesthetics and visual style. A dual-anchor normalization approach ensures that edge endpoints remain pinned to node boundaries regardless of node size, which is particularly useful when graph elements must be spatially aligned with reference maps and images. The package also supports interoperability with ggraph and tidygraph workflows (Pedersen 2024). Three specialized geoms translate graph data into geometric layers.
-
geom_nodespace(): Renders network nodes. ExtendsGeomPointaesthetic mappings and exposes node state information to the edge layer. -
geom_edgespace(): Renders the relationships between nodes. ExtendsGeomSegmentaesthetic mappings; unlike standard segments, it is node-aware and dynamically adjusts start and end points based on node position and size. -
geom_graphspace(): A convenience wrapper that callsgeom_nodespace()andgeom_edgespace()in sequence. Use this for the common case; use the individual geoms directly when independent control of node and edge layers is needed.
install.packages("knitr")
install.packages("rmarkdown")
install.packages("remotes")remotes::install_github("sysbiolab/RGraphSpace", build_vignettes=TRUE)If you use RGraphSpace, please cite:
- Sysbiolab Team (2026). RGraphSpace: A lightweight interface between 'igraph' and 'ggplot2' graphics. R package version 1.3.0. Doi: 10.32614/CRAN.package.RGraphSpace
The RGraphSpace package is distributed under Artistic-2.0
- Wickham H: ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. https://ggplot2.tidyverse.org
- Csardi G, Nepusz T: The igraph software package for complex network research. InterJournal, Complex Systems 1695. 2006. https://igraph.org
- Pedersen T: tidygraph: A Tidy API for Graph Manipulation. R package version 1.3.1. 2024. doi:10.32614/CRAN.package.tidygraph