DOT (graph description language) explained

DOT
Noextcode:on
Extensions:.gv
Nomimecode:on
Genre:Graph description language
Open:Yes

DOT is a graph description language, developed as a part of the Graphviz project. DOT graphs are typically stored as files with the .gv or .dot filename extension.gv is preferred, to avoid confusion with the .dot extension used by versions of Microsoft Word before 2007.[1] dot is also the name of the main program to process DOT files in the Graphviz package.

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]

Syntax

Graph types

Undirected 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 graph keyword is used to begin a new graph, and nodes are described within curly braces. A double-hyphen (--) is used to show relations between the nodes.// The graph name and the semicolons are optionalgraph graphname

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 keyword is used to begin the graph, and an arrow (->) is used to show relationships between nodes.digraph graphname

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 [] after a statement and before the semicolon (which is optional). Graph attributes are specified as direct attribute–value pairs under the graph element, where multiple attributes are separated by a comma or using multiple sets of square brackets, while node attributes are placed after a statement containing only the name of the node, but not the relations between the dots.

graph graphname HTML-like labels are supported, although initially Graphviz did not handle them.[4]

Comments

DOT supports C and C++ style single line and multiple line comments. In addition, it ignores lines with a number sign symbol # as their first character, like many interpreted languages.

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

See also

External links

Notes and References

  1. Web site: File extension .dot or .gv? . marc.info . 2011-03-08.
  2. Web site: 2022-11-14 . 'dot' name (etymology) . 2023-07-10 . Graphviz . en.
  3. Web site: Node, Edge and Graph Attributes. graphviz.org. 2017-05-12.
  4. Web site: Node Shapes: HTML-Like Labels. graphviz.org. 2017-05-12.
  5. Web site: canviz: graphviz on a canvas . 2017-06-02.
  6. Web site: GitHub - magjac/d3-graphviz: Graphviz DOT rendering and animated transitions using D3 . github.com . 2018-06-06.
  7. Web site: Import data in DOT language . vis.js . 2018-12-22.
  8. Web site: hpcc-js/wasm . 2020-10-21.
  9. Web site: ZGRViewer . zvtm.sourceforge.net . 2017-05-12.
  10. Web site: dot2tex – A Graphviz to LaTeX converter . dot2tex.readthedocs.io . 2019-11-01.
  11. Web site: Data Visualization Software – Tulip . tulip.labri.fr . 2017-05-12.
  12. Web site: GitHub - gvhung/vizierfx: Automatically exported from code.google.com/p/vizierfx . github.com . 2017-05-12.