LinuxCommandLibrary

graphviz

Graph visualization toolkit

TLDR

Render DOT file to PNG

$ dot -Tpng [graph.dot] -o [graph.png]
copy
Render to SVG
$ dot -Tsvg [graph.dot] -o [graph.svg]
copy
Use different layout engine
$ neato -Tpng [graph.dot] -o [graph.png]
copy
Render to PDF
$ dot -Tpdf [graph.dot] -o [graph.pdf]
copy
Circular layout
$ circo -Tpng [graph.dot] -o [graph.png]
copy

SYNOPSIS

dot [options] [files]

DESCRIPTION

Graphviz is a graph visualization toolkit that reads graph descriptions in the DOT language and renders them as images. Multiple layout algorithms handle different graph types, from hierarchical directed graphs to force-directed undirected layouts.
The suite includes several layout programs (dot, neato, fdp, sfdp, circo, twopi) and utility tools for format conversion and graph manipulation.

PARAMETERS

-T format

Output format: png, svg, pdf, ps, jpg.
-o file
Output file.
-K engine
Layout engine: dot, neato, fdp, sfdp, circo, twopi.
-G name=value
Set graph attribute.
-N name=value
Set node attribute.
-E name=value
Set edge attribute.

LAYOUT ENGINES

$ dot    - Hierarchical (directed graphs)
neato  - Spring model (undirected)
fdp    - Force-directed
sfdp   - Scalable force-directed
circo  - Circular layout
twopi  - Radial layout
copy

DOT LANGUAGE

$ digraph G {
    A -> B;
    B -> C;
    A -> C;
    A [shape=box];
    B [color=red];
}
copy

CAVEATS

Large graphs may be slow to render. Layout quality varies by algorithm choice. Complex styling requires learning DOT attributes. Text rendering may vary by output format.

HISTORY

Graphviz was developed at AT&T Labs Research, with initial work by Stephen North, Emden Gansner, and others in the 1990s. It was open-sourced and became the standard for programmatic graph visualization.

SEE ALSO

dot(1), neato(1), mermaid(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community