Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nrennie/ggflowchart

R package for producing flowcharts using ggplot2.
https://github.com/nrennie/ggflowchart

cran r r-package

Last synced: 10 days ago
JSON representation

R package for producing flowcharts using ggplot2.

Awesome Lists containing this project

README

        

[![R-CMD-check](https://github.com/nrennie/ggflowchart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nrennie/ggflowchart/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/nrennie/ggflowchart/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nrennie/ggflowchart?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggflowchart)](https://cran.r-project.org/package=ggflowchart)

# {ggflowchart}

{ggflowchart} is an R package for producing flowcharts using {ggplot2}.

## Installation

Install the package from CRAN using:

```r
install.packages("ggflowchart")
```
or install the development version from GitHub:

```r
remotes::install_github("nrennie/ggflowchart")
```

## Usage

The idea of {ggflowchart} is to create simple flowcharts with minimal effort. Currently, all flowcharts are constructed using the `ggflowchart()` function. For the most basic flowchart, it takes as input a data frame containing (at least) two columns for the start and end points of the edges in the flowchart.

```r
data <- tibble::tibble(from = c("A", "A", "A", "B", "C", "F"),
to = c("B", "C", "D", "E", "F", "G"))
```
The flowchart is then created using `ggflowchart()`.

```r
ggflowchart(data)
```

![](man/figures/README-minimal.png)

See [vignettes](https://nrennie.github.io/ggflowchart/articles/) for further examples of usage.

## Aesthetic mappings

Some arguments can be mapped to aesthetics and some cannot. Arguments that can currently be mapped to aesthetics:

* `fill`: must be a valid colour, or the name of a column in `node_data` if mapping to a variable. Fill colours can be changed with e.g. `scale_fill_manual()`.
* `text_colour` (or `text_color`): must be a valid colour, or the name of a column in `node_data` if mapping to a variable. Colours can be changed with e.g. `scale_colour_manual()`.

Arguments that *may* be mapped to aesthetics in future:

* `colour` (or `color`) for the outline colour of nodes.
* `arrow_colour` (or `arrow_color`)
* `arrow_linewidth`
* `arrow_linetype`
* `alpha`

## Upcoming features

Upcoming features that are currently listed as issues being worked on include:

* Ability to have elliptical (or circular) nodes rather than just rectangles.

If you have a suggestion of an additional feature, or find a bug, please file an issue on the [GitHub repository](https://github.com/nrennie/ggflowchart/issues).

## Contributor guidelines

If you'd like to contribute to {ggflowchart}, I'd welcome your help. If you're making a PR, please follow the guidelines below, to make the collaboration easier:

- You have updated the NEWS and version number in DESCRIPTION.
- You have checked that R CMD check passes with no ERRORs or WARNINGs. If there is a NOTE - please outline what it is in the PR.
- You have checked that `lintr::lint_package()` passes.
- You have checked the list of packages in Imports is still in alphabetical order to enable better tracking of dependencies as the package grows.
- You have not used the base R `|>` pipe (we're not quite ready to specify R 4.1 or higher as a dependency yet!).
- If this is a feature request PR (not a bug fix) please make sure it relates to an issue that has not been assigned to someone else (and tag the issue in the PR description).

If these checks fail, and there is no response from the PR author for 1 month, the PR will be automatically closed.