The classDiagram text form (spec/02 §11.3, spec/13 §7.3): a class diagram written as
mermaid writes one, read into a layered diagram's design (Macaw.Frame.TextForms) whose
nodes are compartmented: a class's name over its members.
classDiagram
class Animal {
+String name
+move(int) void
}
Animal <|-- Duck : is a
Duck : +swim()
Pond *-- Duck
Pond o.. Frog- A class is
class Name, orclass Name {with a member a line until};Name : memberadds a member; a class named only by a relation has none. - A relation is
A <end><line><end> B, with: labelafter it: the line--(solid) or..(dashed), each end<|/|>(open, a generalization's hollow triangle),*(diamond, a composition),o(open_diamond, an aggregation),</>(arrow), or none. The left end is the edge's tail atA, the right its head atB.
Rows: nodes (id, label the name and its members a line each, shape rect,
group none) in order of first appearance; edges in order; members (node, text,
visibility its leading +, -, # or ~, kind method when it holds a (, else
attribute) in class order, each class's in the order written. Faults, every one at
once: {:expected, :class}, {:expected, :relation}, {:unclosed, "class"},
{:unexpected, "}"}. print/1 writes each class with its members, then the relations.