DOT (graph description language)
DOT is a graph description language, developed as a part of the Graphviz project. DOT graphs are typically stored as files with the Various programs can process DOT files. Some, such as dot, neato, twopi, circo, fdp, and sfdp, can read a DOT file and render it in graphical form. Others, such as gvpr, gc, acyclic, ccomps, sccmap, and tred, read DOT files and perform calculations on the represented graph. Finally, others, such as lefty, dotty, and grappa, provide an interactive interface. The GVedit tool combines a text editor and a non-interactive viewer. Most programs are part of the Graphviz package or use it internally. DOT is historically an acronym for "DAG of tomorrow", as the successor to a DAG format and a dag program which handled only directed acyclic graphs.[2] SyntaxGraph typesUndirected graphs![]() At its simplest, DOT can be used to describe an undirected graph. An undirected graph shows simple relations between objects, such as reciprocal friendship between people. The // The graph name and the semicolons are optional
graph graphname {
a -- b -- c;
b -- d;
}
Directed graphs![]() Similar to undirected graphs, DOT can describe directed graphs, such as flowcharts and dependency trees. The syntax is the same as for undirected graphs, except the digraph graphname {
a -> b -> c;
b -> d;
}
Attributes![]() Various attributes can be applied to graphs, nodes and edges in DOT files.[3] These attributes can control aspects such as color, shape, and line styles. For nodes and edges, one or more attribute–value pairs are placed in square brackets graph graphname {
// This attribute applies to the graph itself
size="1,1";
// The label attribute can be used to change the label of a node
a [label="Foo"];
// Here, the node shape is changed.
b [shape=box];
// These edges both have different line properties
a -- b -- c [color=blue];
b -- d [style=dotted];
// [style=invis] hides a node.
}
HTML-like labels are supported, although initially Graphviz did not handle them.[4] CommentsDOT supports C and C++ style single line and multiple line comments. In addition, it ignores lines with a number sign symbol Layout programs![]() The DOT language defines a graph, but does not provide facilities for rendering the graph. There are several programs that can be used to render, view, and manipulate graphs in the DOT language: General
JavaScript
Java
Other
Notes
See alsoWikimedia Commons has media related to DOT language. External links
|
Portal di Ensiklopedia Dunia