Merlive

Flowcharts

Boxes and links, placed by the eight placement rules: the main path in one straight line, every box one size, lines that turn at right angles and go round boxes.

Declared with flowchart TD. Of 70 features Mermaid documents for a flowchart, 49 drawn as written, 20 drawn less something, 1 partly read. See all 70 drawn both ways, or draw one yourself.

Mermaid as it comes
A purchase order approval flow as Mermaid draws it: diamonds twice the size of the boxes, a main path that wanders from side to side, and a line from Revise order that climbs the whole height of the diagram
Merlive in this site’s colours, which it read itself
The same flow drawn by Merlive: the main path in one straight line, boxes of one size, and the way back to Revise order going round to one side

What is read

WrittenRead as
flowchart TD, graph TD, TBTop to bottom
flowchart LRLeft to right
BT, RLBottom to top and right to left: the same flow, begun at the far end, with every arrow pointing the way it was written. A right-to-left flow too wide for a screen is turned top to bottom, as a left-to-right one is
A[Text], A(Text)A box
A([Text]), A((Text))A start or end (a pill)
A{Text}A rhombus, as wide and as tall as the boxes round it
A{{Text}}, A[(Text)], A[[Text]], A(((Text))), A>Text]A hexagon, a cylinder (a store of data, of the data kind), a subroutine, a double circle, a flag: each drawn as itself, in the footprint every box shares
A[/Text/], A[\Text\], A[/Text\], A[\Text/]The two that lean and the two trapezoids, drawn as themselves
A["Text with (brackets)"]A quoted label
A["one line<br/>and another"]A label in the author's own lines, up to four
A["`**Bold** and *italic*`"]A Markdown string: its words, its own line breaks, and what it makes bold or italic. On a link's words the stars come off and the words are plain
#quot;, #9829;An entity code becomes its character
fa:fa-truck ShippedAn icon is drawn beside its words. The drawing is Merlive's own (seventy-two of them, found by any name Font Awesome has used): nothing is fetched. One Merlive has no drawing for, or a brand's mark, is left out and named in a note, line
A@{ shape: diam, label: "In stock?" }A box written the newer way, on one line or several. Its label is kept. Every shape in the rows above is drawn as itself, by any of Mermaid's names for it; a shape Merlive has no drawing for is a box
A@{ shape: doc }, docs, notch-rect, lin-rect, st-rect, div-rect, win-pane, sl-rect, delay, tri, flip-tri, fork, joinEach drawn as itself, by any of Mermaid's names for it: a document with a waved foot, a stack of documents, a card with its corner cut, a box with a rule down its side, a stack of boxes, a box with a rule across its top, a window pane, a box whose top slopes, a delay with a round end, a triangle, one turned over, and a fork or a join as a bar across the flow. Mermaid's drawings (a cloud, a bolt, a person, braces) are boxes
A@{ icon: "fa:user", label: "Buyer" }A box with its label, and Merlive's own drawing of the icon beside it
A@{ img: "…", label: "…" }A box with its label. The image is left out: a page of Merlive fetches nothing
A@{ row: 1, column: 2 }, g@{ view: collapsed }Read past: placement is Merlive's, and a group is drawn open
--- … --- at the topFront matter: its title is the picture's name, drawn above a still picture and as the heading of a page; Mermaid's own settings are read past
accTitle: …, accDescr: …What the picture is called and what it shows, kept for readers who cannot see it
A --> B, A --- BA link, with or without an arrowhead
A -.-> B, A ==> BA dotted link, a thick link
A --o B, A --x B, A <--> B, A o--o B, A x--x BA circle, a cross or an arrowhead at either end, drawn as written
A ~~~ BAn invisible link: its boxes are read, and no link is made. Where boxes go is Merlive's
A -->|Yes| B, A -- Yes --> B, A -- "two<br/>lines" --> BA link with words
A -. maybe .-> B, A == must ==> B, A ---> BWords in a dotted or thick link; an arrow drawn longer
subgraph id["Title"] … end, g1 --> g2A group, drawn as a frame with its title; a link between groups joins the end of one to the start of the next. A group inside a group has a frame of its own inside the outer one
A --> B --> CA chain
A --> A, A -->|again| AA link from a box to itself: a small loop beside it. It is not one of the loops %% step: … | loop 1 counts
A & B --> C & DEvery box before the link, linked to every box after it
A e1@--> B, e1@{ animate: true }A link with an id is a link; what Mermaid sets on it (animation, a step, a curve) is read past
class A,B rework, A:::reworkThe kind of a box: its colour comes from the design's kinds. Its name may have a hyphen (read-only)
classDef red stroke:#c62828The class's colour is read for what it means: a kind the design has no colour for takes the design's own nearest colour (this red becomes risk)
style B stroke:#c00,stroke-width:3px,stroke-dasharray: 5 5What the author's own style means is kept: a broken outline, a heavy one, and a colour, named for its hue (red) and drawn in the design's own nearest colour. The fill is the design's
linkStyle 0 stroke:#c00,stroke-width:4pxThe same for a link, by the number Mermaid gives it: heavy, broken, and in the design's nearest colour
classDef default …, linkStyle default …Read past: a look for every box or every link is the design's
clickRead past
direction LR inside a groupA group whose boxes run across the flow: its boxes in one row, in the order they are linked, the main path through where the flow comes into it; RL and BT the other way. Only for boxes linked one after another in a line: with a branch inside, the group runs as the flow does, and a note, line says so

