Linux command
unflatten 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Adjust graph layout
unflatten [input.dot] -o [output.dot]
Stagger leaf edge lengths
unflatten -l [3] [input.dot]
Fan out nodes
unflatten -f -l [3] [input.dot]
Form disconnected nodes
unflatten -c [5] [input.dot]
Pipe through dot
unflatten -l [4] [input.dot] | dot -Tpng -o [output.png]
说明
unflatten is a Graphviz preprocessor that improves the aspect ratio of directed graphs by breaking up long chains of nodes. It works by staggering the nodes in chains, converting some edges to increase the width of the graph relative to its height. The tool is designed to be used as a preprocessing step before the dot layout engine. When a graph has many nodes arranged in long vertical chains, dot tends to produce very tall, narrow layouts. Running unflatten first adjusts the graph structure so that dot produces a more balanced, readable result. Options control the maximum chain length before staggering occurs and whether leaf nodes should be fanned out. The tool reads DOT format input and produces modified DOT output that can be piped directly into dot or other Graphviz layout engines.
参数
- -l _len_
- Stagger the minimum length of leaf edges between 1 and _len_
- -f
- Fan out nodes whose indegree and outdegree are both 1 (only works with -l)
- -c _len_
- Form disconnected nodes into chains of up to _len_ nodes
- -o _file_
- Write output to _file_ instead of stdout
FAQ
What is the unflatten command used for?
unflatten is a Graphviz preprocessor that improves the aspect ratio of directed graphs by breaking up long chains of nodes. It works by staggering the nodes in chains, converting some edges to increase the width of the graph relative to its height. The tool is designed to be used as a preprocessing step before the dot layout engine. When a graph has many nodes arranged in long vertical chains, dot tends to produce very tall, narrow layouts. Running unflatten first adjusts the graph structure so that dot produces a more balanced, readable result. Options control the maximum chain length before staggering occurs and whether leaf nodes should be fanned out. The tool reads DOT format input and produces modified DOT output that can be piped directly into dot or other Graphviz layout engines.
How do I run a basic unflatten example?
Run `unflatten [input.dot] -o [output.dot]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l _len_ do in unflatten?
Stagger the minimum length of leaf edges between 1 and _len_