A sequence diagram, from its statements to a frame: the parser, then the layout.
| Module | Description |
|---|---|
| mermaid.sequence.layout | The sequence diagram layout: a script in, a frame out. |
| mermaid.sequence.parser | The sequence diagram parser: statements in, a script out. |
| Name | Signature |
|---|---|
| parse | parse(statements, header) -> script, err |
| layout | layout(script, compact) -> frame |
parse(
statements,header) ->script,err
Parse a sequence diagram's statements into a script
statements is what mermaid.source.statements returns; header is not
read. The script is mermaid.sequence.parser.parse's, and layout takes
it.
layout(
script,compact) ->frame
Lay a sequence diagram out into a frame
script is what parse returns. With compact the participants stand
closer and the texts wrap narrower.
The layout writes its sizes into the script's participants and events. Each layout writes every one anew, so a script may be laid out again.