Where the Mermaid is kept decides how it is found: fenced mermaid blocks in Markdown (.md, .mdx); the whole of a .mmd file; and, in any other file (an .astro page, a script), a string between backticks that starts as a flowchart does. A string put together with ${…} when the page runs cannot be read.

What is and is not drawn, feature by feature.

Feature by feature

Every feature Mermaid’s own pages set out for a flowchart, each with a sample of it in the corpus. A sample is drawn when every box, link and word it has is read and every rule passes. Drawn, less something is the same with one thing known to be missing, named beside it.

FeatureResultWhat is missing
A flowchart, declared with "flowchart"Drawn
A flowchart, declared with "graph"Drawn
Direction TB: top to bottomDrawn
Direction TD: top downDrawn
Direction LR: left to rightDrawn
Direction BT: bottom to topDrawn
Direction RL: right to leftDrawn
A title and settings in front matterDrawn, less somethingMermaid's own settings are read past: the look is the design's
Settings in an init directiveDrawn, less somethingMermaid's own settings are read past: the look is the design's
Comments on lines of their ownDrawn
A title and a description for readers who cannot see itDrawn
A description written over several linesDrawn
Statements ended with semicolons, and no spacesDrawn
Boxes named by their id aloneDrawn
A box with wordsDrawn
Words in other alphabetsDrawn
Brackets and signs inside quotesDrawn
Characters written as entity codesDrawn
A line break in a labelDrawn
Markdown strings: bold, italic and a real line breakDrawn
A Font Awesome icon in a labelDrawn, less somethingThe icons are Merlive's own drawings of a truck and a tick, not Font Awesome's
Shape: Round edgesDrawn, less somethingIts corners are the design's, the same as every box
Shape: StadiumDrawn
Shape: SubroutineDrawn
Shape: Cylinder, a databaseDrawn
Shape: CircleDrawn, less somethingDrawn as a pill: a circle the height of a box would hold three letters
Shape: Asymmetric, a flagDrawn
Shape: Rhombus, a decisionDrawn
Shape: HexagonDrawn
Shape: ParallelogramDrawn
Shape: Parallelogram, leaning backDrawn
Shape: TrapezoidDrawn
Shape: Trapezoid, upside downDrawn
Shape: Double circleDrawn
Shapes written as @{ shape: … }, with a labelPartly readits shapes are read as box, diamond, cylinder, document, pill
Every one of the 53 newer shapesDrawn, less somethingThose Merlive has a drawing for are drawn as themselves; the rest are boxes
A box that is an iconDrawn, less somethingThe icon is Merlive's own drawing of a user, beside the label and not above it
A box that is an imageDrawn, less somethingThe image is left out (a page of Merlive fetches nothing); its label is kept
Boxes given a row and a columnDrawn, less somethingThe rows and columns are read past: placement is Merlive's
A link with an arrowheadDrawn
A link with no arrowheadDrawn
Words on a link, between barsDrawn
Words on a link, written into itDrawn
A dotted link, with and without wordsDrawn
A thick link, with and without wordsDrawn
An invisible link, used to nudge placementDrawn, less somethingIts boxes are read and the link is left out: it is only there to nudge Mermaid's placement, and placement is Merlive's
Links chained in one lineDrawn
One line linking to several boxes with &Drawn
Several boxes to several boxes with &Drawn
A link ending in a circle or a crossDrawn
Arrows at both endsDrawn
Links drawn longer, to push a box further onDrawn, less somethingThe extra length is read past: placement is Merlive's
A link from a box to itselfDrawn
A link given an idDrawn
A link set to animateDrawn, less somethingMermaid's animation is read past: movement is the design's, and starts when a reader asks
Links played one step after anotherDrawn, less somethingThe step numbers are read past; a walkthrough is written with "%% step"
A link given a curve of its ownDrawn, less somethingThe curve is read past: lines turn at right angles by rule
A group named by its titleDrawn
A group with an id and a titleDrawn
Links to a group and between groupsDrawn
A group with a direction of its ownDrawn
A group inside a groupDrawn
A group shown collapsedDrawn, less somethingDrawn open: a picture cannot be opened and closed
A box styled on its ownDrawn, less somethingIts outline is broken, heavy and red as written, in the design's own red; its fill is the design's
Links styled by their numberDrawn, less somethingThe link is heavy and red as written, in the design's own red; a default for every link is read past
A class made and given to boxesDrawn
A class given with :::Drawn
A default class for every boxDrawn, less somethingThe default class is read past: the look is the design's
A box that calls a function when clickedDrawn, less somethingThe click is left out: a page of Merlive runs no code of yours
A box that opens a link when clickedDrawn, less somethingThe link is left out

Written from skills/merlive/reference.md in the repository, so the two cannot disagree.

Before: What it drawsNext: State diagrams