Linux command
gvpack 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Merge laid-out graphs
gvpack [graph1.dot] [graph2.dot] > [merged.dot]
Pack at graph level
gvpack -g [graph1.dot] [graph2.dot] > [merged.dot]
Pack at node level
gvpack -n [graph1.dot] [graph2.dot] > [merged.dot]
Combine without packing
gvpack -u [graph1.dot] [graph2.dot] > [merged.dot]
Arrange in array layout with margin
gvpack -array -m [20] [graph1.dot] [graph2.dot] > [merged.dot]
Set graph attributes on output
gvpack -G "label=[My Graph]" [graph1.dot] [graph2.dot] > [merged.dot]
Full pipeline: decompose, layout, pack, render
ccomps -x [graph.dot] | dot | gvpack | neato -s -n2 -Tpng -o [output.png]
说明
gvpack reads in a stream of graphs, combines them into a single layout, and produces a single graph serving as the union of the input graphs. Input must be in dot format with layout information (produced by a layout engine like dot or neato without the -T flag). By default, packing is at cluster level, preventing graph parts from overlapping. Output can be rendered with neato -s -n2 and the desired output format.
参数
- -g
- Pack at graph level. Uses more space but prevents parts of one graph from occurring between parts of another.
- -n
- Pack at node level, ignoring clusters.
- -u
- Combine without packing. Just merge into a single graph.
- -array_flags__n_
- Arrange graphs in an array layout. Optional flags: c (column-major), t/b/l/r (align top/bottom/left/right), u (use sortv attribute). Optional _n_ sets columns (or rows with c).
- -m _margin_
- Packing margin in points around each part.
- -o _file_
- Output to file instead of stdout.
- -s _name_
- Root graph name (default: root).
- -G _name=value_
- Add attributes to the resulting union graph.
- -v
- Verbose mode.
FAQ
What is the gvpack command used for?
gvpack reads in a stream of graphs, combines them into a single layout, and produces a single graph serving as the union of the input graphs. Input must be in dot format with layout information (produced by a layout engine like dot or neato without the -T flag). By default, packing is at cluster level, preventing graph parts from overlapping. Output can be rendered with neato -s -n2 and the desired output format.
How do I run a basic gvpack example?
Run `gvpack [graph1.dot] [graph2.dot] > [merged.dot]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -g do in gvpack?
Pack at graph level. Uses more space but prevents parts of one graph from occurring between parts of another.