Title: | Flowcharts with 'ggplot2' |
---|---|
Description: | Flowcharts can be a useful way to visualise complex processes. This package uses the layered grammar of graphics of 'ggplot2' to create simple flowcharts. |
Authors: | Nicola Rennie [aut, cre, cph] |
Maintainer: | Nicola Rennie <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0.9007 |
Built: | 2024-11-14 03:43:54 UTC |
Source: | https://github.com/nrennie/ggflowchart |
Generates the flowchart
ggflowchart( data, node_data = NULL, layout = "tree", fill = "white", colour = "black", linewidth = 0.5, alpha = 1, text_colour = "black", text_size = 3.88, family = "sans", parse = FALSE, arrow_colour = "black", arrow_size = 0.3, arrow_linewidth = 0.5, arrow_linetype = "solid", arrow_label_fill = "white", x_nudge = 0.35, y_nudge = 0.25, horizontal = FALSE, color = NULL, text_color = NULL, arrow_color = NULL )
ggflowchart( data, node_data = NULL, layout = "tree", fill = "white", colour = "black", linewidth = 0.5, alpha = 1, text_colour = "black", text_size = 3.88, family = "sans", parse = FALSE, arrow_colour = "black", arrow_size = 0.3, arrow_linewidth = 0.5, arrow_linetype = "solid", arrow_label_fill = "white", x_nudge = 0.35, y_nudge = 0.25, horizontal = FALSE, color = NULL, text_color = NULL, arrow_color = NULL )
data |
Data frame or tibble of edges. Must have two columns, first
column are |
node_data |
Data frame or tibble of node information. If not |
layout |
One of |
fill |
Fill colour of nodes. Must be a valid colour name or hex
code, or the name of a column in node_data (quoted or unquoted).
Column names take priority over names of colours. Default |
colour |
Outline colour of nodes. Must be a valid colour name or hex
code. Default |
linewidth |
Width of node outlines. Default 0.5. |
alpha |
Transparency of fill colour in nodes. Default 1. |
text_colour |
Colour of labels in nodes. Must be a valid colour name
or hex code, or the name of a column in node_data (quoted or unquoted).
Column names take priority over names of colours. Default |
text_size |
Font size of labels in nodes. Default 3.88. |
family |
Font family for node labels. Default |
parse |
If TRUE, the labels will be parsed into expressions
and displayed as described in ?plotmath. Default |
arrow_colour |
Colour of arrows. Must be a valid colour name or hex
code. Default |
arrow_size |
Size of arrow head. Default 0.3. |
arrow_linewidth |
Linewidth of arrow lines. Default 0.5. |
arrow_linetype |
Linetype of arrow lines. Default |
arrow_label_fill |
Fill colour of arrow labels. Default |
x_nudge |
Distance from centre of edge of node box in x direction.
Ignored if |
y_nudge |
Distance from centre of edge of node box in y direction.
Ignored if |
horizontal |
Boolean specifying if flowchart should go from left to
right. Default |
color |
Outline colour of nodes - overrides colour. Must be a valid colour name or hex
code. Default |
text_color |
Colour of labels in nodes - overrides text_colour. Must be a valid colour name
or hex code. Default |
arrow_color |
Colour of arrows - overrides arrow_colour. Must be a valid colour name or hex
code. Default |
A ggplot2 object.
data <- tibble::tibble(from = c("A", "A", "A", "B", "C", "F"), to = c("B", "C", "D", "E", "F", "G")) ggflowchart(data)
data <- tibble::tibble(from = c("A", "A", "A", "B", "C", "F"), to = c("B", "C", "D", "E", "F", "G")) ggflowchart(data)