Skip to contents

The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.

Usage

setup_MermaidConfig(
  palette = NULL,
  node_color = NULL,
  fill_alpha = 0.1,
  font_size = 14,
  padding = NULL,
  auto_direction = FALSE,
  fit = FALSE,
  title = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL
)

Arguments

palette

Optional Character: Colors for categorical entities, overriding the theme palette. NULL uses the theme's.

node_color

Optional Named character: Colors for selected nodes, named by node id. Each named node gets a border in its color and a fill of the same color at fill_alpha opacity.

fill_alpha

Numeric [0, 1]: Fill opacity of the nodes in node_color.

font_size

Numeric (0, Inf): Label font size in pixels.

padding

Optional Numeric [0, Inf): Space around the diagram in pixels. NULL uses Pele's default.

auto_direction

Logical: Allow left-to-right flowcharts to be drawn top-to-bottom in widgets narrower than 640 pixels.

fit

Logical: Shrink the diagram to the widget width instead of drawing it at its natural size.

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance.

writer

Optional Named character: Which interface wrote the config.

Value

MermaidConfig object.

Author

EDG

Examples

config <- setup_MermaidConfig(title = "Study design")
draw(
  config,
  data = c(
    "flowchart TD",
    "  screened[Screened] --> eligible[Eligible]",
    "  eligible --> treated[Treatment]",
    "  eligible --> control[Control]"
  )
)