Text elements
Text elements are single elements on the diagram and the base building blocks. They are either Terminal , NonTerminal , Comment , Arrow or Skip .
Terminal
Terminal represents literal text. The Terminal element has a required property text
, and three optional properties href
, title
and cls
. The last two properties are only available with the JSON and YAML parsers.
Syntax
DSL JSON YAML
Basic syntax:
With a href:
Terminal https://github.com: github
Basic syntax:
{
"element" : "Terminal" ,
"text" : "my text"
}
With href:
{
"element" : "Terminal" ,
"text" : "github" ,
"href" : "https://github.com"
}
With additional options:
{
"element" : "Terminal" ,
"text" : "github" ,
"href" : "https://github.com" ,
"title" : "This is a link" ,
"cls" : "custom_terminal"
}
Without a label:
element : Terminal
text : my text
With href
element : Terminal
text : github
href : https://github.com
With additional options:
element : Terminal
text : github
href : https://github.com
title : This is a link
cls : custom_terminal
Properties
text : string, required
href : string, optional
title : string, optional, only available with the JSON and YAML parsers
cls : string, optional, only available with the JSON and YAML parsers
Output
my text
Simple Terminal
github github
With href
github This is a link
With additional options (hover for the title)
NonTerminal
NonTerminal represents another production or diagram. The NonTerminal element has a required property text
, and three optional properties href
, title
and cls
. The last two properties are only available with the JSON and YAML parsers.
Syntax
DSL JSON YAML
Basic syntax:
With a href:
NonTerminal https://github.com: github
Basic syntax:
{
"element" : "NonTerminal" ,
"text" : "my text"
}
With href:
{
"element" : "NonTerminal" ,
"text" : "github" ,
"href" : "https://github.com"
}
With additional options:
{
"element" : "NonTerminal" ,
"text" : "github" ,
"href" : "https://github.com" ,
"title" : "This is a link" ,
"cls" : "custom_terminal"
}
Without a label:
element : NonTerminal
text : my text
With href
element : NonTerminal
text : github
href : https://github.com
With additional options:
element : NonTerminal
text : github
href : https://github.com
title : This is a link
cls : custom_terminal
Properties
text : string, required
href : string, optional
title : string, optional, only available with the JSON and YAML parsers
cls : string, optional, only available with the JSON and YAML parsers
Output
my text
Simple Terminal
github github
With href
github github This is a link
With additional options (hover for the title)
Represents a comment. The Comment element has a required property text
, and three optional properties href
, title
and cls
. The last two properties are only available with the JSON and YAML parsers.
Syntax
DSL JSON YAML
Basic syntax:
With a href:
Comment https://github.com: github
Basic syntax:
{
"element" : "Comment" ,
"text" : "my text"
}
With href:
{
"element" : "Comment" ,
"text" : "github" ,
"href" : "https://github.com"
}
With additional options:
{
"element" : "Comment" ,
"text" : "github" ,
"href" : "https://github.com" ,
"title" : "This is a link" ,
"cls" : "custom_terminal"
}
Without a label:
element : Comment
text : my text
With href
element : Comment
text : github
href : https://github.com
With additional options:
element : Comment
text : github
href : https://github.com
title : This is a link
cls : custom_terminal
Properties
text : string, required
href : string, optional
title : string, optional, only available with the JSON and YAML parsers
cls : string, optional, only available with the JSON and YAML parsers
Output
Simple Comment
With href
This is a link
With additional options (hover for the title)
Arrow
Syntax
DSL JSON YAML
Arrow right:
With a direction:
Undirected:
Arrow right:
With a direction:
{
"element" : "Arrow" ,
"direction" : "left|right"
}
Undirected (draws a line):
{
"element" : "Arrow" ,
"direction" : "undirected"
}
Arrow right:
With a direction:
element : Arrow
direction : left|right
Undirected:
element : Arrow
direction : undirected
Properties
direction : optional string, can be left or right to orient the arrow left or right, or any other string to draw a plain line instead.
Output
Arrow left
Arrow right
Undirected: a line
Skip
An empty line. Used for vertical blocks like Stack.
Syntax
Properties
This element has no properties.
Output
foo
foo
Stack without Skip
foo
foo
Stack with Skip