Skip to contents

The complete, validated render specification for a Mermaid diagram drawn with Pele: the Mermaid source plus its render settings. This is the Pele analog of EChartsOption, SigmaOption, and MapLibreOption, the object draw() dispatches on to create a rtemis-diagram widget. The theme is an argument to draw(), not a property.

Usage

PeleOption(
  source = character(0),
  font_size = 14,
  padding = NULL,
  auto_direction = FALSE,
  fit = FALSE,
  palette = NULL,
  node_color = NULL,
  fill_alpha = 0.1,
  critical_color = "#EA384A"
)

Arguments

source

Character: Mermaid diagram text, one string.

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 Pele to draw left-to-right flowcharts top-to-bottom in elements narrower than 640 pixels.

fit

Logical: Shrink the diagram to the widget width, with pinch and Ctrl/Cmd-wheel zoom. FALSE draws it at its natural size in a scrolling widget.

palette

Optional Character: Colors for categorical entities, such as pie slices and mindmap branches. Pele uses the first eight. NULL uses the theme palette.

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.

critical_color

Character: Color of critical Gantt tasks and high-priority kanban items.

Value

PeleOption object.

Details

Most users call draw_mermaid(), which builds this object.

Author

EDG

Examples

PeleOption(source = "flowchart LR\n  A --> B")
#> <rtemis.draw::PeleOption>
#>  @ source        : chr "flowchart LR\n  A --> B"
#>  @ font_size     : num 14
#>  @ padding       : NULL
#>  @ auto_direction: logi FALSE
#>  @ fit           : logi FALSE
#>  @ palette       : NULL
#>  @ node_color    : NULL
#>  @ fill_alpha    : num 0.1
#>  @ critical_color: chr "#EA384A"