Skip to content

sysbiolab/RGraphSpace

Repository files navigation

RGraphSpace: A lightweight interface between igraph and ggplot2 graphics

CRAN status Lifecycle: stable CRAN downloads License: Artistic-2.0 DOI

Highlights

  • Native ggplot2 interface for igraph objects
  • Coherent rendering of node and edge layers
  • Optimized geoms for high-dimensional data
  • Spatial alignment to external reference frames

Overview

RGraphSpace is an R package that generates ggplot2 graphics for igraph objects (Csardi and Nepusz 2006) within a normalized coordinate system. The package implements new geometries that treat a graph as a single coherent object, synchronizing node and edge layers under standard aesthetic mappings. Node features are resolved on demand, supporting high-dimensional data without expanding node tables. Spatial registration is available at the pixel level, with node coordinates anchored to pixel centers through a half-pixel offset, enabling precise alignment against external reference frames such as images and maps. The package also interoperates with ggraph and tidygraph workflows (Pedersen 2024). Three specialized geoms translate graph data into geometric layers.

  1. geom_nodespace(): Renders network nodes. Extends GeomPoint aesthetic mappings and exposes node state information to the edge layer.

  2. geom_edgespace(): Renders the relationships between nodes. Extends GeomSegment aesthetic mappings; unlike standard segments, it is node-aware and dynamically adjusts start and end points based on node position and size.

  3. geom_graphspace(): A convenience wrapper that calls geom_nodespace() and geom_edgespace() in sequence. Use this for the common case; use the individual geoms directly when independent control of node and edge layers is needed.

Installation in R (>=4.5)

Dependencies to build the vignettes
install.packages("knitr")
install.packages("rmarkdown")
install.packages("remotes")
Development version
remotes::install_github("sysbiolab/RGraphSpace", build_vignettes=TRUE)

Tutorials

Citation

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

Licenses

The RGraphSpace package is distributed under Artistic-2.0

References

  • Csardi G, Nepusz T: The igraph software package for complex network research. InterJournal, Complex Systems 1695. 2006. https://igraph.org

About

A lightweight package for representing large igraph objects in a normalized coordinate system

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors

Languages