flowchart: Create a flowchart object

View source: R/flowchart.R

flowchartR Documentation

Create a flowchart object

Description

This function initializes a flowchart object, which is essentially a list of boxes with the class 'Gmisc_list_of_boxes'. It serves as the starting point for the S3 pipeline, allowing for fluent chaining of ['align'], ['spread'], ['move'], and ['connect'] operations.

Usage

flowchart(..., default_box_fn = boxGrob)

Arguments

...

Either a set of ['boxGrob'] objects, text strings, or lists of these. Text strings will be automatically wrapped in ['boxGrob'] (or 'default_box_fn').

default_box_fn

The function to use for converting text/content into a box (default: ['boxGrob']).

Value

A 'list' of class 'Gmisc_list_of_boxes'.

See Also

Other flowchart components: align(), append(), boxGrob(), boxHeaderGrob(), boxPropGrob(), boxShapes, connectGrob(), coords(), distance(), insert(), move(), moveBox(), spread()

Examples

library(grid)
grid.newpage()

# Create a flowchart with auto-conversion of text
fc <- flowchart(
  start = "Start",
  process = "Process",
  end = "End"
)

# Use the pipeline
fc |>
  align(axis = "y") |>
  connect("start", "process", type = "vertical") |>
  connect("process", "end", type = "vertical") |>
  print()

Gmisc documentation built on March 6, 2026, 9:09 a.m.