LinuxCommandLibrary

fdp

TLDR

Generate graph from DOT file

$ fdp -Tpng [graph.dot] -o [output.png]
copy
Output SVG format
$ fdp -Tsvg [graph.dot] -o [output.svg]
copy
Process from stdin
$ echo 'graph { a -- b }' | fdp -Tpng -o [output.png]
copy
Set graph attributes
$ fdp -Gsize="10,10" -Tpng [graph.dot] -o [output.png]
copy

SYNOPSIS

fdp [options] [files]

DESCRIPTION

fdp is a Graphviz layout engine for drawing undirected graphs using a force-directed placement algorithm. It positions nodes by simulating physical forces between connected and unconnected nodes.
The spring model algorithm treats edges as springs and nodes as charged particles. It iteratively adjusts positions until reaching equilibrium, producing aesthetically pleasing layouts for many graph types.
fdp is suited for undirected graphs where node clustering and edge lengths should reflect graph structure.

PARAMETERS

FILES

DOT graph files to process.
-T FORMAT
Output format: png, svg, pdf, ps, etc.
-o FILE
Output file.
-G ATTR=VALUE
Set graph attribute.
-N ATTR=VALUE
Set node attribute.
-E ATTR=VALUE
Set edge attribute.
-K LAYOUT
Override layout engine.
--help
Display help information.

CAVEATS

May not converge for very large graphs. Random initial placement means non-deterministic results. Better for undirected graphs than directed.

HISTORY

fdp is part of Graphviz, the graph visualization software from AT&T Labs. It implements force-directed placement algorithms developed for graph drawing research, providing an alternative to dot's hierarchical layout.

SEE ALSO

dot(1), neato(1), sfdp(1)

Copied to clipboard