Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

DOT (graph description language)

From Wikipedia, the free encyclopedia
(Redirected fromDOT Language)
File format
DOT
Filename extensions.gv
Internet media typetext/vnd.graphviz
Type of formatGraph description language
Open format?Yes

DOT is agraph description language, developed as a part of theGraphviz project. DOT graphs are typically stored asfiles with the.gv or.dotfilename extension.gv is preferred, to avoid confusion with the.dot extension used by versions ofMicrosoft 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 asdot,neato,twopi,circo,fdp, andsfdp, can read a DOT file and render it in graphical form. Others, such asgvpr,gc,acyclic,ccomps,sccmap, andtred, read DOT files and perform calculations on the represented graph. Finally, others, such aslefty,dotty, andgrappa, 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 adag program which handled onlydirected acyclic graphs.[2]

Syntax

[edit]

Graph types

[edit]

Undirected graphs

[edit]
An undirected graph

At its simplest, DOT can be used to describe anundirected graph. An undirected graph shows simple relations between objects, such as reciprocal friendship between people. Thegraph 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 optionalgraphgraphname{a--b--c;b--d;}

Directed graphs

[edit]
A directed graph

Similar to undirected graphs, DOT can describedirected graphs, such asflowcharts and dependencytrees. The syntax is the same as for undirected graphs, except thedigraph keyword is used to begin the graph, and an arrow (->) is used to show relationships between nodes.

digraphgraphname{a->b->c;b->d;}

Attributes

[edit]
A graph with 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 moreattribute–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.

graphgraphname{// This attribute applies to the graph itselfsize="1,1";// The label attribute can be used to change the label of a nodea[label="Foo"];// Here, the node shape is changed.b[shape=box];// These edges both have different line propertiesa--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]

Comments

[edit]

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

Layout programs

[edit]
Binary tree generated in Graphviz from a DOT description by an onlineHuffman Tree generator

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

[edit]
  • Graphviz – a collection of CLI utilities and libraries to manipulate and render graphs into different formats likeSVG,PDF,PNG etc.
    • dot – CLI tool for conversion between.dot and other formats

JavaScript

[edit]
  • Canviz – aJavaScript library for rendering DOT files[5]
  • d3-graphviz – aJavaScript library based on Viz.js andD3.js that renders DOT graphs and supports animated transitions between graphs and interactive graph manipulation[6]
  • Vis.js – aJavaScript library that accept DOT as input for network graphs.[7]
  • Viz.js – a JavaScript port of Graphviz that provides a simple wrapper for using it in the browser.
  • hpcc-js/wasm Graphviz – a fast WASM library for Graphviz similar to Viz.js[8]

Java

[edit]
  • Gephi – an interactive visualization and exploration platform for all kinds of networks and complex systems, dynamic and hierarchical graphs
  • Grappa – a partial port of Graphviz toJava
  • graphviz-java – an open source partial port of Graphviz toJava available from github.com
  • ZGRViewer – a DOT viewer[9]

Other

[edit]

Notes

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

See also

[edit]
Wikimedia Commons has media related toDOT language.

External links

[edit]
Graph representations
Data structures
XML-based formats
Text-based formats
Related concepts
Retrieved from "https://en.wikipedia.org/w/index.php?title=DOT_(graph_description_language)&oldid=1256886929"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp