Skip to content

GenerateMermaidExecutionParams

Defined in: src/types/index.ts:1768

Parameters for generateMermaidExecution, overlaying an execution’s outcome onto a Mermaid diagram.

Takes the diagram options plain generateMermaid honours: catchHandling, catchLabelStyle, collapse, customColors, includeComments, layout, showVariables and theme. The rest of DiagramOptions has no meaning in Mermaid output. Every state takes its run-status class, so customColors changes the emitted state-type classDefs but colours no state, as in the SVG overlay.

  • Pick<DiagramOptions, | "catchHandling" | "catchLabelStyle" | "collapse" | "customColors" | "includeComments" | "layout" | "showVariables" | "theme">
aslDefinition: string | AslDefinition;

Defined in: src/types/index.ts:1780

ASL definition as object or JSON string


catchHandling?: CatchHandling;

Defined in: src/types/index.ts:586

How to treat per-state Catch (error-handler) branches. ‘show’ (default) renders them; ‘hide’ drops error edges and handler-only nodes so the happy path reads clearly on large machines.

'show'

DiagramOptions.catchHandling


catchLabelStyle?: CatchLabelStyle;

Defined in: src/types/index.ts:592

Style for Catch block edge labels: ‘error-type’ shows error names, ‘catch-number’ shows “Catch #N”

'error-type'

DiagramOptions.catchLabelStyle


collapse?: boolean | string[];

Defined in: src/types/index.ts:602

Collapse Parallel/Map containers into a placeholder node so dagre lays out a smaller graph — hiding a container’s children shrinks the diagram instead of leaving an empty bounding box behind. true collapses every container; a string array collapses only the named containers (names that don’t resolve to an existing container are ignored).

undefined (no collapsing)

DiagramOptions.collapse


customColors?: Partial<Record<StateType, Partial<NodeStyle>>>;

Defined in: src/types/index.ts:623

Per-state-type fill and stroke, applied on top of the theme. Only fill and stroke are drawn; shape and strokeWidth here have no effect (use nodeOverrides). In Mermaid output a value that can’t be drawn on one style line (a line break, ;, {, }, or a comma outside rgb()/hsl() syntax) is left out with a %% comment, and the theme’s colour shows instead.

DiagramOptions.customColors


history: ExecutionHistoryInput;

Defined in: src/types/index.ts:1782

Execution history (events array, GetExecutionHistory response, or JSON string)


includeComments?: boolean;

Defined in: src/types/index.ts:704

Whether to use state comments as node labels. In SVG and PNG output a label wider than its node is cut short with …; the full text stays in the node’s <title> tooltip.

true

DiagramOptions.includeComments


layout?: LayoutDirection;

Defined in: src/types/index.ts:707

Graph layout direction: TB (top-bottom), LR (left-right), RL (right-left), BT (bottom-top)

DiagramOptions.layout


showVariables?: boolean;

Defined in: src/types/index.ts:758

Whether to annotate nodes with the variables they assign via ASL Assign. Shown as $var1, $var2 beneath the node label. States that assign nothing are unaffected.

true

DiagramOptions.showVariables


theme?: ThemeOption;

Defined in: src/types/index.ts:771

Color theme: ‘light’, ‘dark’, ‘auto’, or a custom theme object. 'auto' repaints in the dark palette under prefers-color-scheme: dark and renders as light in PNG and Mermaid output; see ThemeOption.

DiagramOptions.theme