toMermaid

fun toMermaid(config: GraphConfig<State> = GraphConfig(), edgeLabels: Map<Pair<String, String>, String> = emptyMap()): String

Draws this graph as a Mermaid state diagram, to paste into a README or a pull request. See GraphTopology.toMermaid.

Parameters

config

marks the nodes of its GraphConfig.interruptBefore and GraphConfig.interruptAfter as the nodes where a run pauses. Defaults to no pauses. A GraphConfig with pauses needs a checkpointer; to draw them without one, such as in a test, pass the nodes to GraphTopology.toMermaid of topology.

edgeLabels

a label for an edge, by the names of its two ends, such as ("read" to "refund") to "refund request", which takes the place of the labels given to StateGraph.conditionalEdge. A conditional edge with neither is labeled ?.

Throws

if config or edgeLabels name nodes or edges that are not in the graph.