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