Architecture diagrams
A service is a box with its icon, a group is a group, and the sides an edge leaves by say which way the diagram runs. Held to the same measure.
Declared with architecture-beta. Of 28 features Mermaid documents for an architecture diagram, 17 drawn as written, 11 drawn less something. See all 28 drawn both ways, or draw one yourself.

What is read
architecture-beta (and architecture, as a later Mermaid has it) is read into the same boxes and links as a flowchart, so everything else on this page holds for it: the rules, the design, Merlive's own lines.
| Written | Read as |
|---|---|
service api(server)[Orders API] | A service: a box with its title for its words and its icon beside them |
service api[Orders API], service api(server) | A service with no icon is a box with its words alone; one with no title takes its id for its words |
service api(server)["Orders API, version 2"] | A title in quotes may hold what a bare one may not |
(cloud), (database), (disk), (internet), (server) | The icons Mermaid is born with, each in Merlive's own drawing. A service with database or disk is of the kind that holds data, as a flowchart's cylinder is |
(logos:aws-lambda) | An icon from a pack is somebody's mark, which Merlive neither fetches nor draws: it is left out, the words are kept, and it is said once for each such icon. A name from a set Merlive knows (fa:fa-key) gets its drawing |
group cloud(cloud)[Azure], group office[Head office] | A group, drawn as a frame with its title. Its icon is read past |
service api(server)[Orders API] in cloud, group net(server)[Network] in cloud | What is in a group, and a group inside a group, to any depth. A group may be declared after what is in it |
junction split, junction split in cloud | Where edges meet and part: a dot, of the kind junction |
api:R -- L:db | An edge: a link with nothing at either end |
shop:R --> L:api, api:R <-- L:db, api:B <--> T:erp | An arrowhead on the service it points into: the second, the first, or both |
api:R -[saves to]- L:db, api:R <-[reads and writes]-> L:db | The words on a link |
The sides, T, B, L, R | Read for order, not for place. The link runs from the first service when it leaves by its right or its bottom, and from the second when by its left or its top, so what an author put first comes first. The diagram runs left to right when more edges leave by a left or a right side than by a top or a bottom, and top to bottom otherwise. Where each box sits, and which side a line meets, is by rule |
db{group}:R --> L:erp{group} | A link out of a group or into one is drawn from the service it names, and that is said once: a line ends at a box, not at a frame |
one:R --> L:two, where both are groups | Mermaid cannot draw it. It is joined as a flowchart's link to a group is: from the end of one to the start of the other |
align row a b c, align column a b c | Read past: where a box goes is by rule |
title Where an order is kept, title: in front matter | The picture's title, drawn above a still picture and as the heading of a page |
accTitle, accDescr, %% comments on a line or after one, config: in front matter | As in a flowchart |
An id with a hyphen (orders-api) | In Merlive's own lines it is the id with _ for the hyphen (orders_api), and a number after it if that is taken |
Said in a note, line when met, each with what to do: an id declared twice (the first is kept); a service or a group said to be in a group that is never declared, or in something that is not a group (it is drawn in no group); two groups each inside the other; a group with nothing in it (it is not drawn); an edge that names something never declared (it is drawn as a box named by its id). A line that is none of the above is said with its line number and nothing is drawn from it.
Feature by feature
Every feature Mermaid’s own pages set out for an architecture 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.
| Feature | Result | What is missing |
|---|---|---|
| Services, each with an icon and a title, and an edge between them | Drawn | |
| The icons Mermaid is born with: cloud, database, disk, internet, server | Drawn, less something | A disk is drawn with the database's drawing: Merlive has no drawing of a disk of its own yet |
| An icon from a pack by its name (logos:aws-lambda) | Drawn, less something | An icon from a pack is somebody's mark, which Merlive neither fetches nor draws: the words are kept, and it is said |
| A service with no icon | Drawn | |
| A service with no title | Drawn, less something | A box says something: a service with no title takes its id for its words, where Mermaid draws the icon alone |
| A title in quotes, with what a bare title may not hold | Drawn | |
| Ids with a hyphen and an underscore | Drawn | |
| A group, the services in it, and one outside it | Drawn, less something | A group's icon is not drawn: a frame is named by its title |
| A group inside a group | Drawn, less something | A group's icon is not drawn: a frame is named by its title |
| A group declared after the services said to be in it | Drawn, less something | A group's icon is not drawn: a frame is named by its title |
| A group with no icon | Drawn | |
| Edges that leave by every side: right to left, left to right, bottom to top | Drawn | |
| An edge that leaves by the top and meets a side | Drawn | |
| Arrowheads: into the second, into the first, into both | Drawn | |
| Words on an edge | Drawn | |
| Words on an edge with arrowheads | Drawn | |
| Edges written with no spaces | Drawn | |
| An edge out of a group and into a group ({group}) | Drawn, less something | A link out of a group is drawn from the service its author named, not from the frame: a line ends at a box. A group's icon is not drawn: a frame is named by its title |
| An edge from a service to itself | Drawn | |
| A junction: where edges meet and part | Drawn, less something | A junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet |
| A junction in a group | Drawn, less something | A junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet. A group's icon is not drawn: a frame is named by its title |
| Services lined up in a column (align) | Drawn, less something | Lining services up in a row or a column is read past: where a box goes is by rule. A group's icon is not drawn: a frame is named by its title |
| A title written in the diagram | Drawn | |
| Front matter: a title, and Mermaid's own settings | Drawn | |
| accTitle and accDescr, on a line and over several | Drawn | |
| Comments, on a line of their own and after a line | Drawn | |
| A diagram whose edges run top to bottom | Drawn | |
| A whole diagram: groups in groups, services, a junction, edges with arrowheads and words | Drawn, less something | A junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet. A link out of a group is drawn from the service its author named. A group's icon is not drawn: a frame is named by its title |
Written from skills/merlive/reference.md in the repository, so the two cannot disagree.