← 返回命令列表

Linux command

sfdp 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Layout graph

sfdp [input.dot] -o [output.png]

Output as SVG

sfdp -Tsvg [input.dot] -o [output.svg]

Large graph layout

sfdp -Goverlap=prism [input.dot] -o [output.png]

With custom parameters

sfdp -Gsize="10,10" [input.dot] -o [output.png]

说明

sfdp is a scalable force-directed placement engine for laying out large undirected graphs. It is part of the Graphviz suite and reads graphs in DOT format, producing visual layouts suitable for graphs with thousands to tens of thousands of nodes. The algorithm uses a multilevel approach that first coarsens the graph into progressively smaller representations, computes an initial layout on the coarsest level, then refines back through the levels. This strategy allows it to handle much larger graphs than simple force-directed methods like neato or fdp, while still producing aesthetically pleasing results that reveal community structure and clusters. Output can be rendered in various formats including PNG, SVG, and PDF. Graph, node, and edge attributes control visual appearance through the standard Graphviz attribute system.

参数

-T _FORMAT_
Output format (png, svg, pdf).
-o _FILE_
Output file.
-G _ATTR=VAL_
Graph attribute.
-N _ATTR=VAL_
Node attribute.
-E _ATTR=VAL_
Edge attribute.
-Goverlap _MODE_
Overlap removal.

FAQ

What is the sfdp command used for?

sfdp is a scalable force-directed placement engine for laying out large undirected graphs. It is part of the Graphviz suite and reads graphs in DOT format, producing visual layouts suitable for graphs with thousands to tens of thousands of nodes. The algorithm uses a multilevel approach that first coarsens the graph into progressively smaller representations, computes an initial layout on the coarsest level, then refines back through the levels. This strategy allows it to handle much larger graphs than simple force-directed methods like neato or fdp, while still producing aesthetically pleasing results that reveal community structure and clusters. Output can be rendered in various formats including PNG, SVG, and PDF. Graph, node, and edge attributes control visual appearance through the standard Graphviz attribute system.

How do I run a basic sfdp example?

Run `sfdp [input.dot] -o [output.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -T _FORMAT_ do in sfdp?

Output format (png, svg, pdf).