LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gvpack

Merge and pack disjoint graphs

TLDR

Merge laid-out graphs
$ gvpack [graph1.dot] [graph2.dot] > [merged.dot]
copy
Pack at graph level (prevents interleaving)
$ gvpack -g [graph1.dot] [graph2.dot] > [merged.dot]
copy
Pack at node level (ignoring clusters)
$ gvpack -n [graph1.dot] [graph2.dot] > [merged.dot]
copy
Combine without packing
$ gvpack -u [graph1.dot] [graph2.dot] > [merged.dot]
copy
Arrange in array layout with margin
$ gvpack -array -m [20] [graph1.dot] [graph2.dot] > [merged.dot]
copy
Set graph attributes on output
$ gvpack -G "label=[My Graph]" [graph1.dot] [graph2.dot] > [merged.dot]
copy
Full pipeline: decompose, layout, pack, render
$ ccomps -x [graph.dot] | dot | gvpack | neato -s -n2 -Tpng -o [output.png]
copy

SYNOPSIS

gvpack [options] [files]

DESCRIPTION

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.

PARAMETERS

-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.

INSTALL

sudo apt install graphviz
copy
sudo dnf install graphviz
copy
sudo pacman -S graphviz
copy
sudo apk add graphviz
copy
sudo zypper install graphviz
copy
brew install graphviz
copy
nix profile install nixpkgs#graphviz
copy

CAVEATS

All input graphs must be either all directed or all undirected. Nodes with the same names across graphs are automatically renamed to avoid conflicts.

SEE ALSO

dot(1), neato(1), ccomps(1), fdp(1), twopi(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid