Skip to content

GenerateMermaidDiffParams

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

Parameters for generateMermaidDiff, comparing two ASL definitions into a Mermaid diff.

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. A state the diff marks added, modified or removed keeps its diff class, so customColors shows only on unchanged states.

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

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

The new (head) ASL definition


before: string | AslDefinition;

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

The old (base) ASL definition


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


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