# ggraph 2.2.2 (CRAN)

An Implementation of Grammar of Graphics for Graphs and Networks

[Record of 2.2.2](/cran/ggraph/v/2.2.2.md) | Compare: [With 2.2.1](/cran/ggraph/compare/2.2.1...2.2.2.md), [With another package](/compare/ggraph.md#add), [Downloads](/downloads/compare/ggraph.md#add) | [Licences](/cran/ggraph/licences.md) | [SBOM](/cran/ggraph/sbom.md)

Install from CRAN: `install.packages("ggraph")`

Also from:

- r2u (Ubuntu binaries): `sudo apt install r-cran-ggraph` _Listed from recorded download activity on this channel, not from a live index, so read it as last known. Bioconductor packages are named r-bioc-<name> there._
- autoCRAN (openSUSE): `sudo zypper install R-ggraph` _Listed from recorded download activity on this channel, not from a live index, so read it as last known._
- conda-forge: `conda install -c conda-forge r-ggraph` _Listed from recorded download activity on this channel, not from a live index, so read it as last known._

- CRAN checks: All OK (13 platforms)
- CRAN 30-day downloads: 62,758 (down 13.3% on the 30 days before, the worse direction)
- Dependent packages: 78 (69 more suggest it)
- Test coverage: No tests (nothing to run)
- Advisories: None known

## About

[Method](/about/licenses.md)

The grammar of graphics as implemented in ggplot2 is a poor fit for graph and network visualizations due to its reliance on tabular data input. ggraph is an extension of the ggplot2 API tailored to graph visualizations and provides the same flexible approach to building up plots layer by layer.

- Maintainer: Thomas Lin Pedersen
- Licence: [MIT + file LICENSE](/licences/MIT.md)
- Latest release: 24 Aug 2025
- First release: 24 Feb 2017

- [Website](https://ggraph.data-imaginist.com)
- [CRAN page](https://cran.r-project.org/package=ggraph)
- [Source repository](https://github.com/thomasp85/ggraph)
- [Issues](https://github.com/thomasp85/ggraph/issues)
- [Source of every release](https://github.com/cran/ggraph)

[Compare with another package](/compare/ggraph.md#add)

**More details**

- Releases: 14
- Needs compilation: Yes
- Needs R: >= 2.10
- LazyData: TRUE
- RoxygenNote: 7.3.2

**Task views (1)**

- [Network Analysis](/topics/cran/NetworkAnalysis.md)

**Subjects (1) [Method](/about/subjects.md#found)**

- [Graphics systems and devices](/topics/subjects/graphics-devices.md)

**Cite**

#### Package

Run in R for the authors' preferred citation:

`citation("ggraph")`

APA: Pedersen, T. L., & RStudio. (2025). ggraph: An Implementation of Grammar of Graphics for Graphs and Networks (Version 2.2.2) [Computer software]. https://doi.org/10.32614/CRAN.package.ggraph

BibTeX:

```
@Manual{ggraph,
  title  = {ggraph: An Implementation of Grammar of Graphics for Graphs and Networks},
  author = {Pedersen, Thomas Lin and RStudio},
  year   = {2025},
  note   = {R package version 2.2.2},
  doi    = {10.32614/CRAN.package.ggraph},
  url    = {https://CRAN.R-project.org/package=ggraph}
}
```

This package has no citation file, so `citation()` returns this entry built from `DESCRIPTION`.

#### R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA: Balamuta, J. J. (2026). R Observatory: Metrics for ggraph version 2.2.2 [Data set]. HJJB, LLC. Data release v2026-10-29. https://doi.org/10.5281/zenodo.21843040

BibTeX:

```
@misc{robservatoryggraph,
  author    = {Balamuta, James Joseph},
  title     = {{R} {Observatory}: Metrics for {ggraph} version 2.2.2},
  year      = {2026},
  publisher = {HJJB, LLC},
  doi       = {10.5281/zenodo.21843040},
  url       = {https://r-observatory.thecoatlessprofessor.com/packages/ggraph},
  note      = {Data set. Data release v2026-10-29}
}
```

From data release v2026-10-29, which the citation names so these numbers can be found later.

## Health

[Method](/about/checks-health.md)

All 13 check platforms pass.

13 CRAN platforms: 13 OK.

**Extra checks (1)**

- [Memory protection analysis (rchk)](https://raw.githubusercontent.com/kalibera/cran-checks/master/rchk/results/ggraph.out)

Platforms now:

- r-devel-linux-x86_64-debian-clang: OK
- r-devel-linux-x86_64-debian-gcc: OK
- r-devel-linux-x86_64-fedora-clang: OK
- r-devel-linux-x86_64-fedora-gcc: OK
- r-devel-windows-x86_64: OK
- r-oldrel-macos-arm64: OK
- r-oldrel-macos-x86_64: OK
- r-oldrel-windows-x86_64: OK
- r-patched-linux-x86_64: OK
- r-release-linux-x86_64: OK
- r-release-macos-arm64: OK
- r-release-macos-x86_64: OK
- r-release-windows-x86_64: OK

#### Over time

No change since 5 Aug 2026

**As a list (6)**

| Changed | Worst status | OK | Notes | Warnings | Errors |
| --- | --- | ---: | ---: | ---: | ---: |
| 5 Aug 2026 | OK | 13 | 0 | 0 | 0 |
| 1 Aug 2026 | Note | 12 | 1 | 0 | 0 |
| 9 Jun 2026 | OK | 13 | 0 | 0 | 0 |
| 8 Jun 2026 | Error | 12 | 0 | 0 | 1 |
| 25 Apr 2026 | OK | 12 | 0 | 0 | 0 |
| 10 Mar 2026 | Note | 11 | 3 | 0 | 0 |

Since March 2026

[Check results on CRAN](https://cran.r-project.org/web/checks/check_results_ggraph.html)

## Downloads

[Method](/about/downloads.md)

- Downloads in the last 30 days: 93,126 (up 1.5% on the 30 days before, the better direction. It is the sum of 5 channels: CRAN, r2u, autoCRAN, conda-forge and c2d4u.)

CRAN alone: rank among CRAN packages, last 30 days: 435 of 26,553.

| Channel | Downloads in the last 30 days | In the total | Rank in that channel | Change |
| --- | ---: | --- | --- | --- |
| CRAN | 62,758 | yes | 435 of 26,553 | down 13.3% on the 30 days before, the worse direction |
| r2u | 3,742 | yes | 475 of 30,526 | up 246% on the 30 days before, the better direction |
| autoCRAN | 7 | yes | 7,266 of 29,233 | down 58.8% on the 30 days before, the worse direction |
| conda-forge | 26,506 | yes | 279 of 3,828 | up 46.5% on the 30 days before, the better direction |
| c2d4u | 113 | yes | 315 of 7,575 | down 25.2% on the 30 days before, the worse direction |

Other windows: [Last 90 days](/cran/ggraph.md?win=90d#downloads), [Last 365 days](/cran/ggraph.md?win=365d#downloads), [All time](/cran/ggraph.md?win=all#downloads).

To leave channels out of the total, name them in the address, joined by dots: `?off=conda_forge.c2d4u`.

#### Over time

Downloads over time, the last 12 whole months:

| Month | CRAN | r2u | autoCRAN | conda-forge | c2d4u | Sum |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| Oct 2025 | 96,915 | 341 | no figure | 4,580 | 13 | 101,849 |
| Nov 2025 | 89,794 | 483 | no figure | 4,737 | 11 | 95,025 |
| Dec 2025 | 71,339 | 441 | no figure | 5,176 | 20 | 76,976 |
| Jan 2026 | 66,287 | 466 | no figure | 4,541 | 11 | 71,305 |
| Feb 2026 | 62,038 | 530 | no figure | 4,223 | 19 | 66,810 |
| Mar 2026 | 80,169 | 667 | no figure | 5,469 | 20 | 86,325 |
| Apr 2026 | 79,727 | 538 | no figure | 4,246 | 74 | 84,585 |
| May 2026 | 82,707 | 806 | no figure | 4,237 | no figure | 87,750 |
| Jun 2026 | 78,904 | 464 | no figure | 4,166 | no figure | 83,534 |
| Jul 2026 | 77,366 | 467 | 30 | 8,669 | 22 | 86,554 |
| Aug 2026 | 68,483 | 1,090 | 42 | 18,658 | 151 | 88,424 |
| Sep 2026 | 73,645 | 3,730 | 14 | 26,506 | no figure | not whole yet |

The sum stops at Aug 2026: c2d4u has no later month on record yet.

First day on record: CRAN 24 Feb 2017, r2u 7 May 2022, autoCRAN 1 Jul 2026, conda-forge 17 Dec 2017, c2d4u 9 Jul 2018 (no longer updated).

Every channel here counts downloads, so the channels can be stacked and summed for one period. Each channel counts in its own way and covers a different span of years, so read a sum as a rough total, and read a rise where a channel begins as that channel starting, not as growth.

Weeks start on Monday. A first or last week or month that the channel does not cover in full is left out, so every point is a whole period.

Days with no record add nothing to their week or month. For a little-used package that is usually a day with no downloads, but it can also be a gap in collection.

[Compare downloads](/downloads/compare/ggraph.md#add)

## Dependencies

[Method](/about/reverse-dependencies.md)

- Needs: 20
- Dependent packages: 78
- Suggested by: 69

**Needs (20)**

- [cli](/cran/cli.md)
- [cpp11](/cran/cpp11.md)
- [dplyr](/cran/dplyr.md)
- [ggforce](/cran/ggforce.md)
- [ggplot2](/cran/ggplot2.md)
- [ggrepel](/cran/ggrepel.md)
- [graphlayouts](/cran/graphlayouts.md)
- grid
- [igraph](/cran/igraph.md)
- [lifecycle](/cran/lifecycle.md)
- [MASS](/cran/MASS.md)
- [memoise](/cran/memoise.md)
- [rlang](/cran/rlang.md)
- [scales](/cran/scales.md)
- stats
- [tidygraph](/cran/tidygraph.md)
- utils
- [vctrs](/cran/vctrs.md)
- [viridis](/cran/viridis.md)
- [withr](/cran/withr.md)

- Installing it adds: 46 packages, 44.8 MB of source
- Of those, need compilation: 29

**Optional extras (11)**

- [covr](/cran/covr.md)
- [deldir](/cran/deldir.md)
- [gganimate](/cran/gganimate.md)
- [knitr](/cran/knitr.md)
- [network](/cran/network.md)
- [purrr](/cran/purrr.md)
- [rmarkdown](/cran/rmarkdown.md)
- [seriation](/cran/seriation.md)
- [sf](/cran/sf.md)
- [sfnetworks](/cran/sfnetworks.md)
- [tibble](/cran/tibble.md)

**Dependent packages (50 of 78)**

| Package | Title | Downloads in 30 days |
| --- | --- | ---: |
| [arulesViz](/cran/arulesViz.md) | Visualizing Association Rules and Frequent Itemsets | 9,270 |
| [ggdag](/cran/ggdag.md) | Analyze and Create Elegant Directed Acyclic Graphs | 8,499 |
| [clustree](/cran/clustree.md) | Visualise Clusterings at Different Resolutions | 4,191 |
| [scholar](/cran/scholar.md) | Analyse Citation Data from Google Scholar | 2,498 |
| [CausalQueries](/cran/CausalQueries.md) | Make, Update, and Query Binary Causal Models | 1,574 |
| [ggpicrust2](/cran/ggpicrust2.md) | Make 'PICRUSt2' Output Analysis and Visualization Easier | 1,380 |
| [wpa](/cran/wpa.md) | Tools for Analysing and Visualising Viva Insights Data | 1,245 |
| [genekitr](/cran/genekitr.md) | Gene Analysis Toolkit | 1,082 |
| [TransProR](/cran/TransProR.md) | Analysis and Visualization of Multi-Omics Data | 1,080 |
| [multinma](/cran/multinma.md) | Bayesian Network Meta-Analysis of Individual and Aggregate Data | 1,019 |
| [akc](/cran/akc.md) | Automatic Knowledge Classification | 970 |
| [pathfindR](/cran/pathfindR.md) | Enrichment Analysis Utilizing Active Subnetworks | 914 |
| [autograph](/cran/autograph.md) | Automatic Plotting and Theming of Many Graphs | 775 |
| [dyngen](/cran/dyngen.md) | A Multi-Modal Simulator for Spearheading Single-Cell Omics Analyses | 616 |
| [phylopath](/cran/phylopath.md) | Perform Phylogenetic Path Analysis | 597 |
| [tall](/cran/tall.md) | Text Analysis for All | 552 |
| [dsem](/cran/dsem.md) | Dynamic Structural Equation Models | 551 |
| [numbat](/cran/numbat.md) | Haplotype-Aware CNV Analysis from scRNA-Seq | 517 |
| [specr](/cran/specr.md) | Conducting and Visualizing Specification Curve Analyses | 498 |
| [MultiTraits](/cran/MultiTraits.md) | Analyzing and Visualizing Multidimensional Plant Traits | 475 |
| [genBaRcode](/cran/genBaRcode.md) | Analysis and Visualization Tools for Genetic Barcode Data | 472 |
| [ResIN](/cran/ResIN.md) | Conduct Response Item Network (ResIN) Analysis with Social Response Data | 448 |
| [MuTATE](/cran/MuTATE.md) | Multi-Target Automated Tree Engine (MuTATE) | 441 |
| [pkggraph](/cran/pkggraph.md) | Explore the R Package Dependencies on the Comprehensive R Archive Network (CRAN) Like Repositories | 433 |
| [mulea](/cran/mulea.md) | Enrichment Analysis Using Multiple Ontologies and False Discovery Rate | 431 |
| [vennDiagramLab](/cran/vennDiagramLab.md) | Headless Venn Diagram Analysis and Rendering | 430 |
| [vivainsights](/cran/vivainsights.md) | Analyze and Visualize Data from 'Microsoft Viva Insights' | 423 |
| [FCtools](/cran/FCtools.md) | Functional Connectivity Tools | 415 |
| [apisensr](/cran/apisensr.md) | Interface to 'episensr' for Sensitivity Analysis of Epidemiological Results | 411 |
| [inferCSN](/cran/inferCSN.md) | Inferring Cell-Specific Gene Regulatory Network | 407 |
| [birddog](/cran/birddog.md) | Sniffing Emergence and Trajectories in Academic Papers and Patents | 395 |
| [snahelper](/cran/snahelper.md) | 'RStudio' Addin for Network Analysis and Visualization | 389 |
| [ggExametrika](/cran/ggExametrika.md) | Visualization of 'exametrika' Output Using 'ggplot2' | 383 |
| [basket](/cran/basket.md) | Basket Trial Analysis | 382 |
| [SouthParkRshiny](/cran/SouthParkRshiny.md) | Data and 'Shiny' Application for the Tv Show 'SouthPark' | 372 |
| [netcom](/cran/netcom.md) | NETwork COMparison Inference | 367 |
| [stminsights](/cran/stminsights.md) | A 'Shiny' Application for Inspecting Structural Topic Models | 366 |
| [phylepic](/cran/phylepic.md) | Combined Visualisation of Phylogenetic and Epidemiological Data | 364 |
| [xplaineff](/cran/xplaineff.md) | Decomposing Global Feature Effects Based on Feature Interactions | 343 |
| [goat](/cran/goat.md) | Gene Set Analysis Using the Gene Set Ordinal Association Test | 340 |
| [HospitalNetwork](/cran/HospitalNetwork.md) | Building Networks of Hospitals Through Patients Transfers | 337 |
| [finnsurveytext](/cran/finnsurveytext.md) | Analyse Open-Ended Survey Responses in Finnish | 336 |
| [scPairs](/cran/scPairs.md) | Identifying Synergistic Gene Pairs in Single-Cell and Spatial Transcriptomics | 326 |
| [SNPannotator](/cran/SNPannotator.md) | Automated Functional Annotation of Genetic Variants and Linked Proxies | 325 |
| [netropy](/cran/netropy.md) | Statistical Entropy Analysis of Network Data | 325 |
| [DedooseR](/cran/DedooseR.md) | Monitoring and Analyzing Dedoose Qualitative Data Exports | 323 |
| [chemodiv](/cran/chemodiv.md) | Analysing Chemodiversity of Phytochemical Data | 320 |
| [bacontrees](/cran/bacontrees.md) | Bayesian Context Trees for Discrete Sequence Data | 317 |
| [whomds](/cran/whomds.md) | Calculate Results from WHO Model Disability Survey Data | 315 |
| [bartMan](/cran/bartMan.md) | Create Visualisations for BART Models | 311 |

## Code

[Method](/about/code-metrics.md)

Selected function: `get_edges`

- Kind: Public R function
- File: R/edges.R, line 75
- Lines: 37
- Complexity: 3

Called by 41: [`geom_edge_elbow0`](/cran/ggraph.md?fn=geom_edge_elbow0&view=focus#code), [`geom_edge_link`](/cran/ggraph.md?fn=geom_edge_link&view=focus#code), [`geom_edge_link0`](/cran/ggraph.md?fn=geom_edge_link0&view=focus#code), [`geom_edge_arc`](/cran/ggraph.md?fn=geom_edge_arc&view=focus#code), [`geom_edge_arc0`](/cran/ggraph.md?fn=geom_edge_arc0&view=focus#code), [`geom_edge_arc2`](/cran/ggraph.md?fn=geom_edge_arc2&view=focus#code), [`geom_edge_bend`](/cran/ggraph.md?fn=geom_edge_bend&view=focus#code), [`geom_edge_bend0`](/cran/ggraph.md?fn=geom_edge_bend0&view=focus#code), [`geom_edge_bend2`](/cran/ggraph.md?fn=geom_edge_bend2&view=focus#code), [`geom_edge_bundle_force`](/cran/ggraph.md?fn=geom_edge_bundle_force&view=focus#code), [`geom_edge_bundle_force0`](/cran/ggraph.md?fn=geom_edge_bundle_force0&view=focus#code), [`geom_edge_bundle_force2`](/cran/ggraph.md?fn=geom_edge_bundle_force2&view=focus#code), [`geom_edge_bundle_minimal`](/cran/ggraph.md?fn=geom_edge_bundle_minimal&view=focus#code), [`geom_edge_bundle_minimal0`](/cran/ggraph.md?fn=geom_edge_bundle_minimal0&view=focus#code), [`geom_edge_bundle_minimal2`](/cran/ggraph.md?fn=geom_edge_bundle_minimal2&view=focus#code), [`geom_edge_bundle_path`](/cran/ggraph.md?fn=geom_edge_bundle_path&view=focus#code), [`geom_edge_bundle_path0`](/cran/ggraph.md?fn=geom_edge_bundle_path0&view=focus#code), [`geom_edge_bundle_path2`](/cran/ggraph.md?fn=geom_edge_bundle_path2&view=focus#code), [`geom_edge_density`](/cran/ggraph.md?fn=geom_edge_density&view=focus#code), [`geom_edge_diagonal`](/cran/ggraph.md?fn=geom_edge_diagonal&view=focus#code), [`geom_edge_diagonal0`](/cran/ggraph.md?fn=geom_edge_diagonal0&view=focus#code), [`geom_edge_diagonal2`](/cran/ggraph.md?fn=geom_edge_diagonal2&view=focus#code), [`geom_edge_elbow`](/cran/ggraph.md?fn=geom_edge_elbow&view=focus#code), [`geom_edge_elbow2`](/cran/ggraph.md?fn=geom_edge_elbow2&view=focus#code), [`geom_edge_fan`](/cran/ggraph.md?fn=geom_edge_fan&view=focus#code), [`geom_edge_fan0`](/cran/ggraph.md?fn=geom_edge_fan0&view=focus#code), [`geom_edge_fan2`](/cran/ggraph.md?fn=geom_edge_fan2&view=focus#code), [`geom_edge_hive`](/cran/ggraph.md?fn=geom_edge_hive&view=focus#code), [`geom_edge_hive0`](/cran/ggraph.md?fn=geom_edge_hive0&view=focus#code), [`geom_edge_hive2`](/cran/ggraph.md?fn=geom_edge_hive2&view=focus#code), [`geom_edge_link2`](/cran/ggraph.md?fn=geom_edge_link2&view=focus#code), [`geom_edge_loop`](/cran/ggraph.md?fn=geom_edge_loop&view=focus#code), [`geom_edge_loop0`](/cran/ggraph.md?fn=geom_edge_loop0&view=focus#code), [`geom_edge_parallel`](/cran/ggraph.md?fn=geom_edge_parallel&view=focus#code), [`geom_edge_parallel0`](/cran/ggraph.md?fn=geom_edge_parallel0&view=focus#code), [`geom_edge_parallel2`](/cran/ggraph.md?fn=geom_edge_parallel2&view=focus#code), [`geom_edge_span`](/cran/ggraph.md?fn=geom_edge_span&view=focus#code), [`geom_edge_span0`](/cran/ggraph.md?fn=geom_edge_span0&view=focus#code), [`geom_edge_span2`](/cran/ggraph.md?fn=geom_edge_span2&view=focus#code), [`geom_edge_point`](/cran/ggraph.md?fn=geom_edge_point&view=focus#code), [`geom_edge_tile`](/cran/ggraph.md?fn=geom_edge_tile&view=focus#code)

Calls 6: [`data_frame0`](/cran/ggraph.md?fn=data_frame0&view=focus#code), [`format_short_edges`](/cran/ggraph.md?fn=format_short_edges&view=focus#code), [`collect_edges`](/cran/ggraph.md?fn=collect_edges&view=focus#code), [`format_long_edges`](/cran/ggraph.md?fn=format_long_edges&view=focus#code), [`collapse_all_edges`](/cran/ggraph.md?fn=collapse_all_edges&view=focus#code), [`collapse_dir_edges`](/cran/ggraph.md?fn=collapse_dir_edges&view=focus#code)

Paths: 2 steps each way.

Called by 41:

- [`geom_edge_elbow0`](/cran/ggraph.md?fn=geom_edge_elbow0&view=focus#code), called by 1
  - [`autograph.default`](/cran/ggraph.md?fn=autograph.default&view=focus#code)
- [`geom_edge_link`](/cran/ggraph.md?fn=geom_edge_link&view=focus#code), called by 1
  - [`autograph.default`](/cran/ggraph.md?fn=autograph.default&view=focus#code)
- [`geom_edge_link0`](/cran/ggraph.md?fn=geom_edge_link0&view=focus#code), called by 1
  - [`autograph.default`](/cran/ggraph.md?fn=autograph.default&view=focus#code)
- [`geom_edge_arc`](/cran/ggraph.md?fn=geom_edge_arc&view=focus#code)
- [`geom_edge_arc0`](/cran/ggraph.md?fn=geom_edge_arc0&view=focus#code)
- [`geom_edge_arc2`](/cran/ggraph.md?fn=geom_edge_arc2&view=focus#code)
- [`geom_edge_bend`](/cran/ggraph.md?fn=geom_edge_bend&view=focus#code)
- [`geom_edge_bend0`](/cran/ggraph.md?fn=geom_edge_bend0&view=focus#code)
- [`geom_edge_bend2`](/cran/ggraph.md?fn=geom_edge_bend2&view=focus#code)
- [`geom_edge_bundle_force`](/cran/ggraph.md?fn=geom_edge_bundle_force&view=focus#code)
- [`geom_edge_bundle_force0`](/cran/ggraph.md?fn=geom_edge_bundle_force0&view=focus#code)
- [`geom_edge_bundle_force2`](/cran/ggraph.md?fn=geom_edge_bundle_force2&view=focus#code)
- [`geom_edge_bundle_minimal`](/cran/ggraph.md?fn=geom_edge_bundle_minimal&view=focus#code)
- [`geom_edge_bundle_minimal0`](/cran/ggraph.md?fn=geom_edge_bundle_minimal0&view=focus#code)
- [`geom_edge_bundle_minimal2`](/cran/ggraph.md?fn=geom_edge_bundle_minimal2&view=focus#code)
- and 26 more

Calls 6:

- [`data_frame0`](/cran/ggraph.md?fn=data_frame0&view=focus#code)
- [`format_short_edges`](/cran/ggraph.md?fn=format_short_edges&view=focus#code), calls 2
  - [`add_edge_coordinates`](/cran/ggraph.md?fn=add_edge_coordinates&view=focus#code)
  - [`check_short_edges`](/cran/ggraph.md?fn=check_short_edges&view=focus#code)
- [`collect_edges`](/cran/ggraph.md?fn=collect_edges&view=focus#code)
- [`format_long_edges`](/cran/ggraph.md?fn=format_long_edges&view=focus#code), calls 1
  - [`check_long_edges`](/cran/ggraph.md?fn=check_long_edges&view=focus#code)
- [`collapse_all_edges`](/cran/ggraph.md?fn=collapse_all_edges&view=focus#code)
- [`collapse_dir_edges`](/cran/ggraph.md?fn=collapse_dir_edges&view=focus#code)

The open file in the files map is `R/edges.R`.

- Functions: 12
- Lines: 155
- Calls that stay inside it: 9
- Calls to other files: 1, to 1
- Calls from other files: 131, from 20

It calls: `R/utils.R` (1 call)

Called from: `R/geom_edge_bundle_force.R` (9 calls), `R/geom_edge_arc.R` (9 calls), `R/geom_edge_bend.R` (9 calls), `R/geom_edge_bundle_minimal.R` (9 calls), `R/geom_edge_bundle_path.R` (9 calls), `R/geom_edge_diagonal.R` (9 calls), `R/geom_edge_elbow.R` (9 calls), `R/geom_edge_fan.R` (9 calls), `R/geom_edge_hive.R` (9 calls), `R/geom_edge_link.R` (9 calls), `R/geom_edge_parallel.R` (9 calls), `R/geom_edge_span.R` (9 calls), and 8 more

| Function in edges.R | Calls in other files |
| --- | --- |
| [`get_edges`](/cran/ggraph.md?fn=get_edges&view=focus#code) selected | [`data_frame0`](/cran/ggraph.md?fn=data_frame0&view=focus#code) |
| [`add_edge_coordinates`](/cran/ggraph.md?fn=add_edge_coordinates&view=focus#code) | nothing outside this file |
| [`check_long_edges`](/cran/ggraph.md?fn=check_long_edges&view=focus#code) | nothing outside this file |
| [`check_short_edges`](/cran/ggraph.md?fn=check_short_edges&view=focus#code) | nothing outside this file |
| [`collapse_all_edges`](/cran/ggraph.md?fn=collapse_all_edges&view=focus#code) | nothing outside this file |

**More functions (7)**

| Function in edges.R | Calls in other files |
| --- | --- |
| [`collapse_dir_edges`](/cran/ggraph.md?fn=collapse_dir_edges&view=focus#code) | nothing outside this file |
| [`collect_edges`](/cran/ggraph.md?fn=collect_edges&view=focus#code) | nothing outside this file |
| [`collect_edges.default`](/cran/ggraph.md?fn=collect_edges.default&view=focus#code) | nothing outside this file |
| [`complete_edge_aes`](/cran/ggraph.md?fn=complete_edge_aes&view=focus#code) | nothing outside this file |
| [`expand_edge_aes`](/cran/ggraph.md?fn=expand_edge_aes&view=focus#code) | nothing outside this file |
| [`format_long_edges`](/cran/ggraph.md?fn=format_long_edges&view=focus#code) | nothing outside this file |
| [`format_short_edges`](/cran/ggraph.md?fn=format_short_edges&view=focus#code) | nothing outside this file |


17 files with no calls to or from another: `R/edge_colourbar.R`, `R/facet_edges.R`, `R/facet_nodes.R`, `R/geom_edge.R`, `R/gganimate.R`, `R/parallelPath.R`, `R/scale_edge_alpha.R`, `R/scale_edge_colour.R`, `R/scale_edge_fill.R`, `R/scale_edge_linetype.R`, `R/scale_edge_shape.R`, `R/scale_edge_size.R`, `R/scale_edge_width.R`, `R/scale_label_size.R`, `R/zzz.R`, `src/lineCutter.cpp`, `src/pathAttr.cpp`.

The whole package has 374 function names in 95 files and 482 calls between them. Most calls between files: `R/cpp11.R` and `src/circlePack.cpp` (11 calls), `R/cpp11.R` and `src/nodes.h` (10 calls), `R/edges.R` and `R/geom_edge_arc.R` (9 calls), `R/edges.R` and `R/geom_edge_bend.R` (9 calls), `R/edges.R` and `R/geom_edge_bundle_force.R` (9 calls).

Graph: the whole call graph has 264 function names that take part in a call and 482 calls between them, set out in 7 layers with callers before what they call. Of these calls, 1 closes a loop and runs the other way. 110 function names have no calls and are left out. Called by the most functions: `aes_intersect` (55), `expand_edge_aes` (45), `complete_edge_aes` (45), `get_edges` (41), `data_frame0` (32). Calling the most functions: `autograph.default` (7), `get_edges` (6), `layout_tbl_graph_cactustree` (6), `layout_tbl_graph_htree` (6), `layout_tbl_graph_partition` (6).

Most connected functions: [`aes_intersect`](/cran/ggraph.md?fn=aes_intersect&view=focus#code) 55, [`get_edges`](/cran/ggraph.md?fn=get_edges&view=focus#code) 47, [`complete_edge_aes`](/cran/ggraph.md?fn=complete_edge_aes&view=focus#code) 46, [`expand_edge_aes`](/cran/ggraph.md?fn=expand_edge_aes&view=focus#code) 45, [`data_frame0`](/cran/ggraph.md?fn=data_frame0&view=focus#code) 32, [`combine_layout_nodes`](/cran/ggraph.md?fn=combine_layout_nodes&view=focus#code) 24

To select another function, add ?fn=NAME to this address.

The call graph also has an address of its own: /cran/ggraph/graph.md?fn=get_edges&view=focus

- Functions: 407
- Public exports: 242
- Lines of R code: 14,649
- Median complexity: 1

**Functions (407)**

| Function (sorted, low to high) | Kind | File | Lines | Complexity |
| --- | --- | --- | ---: | ---: |
| [`autograph`](/cran/ggraph.md?fn=autograph#code) | Public | R/autograph.R | 3 | 1 |
| [`circle`](/cran/ggraph.md?fn=circle#code) | Public | R/geometry.R | 3 | 1 |
| [`collect_connections`](/cran/ggraph.md?fn=collect_connections#code) | Public | R/connections.R | 3 | 1 |
| [`collect_edges`](/cran/ggraph.md?fn=collect_edges#code) | Public | R/edges.R | 3 | 1 |
| [`create_layout`](/cran/ggraph.md?fn=create_layout#code) | Public | R/layout.R | 10 | 2 |
| [`edge_angle`](/cran/ggraph.md?fn=edge_angle#code) | Public | R/utils.R | 5 | 1 |
| [`ellipsis`](/cran/ggraph.md?fn=ellipsis#code) | Public | R/geometry.R | 9 | 1 |
| [`facet_edges`](/cran/ggraph.md?fn=facet_edges#code) | Public | R/facet_edges.R | 39 | 3 |
| [`facet_graph`](/cran/ggraph.md?fn=facet_graph#code) | Public | R/facet_graph.R | 45 | 1 |
| [`facet_nodes`](/cran/ggraph.md?fn=facet_nodes#code) | Public | R/facet_nodes.R | 39 | 3 |
| [`geom_axis_hive`](/cran/ggraph.md?fn=geom_axis_hive#code) | Public | R/geom_axis_hive.R | 30 | 1 |
| [`geom_conn_bundle`](/cran/ggraph.md?fn=geom_conn_bundle#code) | Public | R/geom_conn_bundle.R | 34 | 1 |

This page lists 1 to 12 of 407 functions. [Next](/cran/ggraph.md?sort=name&order=asc&fpage=2#functions)

**Size and composition**

#### Lines by kind (29,042)

| Kind | Lines | Share |
| --- | ---: | ---: |
| R code | 14,649 | 50% |
| Documentation | 11,251 | 39% |
| Guides | 1,213 | 4% |
| Compiled code | 1,929 | 7% |

#### Lines by language

| Language | Lines | Share |
| --- | ---: | ---: |
| R | 14,649 | 50% |
| Rd | 11,251 | 39% |
| C++ | 1,725 | 6% |
| Vignettes | 1,213 | 4% |
| C | 204 | 0.7% |

Languages are counted from file extensions.

- Files: 224
- R functions: 282
- Compiled functions: 138
- Object systems: S3: 25 methods
- Deprecated functions: 11

**Complexity**

- Median: 1
- Mean: 2.03
- Highest: 26
- Median lines per function: 19

_About complexity: Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only._

**Call graph figures**

- R functions: 282
- Calls: 342
- Unconnected: 104
- Groups: 12

**Growth (14 releases)**

Total lines by release: from 14,539 (on 24 Feb 2017) to 29,042 (on 24 Aug 2025). The lowest is 14,539 and the highest is 29,042.

**Release changes**

[Both releases side by side](/cran/ggraph/compare/2.2.1...2.2.2.md)

**2.2.1 to 2.2.2**, 7 Mar 2024 to 24 Aug 2025

- Files changed: 126
- Lines added: 7,041
- Lines deleted: 2,603
- Exports: No change

**Changed measures (9)**

| Measure | Subject | Before | After |
| --- | --- | ---: | ---: |
| Total lines | Structure | 24,611 | 29,042 |
| Lines of R code | Structure | 11,135 | 14,649 |
| Compiled share | Languages | 8% | 7% |
| Lines of documentation | Documentation | 10,334 | 11,251 |
| Arguments documented | Documentation | 92% | 92% |
| Mean complexity | Complexity | 2.04 | 2.03 |
| Lines per function (mean) | Complexity | 15.51 | 25.24 |
| Call edges | Call graph | 344 | 342 |
| Mean connections | Call graph | 2.44 | 2.43 |

**Most changed files (12 of 126)**

| File | Lines added | Lines deleted |
| --- | ---: | ---: |
| `R/geom_edge.R` | 412 | 130 |
| `R/geom_edge_bundle_force.R` | 308 | 99 |
| `R/geom_edge_bundle_path.R` | 278 | 93 |
| `R/geom_edge_elbow.R` | 266 | 98 |
| `R/geom_edge_bundle_minimal.R` | 242 | 82 |
| `R/theme_graph.R` | 201 | 121 |
| `R/scale_edge_colour.R` | 247 | 64 |
| `R/scale_edge_fill.R` | 247 | 64 |
| `MD5` | 125 | 125 |
| `R/geom_edge_arc.R` | 175 | 62 |
| `inst/doc/Edges.html` | 117 | 118 |
| `R/geom_edge_fan.R` | 172 | 62 |

## Tests

[Method](/about/coverage.md)

The package was built and has no tests to run.

- Lines of tests: 0
- Exports named in tests: 0%

**Test suite**

- Has tests: No
- Test frameworks: No tests in this release
- Test lines per line of code: 0

## Documentation

[Method](/about/code-metrics.md)

- Exports documented: 100%
- Arguments documented: 91.6%
- Return value documented: 33.9%
- Help pages with examples: 44%
- Examples run in checks: 100%

**Guides (4)**

- [Edges](https://cran.r-project.org/web/packages/ggraph/vignettes/Edges.html)
- [Layouts](https://cran.r-project.org/web/packages/ggraph/vignettes/Layouts.html)
- [Nodes](https://cran.r-project.org/web/packages/ggraph/vignettes/Nodes.html)
- [tidygraph and ggraph](https://cran.r-project.org/web/packages/ggraph/vignettes/tidygraph.html)

**Other documentation**

- README: Yes, 581 words
- Release notes file: Yes
- Help pages: 84
- Lines of documentation: 11,251

## Datasets

[Method](/about/objects.md)

| Dataset | Size | Columns |
| --- | --- | --- |
| [flare](/cran/ggraph/data/flare.md), The class hierarchy of the flare visualization library | length 3 |  |
| [highschool](/cran/ggraph/data/highschool.md), Friendship among high school boys | 506 × 3 | from, to, year |
| [whigs](/cran/ggraph/data/whigs.md), Membership network of American Whigs | 254 × 7 |  |

## People

[Method](/about/author-identity.md)

- [Thomas Lin Pedersen](/people/Thomas+Lin+Pedersen.md): Maintainer since 1.0.0 (2017), author. ORCID https://orcid.org/0000-0002-5147-4711
- [RStudio](/people/RStudio.md): Copyright holder

## Repository

[Method](/about/repo-signals.md#figures)

[thomasp85](/repos/thomasp85.md) / [ggraph](https://github.com/thomasp85/ggraph) on github.com

- Stars: 1,121 (up 0.18% on 30 days ago, the better direction)
- Forks: 114
- Open issues: 51
- Last commit: 25 Aug 2025

**Activity**

- Commits: 408
- Open pull requests: 8
- Tagged releases: 12
- Latest tagged release: v2.2.2, 25 Aug 2025
- In development: Default branch at 2.2.2.9000, ahead of CRAN 2.2.2 (checked 2026-10-25)
- Issues closed in: 1,094 days (median)
- Pull requests closed in: 17 days (median)
- Pull requests merged: 66%
- Created: 13 Jan 2016
- Licence file reads as: –

**Development practices (12)**

| Kind | Found |
| --- | --- |
| Continuous integration | GitHub Actions, R CMD check workflow The `R CMD check` workflow runs on Linux, macOS and Windows, and on R-devel |
| Governance and community | Code of conduct |
| Docs source | README.Rmd, pkgdown GitHub Pages site last deployed 2025-08-25 The repository has a site deploy workflow pkgdown site last built 2025-08-25 |
| Coverage | Coverage reporting (Codecov) |
| CRAN release process | cran-comments.md, revdep/ |
| Lint, format, editor | Air, VS Code |

[Across thomasp85](/repos/thomasp85.md#practices)

## History

[Method](/about/archive.md)

The line runs from the first release of ggraph on 24 Feb 2017 to 29 Oct 2026 and marks all 14 of its releases.

| Version | Released | R |
| --- | --- | ---: |
| [2.2.2](/cran/ggraph/v/2.2.2.md) current | 24 Aug 2025 | 4.5.1 |
| [2.2.1](/cran/ggraph/v/2.2.1.md) | 7 Mar 2024 | 4.3.3 |
| [2.2.0](/cran/ggraph/v/2.2.0.md) | 27 Feb 2024 | 4.3.2 |
| [2.1.0](/cran/ggraph/v/2.1.0.md) | 9 Oct 2022 | 4.2.1 |
| [2.0.6](/cran/ggraph/v/2.0.6.md) | 8 Aug 2022 | 4.2.1 |
| [2.0.5](/cran/ggraph/v/2.0.5.md) | 23 Feb 2021 | 4.0.4 |
| [2.0.4](/cran/ggraph/v/2.0.4.md) | 16 Nov 2020 | 4.0.3 |
| [2.0.3](/cran/ggraph/v/2.0.3.md) | 20 May 2020 | 4.0.0 |

**Earlier versions (6)**

| Version | Released | R | Events |
| --- | --- | ---: | --- |
| [2.0.2](/cran/ggraph/v/2.0.2.md) | 17 Mar 2020 | 3.6.3 |  |
| [2.0.1](/cran/ggraph/v/2.0.1.md) | 7 Feb 2020 | 3.6.2 |  |
| [2.0.0](/cran/ggraph/v/2.0.0.md) | 2 Sep 2019 | 3.6.1 | Licence: MIT + file LICENSE |
| [1.0.2](/cran/ggraph/v/1.0.2.md) | 7 Jul 2018 | 3.5.1 |  |
| [1.0.1](/cran/ggraph/v/1.0.1.md) | 29 Jan 2018 | 3.4.3 |  |
| [1.0.0](/cran/ggraph/v/1.0.0.md) | 24 Feb 2017 | 3.3.2 |  |

Relicensed from GPL-3 in version 2.0.0.

**Release notes (2.2.2)**

- Fixed a bug in the collapse functionality of `get_edges()` (#362)
- General upkeep and compatibility with ggplot2 v4.0.0

---

R Observatory is independent of the R Project, CRAN and Bioconductor. The same page for people is at /cran/ggraph, and every address is listed at /llms.txt.
