Importing Mermaid
Written against Mermaid 11. meltemi-diagrams import and the VS Code commands report every
construct that is not mapped exactly: approximated constructs keep their meaning with a
different drawing; dropped ones are left out. An import that drops an essential construct
(an element, a relation, a message, an entity or a line it cannot read) is partial.
Common
Section titled “Common”| Source | Meltemi | Status | Notes |
|---|---|---|---|
front matter title: |
title, and the diagram’s id |
mapped | |
front matter config: |
— | dropped | |
| other front matter | — | dropped | |
%%{init: …}%% |
— | dropped | |
%% text |
// text before the next statement |
mapped | |
accTitle: text |
title |
mapped | |
accDescr: text, accDescr { … } |
description |
mapped | C4 views have no description; there it is dropped. |
HTML in labels (<b>, <i>) |
plain text | approximated | <br> becomes a line break. |
Markdown strings "`**bold**`" |
plain text | approximated | |
fa:fa-name in labels |
the text without the icon | approximated | |
classDiagram |
— | dropped | import.unsupported-diagram. |
classDiagram-v2 |
— | dropped | import.unsupported-diagram. |
stateDiagram |
— | dropped | import.unsupported-diagram. |
stateDiagram-v2 |
— | dropped | import.unsupported-diagram. |
erDiagram |
— | dropped | import.unsupported-diagram. |
journey |
— | dropped | import.unsupported-diagram. |
gantt |
— | dropped | import.unsupported-diagram. |
pie |
— | dropped | import.unsupported-diagram. |
quadrantChart |
— | dropped | import.unsupported-diagram. |
requirementDiagram |
— | dropped | import.unsupported-diagram. |
gitGraph |
— | dropped | import.unsupported-diagram. |
mindmap |
— | dropped | import.unsupported-diagram. |
timeline |
— | dropped | import.unsupported-diagram. |
sankey-beta |
— | dropped | import.unsupported-diagram. |
sankey |
— | dropped | import.unsupported-diagram. |
xychart-beta |
— | dropped | import.unsupported-diagram. |
xychart |
— | dropped | import.unsupported-diagram. |
packet-beta |
— | dropped | import.unsupported-diagram. |
packet |
— | dropped | import.unsupported-diagram. |
kanban |
— | dropped | import.unsupported-diagram. |
radar-beta |
— | dropped | import.unsupported-diagram. |
treemap-beta |
— | dropped | import.unsupported-diagram. |
treemap |
— | dropped | import.unsupported-diagram. |
C4Deployment |
— | dropped | import.unsupported-diagram. |
zenuml |
— | dropped | import.unsupported-diagram. |
info |
— | dropped | import.unsupported-diagram. |
| an unknown diagram keyword | — | dropped | import.unsupported-diagram. |
| a source without a diagram | — | dropped | import.unsupported-diagram. |
flowchart
Section titled “flowchart”| Source | Meltemi | Status | Notes |
|---|---|---|---|
flowchart TB|TD|BT|LR|RL, graph …, direction |
direction; layout auto |
mapped | |
flowchart-elk |
a flow diagram | approximated | |
| a malformed header | — | dropped | import.syntax. |
A[text] |
node |
mapped | |
A(text) |
node |
mapped | |
A{text} |
decision |
mapped | |
A[(text)] |
data |
mapped | |
A([text]) |
node with shape pill |
mapped | |
A[[text]] |
node with shape framed |
mapped | |
A((text)) |
node with shape circle |
mapped | |
A(((text))) |
node with shape circle |
approximated | The double ring is not drawn. |
A>text] |
node with shape flag |
mapped | |
A{{text}} |
node with shape hexagon |
mapped | |
A[/text/] |
node with shape parallelogram |
mapped | |
A[\text\] |
node with shape parallelogram |
approximated | The mirrored form is not drawn. |
A[/text\] |
node with shape trapezoid |
mapped | |
A[\text/] |
node with shape trapezoid |
approximated | The mirrored form is not drawn. |
A@{ shape: doc }, document |
node with shape document |
mapped | |
A@{ shape: tri }, extract, triangle |
node with shape triangle |
mapped | |
@{ shape: das }, lin-cyl, bow-rect and other stored-data shapes |
data |
approximated | |
@{ shape: text }, comment, brace |
note |
approximated | |
other @{ shape: … } names |
node |
approximated | Classic shape names map as in the rows above. |
@{ icon, img, pos, w, h, form, constraint } |
— | dropped | |
subgraph id [title] … end, nested |
group |
mapped | A node belongs to the innermost subgraph that mentions it. |
direction inside a subgraph |
— | dropped | |
-->, ---> |
-> |
mapped | |
---, -.-, === |
the line -- for --- and === (with width 3), the dashed line --- for -.- |
mapped | |
-.-> |
--> |
mapped | |
==> |
-> with width 3 |
mapped | |
-->|text|, -- text --> |
the relation’s label | mapped | |
--o, o--o |
arrowhead circle; <-> with it for o--o |
mapped | |
--x, x--x |
arrowhead cross; <-> with it for x--x |
mapped | |
<-->, <-.->, <==> |
<->, <-->, <-> with width 3 |
mapped | |
~~~ |
— | dropped | |
A e1@--> B |
as e1 |
mapped | |
e1@{ animate: true }, animation: fast|slow |
animate e1 { effect flow } |
mapped | |
e1@{ curve: … } |
routing polyline (linear), orthogonal (step…) or bezier (other curves) |
mapped | |
other e1@{ … } attributes |
— | dropped | |
A --> B --> C, A & B --> C |
one relation per pair | mapped | |
classDef name … |
class name { … }; classDef default becomes rule node, rule decision, rule data |
mapped | |
class a,b name, a:::name |
class name in the element’s block |
mapped | |
style id … |
style id { … } |
mapped | |
linkStyle 0,1 …, linkStyle default … |
style e<n> { … }, rule relation { … } |
mapped | |
linkStyle … interpolate |
routing polyline, orthogonal or bezier, as for curve |
mapped | |
CSS other than fill, stroke, color, stroke-width, stroke-dasharray |
— | dropped | |
click, callback, href |
— | dropped | |
end without subgraph |
— | dropped | import.syntax. |
| unreadable lines | — | dropped | import.syntax, essential; kept as a comment. |
sequenceDiagram
Section titled “sequenceDiagram”| Source | Meltemi | Status | Notes |
|---|---|---|---|
participant A as Label |
participant |
mapped | |
actor A as Label |
actor |
mapped | |
participant A@{ "type": "boundary" } |
boundary |
mapped | |
participant A@{ "type": "control" } |
control |
mapped | |
participant A@{ "type": "entity" } |
entity |
mapped | |
participant A@{ "type": "database" } |
database |
mapped | |
participant A@{ "type": "collections" } |
collections |
mapped | |
participant A@{ "type": "queue" } |
queue |
mapped | |
| other participant types | participant |
approximated | |
box [colour] title … end |
group |
mapped | |
| box colours | — | dropped | |
create participant B |
create b |
mapped | |
destroy B |
destroy b after B’s next message |
mapped | |
activate A |
activate a |
mapped | |
deactivate A |
deactivate a |
mapped | |
A->>+B, B-->>-A |
activate b, deactivate b |
mapped | |
A->>B: text |
a -> b: "text" |
mapped | |
A-->>B |
a --> b |
mapped | |
A-)B |
a -> b { kind async } |
mapped | |
A--)B |
a --> b { kind async } |
mapped | |
A->B (no arrowhead) |
a -> b |
approximated | |
A-->B (no arrowhead) |
a --> b |
approximated | |
A-xB |
a -> b |
approximated | |
A--xB |
a --> b |
approximated | |
A<<->>B |
a <-> b |
mapped | |
A<<-->>B |
a <--> b |
mapped | |
Note left of|right of|over A[,B]: text |
note … "text" |
mapped | |
loop text |
loop loop1 "text" { … } |
mapped | |
alt text |
alt alt1 "text" { … } |
mapped | |
else text |
} else "text" { |
mapped | |
opt text |
opt opt1 "text" { … } |
mapped | |
par text |
par par1 "text" { … } |
mapped | |
and text |
} and "text" { |
mapped | |
critical text |
critical critical1 "text" { … } |
mapped | |
option text |
} option "text" { |
mapped | |
break text |
break break1 "text" { … } |
mapped | |
rect rgb(…) … end |
region with a fill style |
mapped | |
autonumber [start] |
autonumber |
mapped | |
autonumber start step |
autonumber start |
approximated | |
autonumber off |
— | dropped | |
title text |
title |
mapped | |
link, links |
— | dropped | |
properties, details |
— | dropped | |
end without a block |
— | dropped | import.syntax. |
| unreadable lines | — | dropped | import.syntax, essential; kept as a comment. |
| Source | Meltemi | Status | Notes |
|---|---|---|---|
title text |
the view’s title |
mapped | |
Person(alias, label, …) |
person |
mapped | |
Person_Ext(alias, label, …) |
person with external |
mapped | |
System(alias, label, …) |
system |
mapped | |
System_Ext(alias, label, …) |
system with external |
mapped | |
SystemDb(alias, label, …) |
system |
approximated | A database system is drawn as a system. |
SystemDb_Ext(alias, label, …) |
system with external |
approximated | A database system is drawn as a system. |
SystemQueue(alias, label, …) |
system |
approximated | A queue system is drawn as a system. |
SystemQueue_Ext(alias, label, …) |
system with external |
approximated | A queue system is drawn as a system. |
Container(alias, label, …) |
container |
mapped | |
ContainerDb(alias, label, …) |
datastore |
mapped | |
ContainerQueue(alias, label, …) |
container |
approximated | A queue container is drawn as a container. |
Container_Ext(alias, label, …) |
container |
approximated | Only persons and systems are marked external. |
ContainerDb_Ext(alias, label, …) |
datastore |
approximated | Only persons and systems are marked external. |
ContainerQueue_Ext(alias, label, …) |
container |
approximated | A queue container is drawn as a container; only persons and systems are marked external. |
Component(alias, label, …) |
component |
mapped | |
ComponentDb(alias, label, …) |
component |
approximated | A database component is drawn as a component. |
ComponentQueue(alias, label, …) |
component |
approximated | A queue component is drawn as a component. |
Component_Ext(alias, label, …) |
component |
approximated | Only persons and systems are marked external. |
ComponentDb_Ext(alias, label, …) |
component |
approximated | A database component is drawn as a component; only persons and systems are marked external. |
ComponentQueue_Ext(alias, label, …) |
component |
approximated | A queue component is drawn as a component; only persons and systems are marked external. |
Boundary(alias, label) { … } |
flattened: its elements are kept | approximated | With $type="system" or "container" it is read as that boundary. |
Enterprise_Boundary(alias, label) { … } |
flattened: its elements are kept | approximated | |
System_Boundary(alias, label) { … } |
the system holding its containers; the view’s scope |
mapped | |
Container_Boundary(alias, label) { … } |
the container holding its components; the view’s scope |
mapped | Around containers without components it is read as their system’s boundary (approximated). |
Rel(from, to, label, techn) |
a model relation with technology |
mapped | |
Rel_Back(…), Rel_Back_Neighbor(…) |
the reversed relation | mapped | |
Rel_U, Rel_D, Rel_L, Rel_R, Rel_Up… Rel_Neighbor |
a relation | approximated | Directions are left to the layout. |
BiRel(…) and its directions |
two relations | approximated | |
RelIndex(n, from, to, …) |
a relation | approximated | Step numbers are not drawn. |
$descr of a relation |
— | dropped | |
$tags |
— | dropped | |
$sprite |
— | dropped | |
$link |
— | dropped | |
LAYOUT_LEFT_RIGHT() |
direction LR |
mapped | |
LAYOUT_LANDSCAPE() |
direction LR |
mapped | |
LAYOUT_TOP_DOWN() |
direction TB |
mapped | |
| a level without its scope | the next level up | approximated | |
| dynamic diagrams | a container view | approximated | Step numbers are not drawn. |
| persons or systems inside a boundary | top-level entities | approximated | |
| components outside a container boundary | a container that holds them | approximated | |
| containers outside a system boundary | the scope’s system, or one named after the diagram | approximated | |
Container(…) |
container |
mapped | Outside a system boundary it goes into the scope’s system or one named after the diagram (approximated). |
Deployment_Node, Node, Node_L, Node_R |
— | dropped | Essential: deployment diagrams are not imported. |
Node(…) |
— | dropped | Essential. |
| other macros | — | dropped | Essential. |
| unreadable lines | — | dropped | import.syntax, essential. |
unbalanced { } |
— | dropped | import.syntax. |
| an alias declared twice | — | dropped | import.syntax; the first declaration is kept. |
AddElementTag(…) |
— | dropped | Drawing only. |
AddRelTag(…) |
— | dropped | Drawing only. |
AddBoundaryTag(…) |
— | dropped | Drawing only. |
AddPersonTag(…) |
— | dropped | Drawing only. |
AddSystemTag(…) |
— | dropped | Drawing only. |
AddContainerTag(…) |
— | dropped | Drawing only. |
AddComponentTag(…) |
— | dropped | Drawing only. |
AddExternalPersonTag(…) |
— | dropped | Drawing only. |
AddExternalSystemTag(…) |
— | dropped | Drawing only. |
AddExternalContainerTag(…) |
— | dropped | Drawing only. |
AddExternalComponentTag(…) |
— | dropped | Drawing only. |
UpdateElementStyle(…) |
— | dropped | Drawing only. |
UpdateRelStyle(…) |
— | dropped | Drawing only. |
UpdateBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateContainerBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateSystemBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateEnterpriseBoundaryStyle(…) |
— | dropped | Drawing only. |
UpdateLayoutConfig(…) |
— | dropped | Drawing only. |
UpdateLegendTitle(…) |
— | dropped | Drawing only. |
UpdateSkinparamsAndLegendEntry(…) |
— | dropped | Drawing only. |
SHOW_LEGEND(…) |
— | dropped | Drawing only. |
SHOW_FLOATING_LEGEND(…) |
— | dropped | Drawing only. |
LAYOUT_WITH_LEGEND(…) |
— | dropped | Drawing only. |
LAYOUT_AS_SKETCH(…) |
— | dropped | Drawing only. |
HIDE_STEREOTYPE(…) |
— | dropped | Drawing only. |
HIDE_PERSON_SPRITE(…) |
— | dropped | Drawing only. |
SHOW_PERSON_SPRITE(…) |
— | dropped | Drawing only. |
SHOW_PERSON_PORTRAIT(…) |
— | dropped | Drawing only. |
SHOW_PERSON_OUTLINE(…) |
— | dropped | Drawing only. |
SHOW_ELEMENT_DESCRIPTIONS(…) |
— | dropped | Drawing only. |
SHOW_INDEX(…) |
— | dropped | Drawing only. |
HIDE_LEGEND(…) |
— | dropped | Drawing only. |
SetDefaultLegendEntries(…) |
— | dropped | Drawing only. |
Lay_U(…) |
— | dropped | Drawing only. |
Lay_Up(…) |
— | dropped | Drawing only. |
Lay_D(…) |
— | dropped | Drawing only. |
Lay_Down(…) |
— | dropped | Drawing only. |
Lay_L(…) |
— | dropped | Drawing only. |
Lay_Left(…) |
— | dropped | Drawing only. |
Lay_R(…) |
— | dropped | Drawing only. |
Lay_Right(…) |
— | dropped | Drawing only. |
Lay_Distance(…) |
— | dropped | Drawing only. |
increment(…) |
— | dropped | Drawing only. |
setIndex(…) |
— | dropped | Drawing only. |
architecture-beta
Section titled “architecture-beta”| Source | Meltemi | Status | Notes |
|---|---|---|---|
group id(icon)[Label] [in parent] |
group with an icon style |
mapped | |
service id(icon)[Label] [in group] |
node with an icon style |
mapped | |
junction id [in group] |
a node without text |
approximated | |
cloud, database, disk, internet, server, pack:name |
tabler:cloud, tabler:database, tabler:device-floppy, tabler:world, tabler:server; pack:name when the project has the pack |
mapped | Icons of packs the project lacks are dropped. |
a:R -- L:b |
the named line a -- b with its route |
mapped | |
a:R --> L:b, a:R <-- L:b |
a relation in the arrow’s direction | mapped | |
a:R <--> L:b |
a <-> b |
mapped | |
the sides L, R, T, B |
route e<n> from a.east to b.west |
mapped | Positions are left to ELK; the sides are kept as ports. |
a{group}:R -- L:b |
a relation from a’s group |
mapped | |
in naming something that is not a group |
— | dropped | |
in naming something that is not a group |
— | dropped | |
in naming something that is not a group |
— | dropped | |
title text |
title |
mapped | |
| unreadable lines | — | dropped | import.syntax, essential. |
block-beta
Section titled “block-beta”| Source | Meltemi | Status | Notes |
|---|---|---|---|
columns n |
a grid of 168 × 84 cells | mapped | |
a |
box with place and size |
mapped | |
a[text] |
shape rectangle |
mapped | |
a(text) |
shape rounded |
mapped | |
a{text} |
shape diamond |
mapped | |
a[(text)] |
shape cylinder |
mapped | |
a([text]) |
shape pill |
mapped | |
a[[text]] |
shape framed |
mapped | |
a((text)) |
shape circle |
mapped | |
a(((text))) |
shape circle |
approximated | The double ring is not drawn. |
a>text] |
shape flag |
mapped | |
a{{text}} |
shape hexagon |
mapped | |
a[/text/] |
shape parallelogram |
mapped | |
a[\text\] |
shape parallelogram |
approximated | The mirrored form is not drawn. |
a[/text\] |
shape trapezoid |
mapped | |
a[\text/] |
shape trapezoid |
approximated | The mirrored form is not drawn. |
a:2 |
a box across two cells | mapped | |
space, space:n |
empty cells | mapped | |
block:id:n … end |
an untitled group "" with its own columns |
mapped | |
a<["text"]>(right) |
shape arrow |
mapped | |
a<["text"]>(left), (up), (down), (x), (y) |
shape arrow, pointing right |
approximated | |
a --> b, a -- text --> b |
relations | mapped | |
classDef |
class |
mapped | |
class a name |
the class in the box’s block | mapped | |
style a … |
style a { … } |
mapped | |
| other CSS properties | — | dropped | |
end without block |
— | dropped | import.syntax. |
| unreadable items | — | dropped | import.syntax, essential. |