gvmap
find clusters and create a geographical map highlighting clusters.
- Provided by: graphviz (Version: 2.42.4-3build2)
- Report a bug
find clusters and create a geographical map highlighting clusters.
gvmap [ options ] [ -o outfile ] [ files ]
gvmap takes as input a graph in DOT format, finds node clusters and produces a rendering of the graph as a geographic-style map, with clusters highlighted as countries, in xdot format.
In the input graph, each node must have position, width and height information (pos, width and height attributes, respectively) defined, and nodes must not overlap.
By default, gvmap will generate the clusters from the data. If desired, the input graph can specify cluster information by giving every node a cluster attribute whose value is a small positive integer. (It is works best if cluster values are all integers in the interval [1,K] for some K. Nodes sharing the same cluster attribute value will be put into the same cluster. N.B. For the cluster attribute to be used, all nodes must have a valid value.
If the -D flag is used, gvmap will use the top-level cluster subgraphs to determine the clustering. Any nodes not in such a cluster will be put into a single catch-all cluster.
If the input specifies the desired clustering as described above, it can also specify a desired coloring by having some node in each cluster provide a clustercolor attribute. N.B. Unless one specifies -c0, only the clustercolor of the last node in a cluster has an effect. In addition, unless one uses -O, gvmap may permute the given colors.
The following options are supported:
Given a graph foo.gv, one way to generate a layout and highlight the clusters is to first select a layout engine with a suitable overlap removal method, then feed the output to gvmap, and finally render the map using specific graphics format. For example, the following pipeline creates a map with edges in semi-transparent light gray and nodes laid out using sfdp:
sfdp -Goverlap=prism foo.gv | gvmap -e | neato -n2 -Ecolor=#55555522 -Tpng > foo.png
The shell script gvmap.sh provides a shorthand for such pipelines. For example, the above pipeline can be achieved using
gvmap.sh -Ae -Ecolor=#55555522 -Tpng foo.gv > foo.png
Yifan Hu <yifanhu@yahoo.com>
gvmap.sh(1), sfdp(1), neato(1), gvpr(1)
E. R. Gansner, Y. Hu, S. G. Kobourov, "GMap: Visualizing graphs and clusters as maps," Proc. Pacific Vis. 2010, pp. 201‐208.