Merlive

Block diagrams

Blocks joined by links are read as a flowchart is and placed by rule. One whose meaning is in its grid is placed on that grid, each block in the cell its author gave it.

Declared with block-beta. Of 36 features Mermaid documents for a block diagram, 31 drawn as written, 5 drawn less something. See all 36 drawn both ways, or draw one yourself.

Mermaid
Block diagram, as Mermaid draws it
Merlive
Block diagram, as Merlive draws it

What is read

block and block-beta are read into the same boxes and links as a flowchart. But a block diagram is the one kind whose author places the boxes, on a grid. So it is placed in one of two ways. Where it is a flow (every block is joined to another by a link, every block takes one column, and a space is only there to make room for a link), it is placed by rule, as a flowchart is. Where what it says is where each block is, it is placed on the grid its author wrote: every block in its cell, exactly as wide as the columns it spans, with the links drawn at right angles in the gaps between cells. It is never guessed at: a grid of blocks drawn as a row of boxes would say something its author did not.

WrittenRead as
shop["Web shop"], shopA block: a box, called by its words, or by its id when it has none. Words go in quotes; <br/> breaks a line
a("Round"), a(["Stadium"]), a[["Subroutine"]], a[("Database")], a(("Circle")), a>"Flag"], a{"Decision"}, a{{"Prepare"}}, a[/"Input"/], a[\"Output"\], a[/"Manual"\], a[\"Trapezoid"/], a((("Stop")))The same shapes as a flowchart's. A block with round corners is a box and a circle is a pill, as they are there; a cylinder is of the kind that holds data
a --> b, a --- b, a ==> b, a -.-> b, a --o b, a --x b, a <--> bA link: solid, thick or dotted, ending in an arrow, nothing, a circle or a cross, or with an arrow at both ends
a -- "words" --> b, a == "words" ==> b, a -. "words" .-> bA link with words. They go in quotes, written into the link
a --> z, where z is written nowhere elseThe link, and a block z made for it, as Mermaid makes one
start("Start") --> stop("Stop")A link, and each block given its shape and its words there
block:back … end, block … endA block that holds others: a group. One inside another is a group inside a group
block:back["Back office"]The same, called by its words. Mermaid 11 draws no name for it; Merlive draws the one its author wrote
shop --> back, back --> bankA link to or from a block that holds others, joined to where the blocks inside it start or end, as a link to a group is
columns 3, columns auto in a flowWhich way the flow runs: blocks that fit one row run left to right, any others top to bottom
a space b with a --> b, space:3 between two joined blocksRoom for the link, which is how Mermaid's own guide says to draw one. Read past
style a fill:#636,stroke-width:4px, classDef late fill:#fde, class a,b lateKinds and outlines, as in a flowchart. A style is for one block
%% words on a line of its own, title: in front matterAs in a flowchart

Placed on its author's grid, when any of these is written:

WrittenWhat it says, and how it is drawn
A block no link joins to another (a grid of blocks, one block on its own, a block inside another that only the outer one is linked for)Where it is drawn is all that says what it belongs with. Each block is in the cell it was written in, the cells filled row by row
columns 3, columns autoHow many columns the grid has: every column as wide as every other, every row as tall as its tallest block. auto is one row
wh["Warehouse"]:3, block:left:2A block that spans columns lies under or beside several others: it is as wide as those columns and the gaps between them. One that does not fit what is left of a row starts the next
space, space:3A cell, or several, left empty, so a block comes where its author wanted it. A line may run through it
block:left … end with columns of its ownA frame over the cells it spans, round a grid of its own, with room for its name only when it has one
to<["orders"]>(right), and left, up, down, x, yA block arrow: an arrow drawn as a block, in its cell, pointing the way written. x points both ways across and y both ways up and down
to<["orders"]>(x, down)An arrow along two lines at once is drawn along the first (both ways across), and said: Merlive draws an arrow along one line
to<["&nbsp;"]>(down)An arrow with no words is drawn with none
a --> b on a gridA link at right angles: straight across a gap where two blocks face each other, else round the blocks between them and never through one. A link with no way round is said, and the diagram is not written until it has one

Not read, each named in a note, line when met, and the rest of the line still read:

  • words not in quotes (a[Box], a -- words --> b), which Mermaid does not draw either;
  • words between bars (a -->|words| b): write them into the link;
  • a chain (a --> b --> c): Mermaid draws no link of it; write each link on a line of its own;
  • a comment after blocks on one line (a b %% words): Mermaid draws its words as more blocks;
  • a & b, ~~~, a style for several blocks at once (style a,b …), and anything else that is not a block, a space, a link or one of the lines above.

Feature by feature

Every feature Mermaid’s own pages set out for a block diagram, 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 block diagram that is a flow: blocks in a row, each joined to the nextDrawn
The older name of the kind: block-betaDrawn
columns 1: blocks one under the other, joinedDrawn
No columns given: one rowDrawn
columns auto: one row, each column as wide as it needsDrawn
Blocks that wrap to a second row, joined in the order writtenDrawn
Blocks with no words: each is called by its idDrawn
Words broken with <br/>, and an entity codeDrawn
A link with no arrowheadDrawn
Words written into a linkDrawn
Links thick and dotted, ending in a circle, a cross, an arrow at both ends, and dotted with wordsDrawn
Blocks given their shape and words in the link that joins themDrawn
A link to a block not written anywhere else, which makes itDrawn
A space between two blocks, to make room for the link that joins them (how Mermaid says to draw a link)Drawn
A space between two blocks one under the other, for the link that joins themDrawn
space:3 between two joined blocks: more room for the same linkDrawn
Every shape of a block, joined in a chainDrawn, less somethingA block with round corners is a box, and a circle is a pill, as in a flowchart
A block that holds others: a groupDrawn
A block that holds others, with a name and columns of its ownDrawn, less somethingMerlive draws the name its author gave the block; Mermaid 11 draws none
A block that holds others and has no idDrawn
Blocks that hold others, inside one that holds themDrawn
Links to and from a block that holds others: joined to what is inside itDrawn
A block styled on its own: a heavy outline, a broken oneDrawn, less somethingThe colour is drawn in the design's nearest colour
A class, and the blocks that are of itDrawn, less somethingThe colour is drawn in the design's nearest colour
Comments on lines of their ownDrawn
Front matter with a titleDrawn
A grid of blocks with no links: what it says is where each block isDrawn
Every shape of a block, laid out in a grid with no linksDrawn
One block on its ownDrawn
Blocks that span columns: a wide block over two narrower onesDrawn
A block that spans the grid under two others, a space between them and an empty rowDrawn
Spaces that put a block under the one it belongs toDrawn
Block arrows between cells: arrows drawn as blocks, placed by the gridDrawn
A block arrow pointing every way it canDrawn, less somethingAn arrow that points across and down is drawn pointing both ways across: Merlive draws an arrow along one line
Blocks that hold grids of their own, and span columns of the grid they are inDrawn
A grid with a block arrow, a block that holds others, a space and links (from Mermaid's own guide)Drawn

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

Before: Architecture diagramsNext: Mindmaps