Block elements¶
Block elements helps you structure your diagram logically and/or spatially. The spatial elements are: Sequence, Stack and Group; Logical elements are OptionalSequence, Choice, MultipleChoice, Optional, OneOrMore, ZeroOrMore, AlternatingSequence, and finally HorizontalChoice combines both spatial and logic.
Sequence¶
Sequence is a concatenation of other elements and requires at least one child element.
Syntax¶
Properties¶
- items: an array/list of elements
Output¶
Stack¶
Identical to a Sequence, but the items are stacked vertically rather than horizontally. Best used when a simple Sequence would be too wide; instead, you can break the items up into a Stack of Sequences of an appropriate width.
Syntax¶
Properties¶
- items: an array/list of elements
Output¶
Group¶
Highlights its child with a dashed outline, and optionally labels it. Passing a string as the label constructs a Comment, or you can build one yourself (to give an href or title). The DSL parser only accepts text labels, the JSON and YAML parsers accept any element as well as text.
Syntax¶
Properties¶
- label: optional, can be a string, or when using the JSON or YAML parsers, any element. The most likely case is using a Comment but any element will work.
- item : a single element, mandatory.
Output¶
Choice¶
An exclusive choice among all branches.
Syntax¶
Without default:
With a default branch:
Properties¶
- default: int, optional (if not set: 0). Specifies which child is the "normal" choice and should go in the middle (starting from 0 for the first child).
- items: an array/list of elements. Each element will have its own line.
Output¶
HorizontalChoice¶
Identical to Choice, but the items are stacked horizontally rather than vertically. There's no "straight-line" choice, so it just takes a list of children. Best used when a simple Choice would be too tall; instead, you can break up the items into a HorizontalChoice of Choices of an appropriate height.
Syntax¶
Properties¶
- items: an array/list of elements. Each element will have its own "column".
Output¶
MultipleChoice¶
Similar to a Choice, but more than one branch can be taken.
Syntax¶
Properties¶
All properties are mandatory.
- default: int, specifies which child is the "normal" choice and should go in the middle
- type: either any (1+ branches can be taken) or all (all branches must be taken).
- items: an array/list of elements. Each element will have its own line.
Output¶
Optional¶
A shorthand for Choice(0|1, Skip(), child).
Syntax¶
Properties¶
- skip: with DSL, this is either empty or the string "skip" ; in JSON/YAML, this is an optional boolean (false if not specified).
- item: an element, mandatory.
Output¶
OptionalSequence¶
A Sequence where every item is individually optional, but at least one item must be chosen.
Properties¶
- items: an array/list of elements
Output¶
OneOrMore¶
A loop that requires taking the first element at least once. The loop is typically a Comment but can be any element.
Syntax¶
Simple repeat:
Repeat with an element:
Properties¶
- item : a single element, mandatory.
- repeat: if empty, will just draw a line, else will insert the element on the loop. With the DSL parser, this is a string.
Output¶
ZeroOrMore¶
A shorthand for Optional(OneOrMore(child, repeat), skip). Like OneOrMore, this is a loop, but it can be skipped.
Syntax¶
Simple ZeroOrMore:
ZeroOrMore with an element and skip as default::
Simple ZeroOrMore:
ZeroOrMore with an element and skip as default:
Properties¶
- item : a single element, mandatory.
- repeat: if omitted, will just draw a line, else will insert the element on the loop. With the DSL parser, this is a string.
- skip: with DSL, this is either empty or the string "skip" ; in JSON/YAML, this is an optional boolean (false if not specified).
Output¶
AlternatingSequence¶
Similar to a OneOrMore, where you must alternate between the two choices, but allows you to start and end with either element (OneOrMore requires you to start and end with the "child" node).
Syntax¶
Properties¶
- items: an array/list of exactly two elements