Render Mermaid text (or a compiled graph object) to a PNG file using Mermaid CLI (`mmdc`).
save_mermaid_png(
x,
file,
mmdc = Sys.which("mmdc"),
direction = c("TD", "LR"),
subgraphs = NULL,
include_start_end = TRUE,
style = TRUE,
width = NULL,
height = NULL,
scale = NULL,
background = "white",
theme = "default",
quiet = TRUE
)Invisibly returns the output file path.
Mermaid text, graph spec, or compiled object returned by [build_custom_agent()] with `output = "both"` or [compile_graph()].
Output `.png` path.
Path to Mermaid CLI executable. Defaults to `Sys.which("mmdc")`.
Mermaid direction used when `x` is not plain Mermaid text.
Optional named list of subgraph groupings.
Logical; include `__start__` and `__end__` nodes.
Logical; include default Mermaid class styling.
Optional diagram width passed to `mmdc`.
Optional diagram height passed to `mmdc`.
Optional diagram scale passed to `mmdc`.
Background color for Mermaid rendering.
Mermaid theme (for example `"default"`, `"neutral"`, `"dark"`).
Logical; suppress Mermaid CLI output when `TRUE`.