A flowchart, from its statements to a frame: the parser, then the four steps of the layout in order.
| Module | Description |
|---|---|
| mermaid.flowchart.order | The second step of a flowchart's layout: the order of each layer's nodes, chosen so that few links cross. |
| mermaid.flowchart.parser | The flowchart parser: statements in, a graph out. |
| mermaid.flowchart.place | The third step of a flowchart's layout: each node's size in cells, and its place across the flow. |
| mermaid.flowchart.rank | The first step of a flowchart's layout: which layer each node stands in. |
| mermaid.flowchart.route | The last step of a flowchart's layout: the layers' places along the flow, and each edge's route. |
| Name | Signature |
|---|---|
| parse | parse(statements, header) -> graph, err |
| layout | layout(graph, compact, turned) -> frame, err |
parse(
statements,header) ->graph,err
Parse a flowchart's statements into a graph
statements and header are what mermaid.source.statements returns.
The graph is mermaid.flowchart.parser.parse's, and layout takes it.
layout(
graph,compact,turned) ->frame,err
Lay a flowchart out into a frame
graph is what parse returns. A graph may be laid out more than once:
the layout reads it and writes nothing into it. With compact the
diagram is laid out as tight as it reads: one blank cell where the usual
layout leaves two or three, and labels wrapped at half the width.
A diagram is laid out as a flow down or to the right, and BT and RL
are those two run the other way.
With turned the graph is laid out in the other flow: TD as LR, LR
as TD, BT as RL and RL as BT. The frame is the one the same
statements give under that other header.
Returns nil and a reason for a diagram of more than 4000 layout nodes, the dummies of its long edges counted, and for a subgraph that cannot be framed.