Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Use case diagrams

sirene draws Mermaid’s use case diagrams (usecase-beta) as images and as text: actors, use cases, system boundaries, and the relationships between them.

usecase-beta
direction LR
actor Customer
actor Support
systemBoundary Storefront
  Browse("Browse catalogue")
  Checkout("Checkout")
end
systemBoundary Fulfilment
  Track("Track delivery")
end
Customer --> Browse
Customer --> Checkout
Customer --> Track
Support --> Track
Checkout ..> : include Browse
the drawing of the mermaid source above

As an image, actors are stick figures with their names below. See crates/sirene-core/tests/fixtures/usecase/valid/ for more. In the editor a use case diagram is read-only on the drawing side.

What is read

SyntaxDrawn as
actor A, actor A("label"), actor A, Ba stick figure
@{ type: hollow }, @{ type: awesome }a hollow outline, or a filled silhouette
U("label"), U[label], "label", an undeclared endpointan ellipse, or a rectangle for [...]
@{ business: true }the business slash on an actor or ellipse
<<Stereotype>>«Stereotype» above the label
systemBoundary id["title"] ... end, @{ type: package }a box around its members, with a title tab for package
-->, <--, --, --o, o--, --x, x--, with more dashes for a longer edgean association with that marker
-- label --> and the other labelled formsa labelled association
..> : include, ..> : extenda dotted arrow labelled «include» or «extend»
--|>a generalization, with a hollow triangle
A id@--> B, id@{ animate: true }, id@{ animation: fast }an edge that class, style, and metadata can name
note for U "text"a note linked to its actor or use case
json T@{ ... }a table of the object’s keys and values, nested keys as a.b and items[0].name
:::a,b, class a,b c,d, classDef, styleclasses and styles
direction, accTitle, accDescr, %% commentread

Mermaid’s rules (an icon with a non-normal type, include between non-use-cases, a JSON table with a circle or cross marker, and the like) are warnings, and the diagram is still drawn.

Not drawn

Icon actors (@{ icon: "fa:user" }) are drawn as stick figures. Mermaid 12’s redux-color theme, neo look, ELK layout, and the usecase frontmatter config are not used.