DOT Diagram
Experiment syntax may change.
Introduction
This is a subset of Graphviz's DOT Language and visualization.
It can be used to describe a simple general graph.
Limitations
Graphviz is a versatile and wonderful visualization library, dotDiagram only covers a small part of its functionality.
- as the name implies, only
dotlayout is supported, and layout result is not the same as graphviz - ports are not supported
- many attributes can be parsed but not supported, they do not affect the result
Syntax
Compatible with Graphviz
The keywords node, edge, graph, digraph and subgraph.
A graph must be specified as either a digraph or a graph, they stand for directed and undirected graph. A digraph must specify an edge using the edge operator -> while an undirected graph must use --.
You can also specify attributes inside [key=val] square brackets.
The subgraph inherit the attribute settings of its parent graph at the time of its definition.
dotDiagram
%% pintora style comment
%% here we declare a directed graph
digraph G {
// specify graph attributes
bgcolor="white"
// specify common node attributes
node [color="#111",bgcolor=orange]
subgraph S1 {
// subgraph will inherit parent attributes
label="Sub";
a1 [fontcolor="purple",margint=10];
}
/* usually we put edges at the last */
a1 -> b1;
n1 -> end [color="blue"];
a2 -> end;
}