Up: Component summary Component

GraphVisualizer

Creates a visualization of a graph using Graphviz. There are several layout options (see the parameter layout) and make aspects of the nodes and edges can be customized. In addition to the parameters mentioned here, nodes and edges can have many other GraphML attributes that are used to set rendering options for individual nodes and edges. For the full list, see Graphviz documentation.

Tip: to create as small nodes as possible, set width=0.01, height=0.01 and control node size with margin (e.g. margin="0.03,0.02"). Also decrease text size, e.g. fontsize=10.

Version 1.2
Bundle tools
Categories Graph Plot
Authors Kristian Ovaska (kristian.ovaska@helsinki.fi)
Issue tracker View/Report issues
Requires Graphviz ; ghostscript (DEB) ; igraph (R-package)
Source files component.xml GraphVisualizer.r
Usage Example with default values

Inputs

Name Type Mandatory Description
in GraphML Mandatory Input graph

Outputs

Name Type Description
out Latex Latex fragment that contains the visualization of the graph.

Parameters

Name Type Default Description
arrowhead string "" Type of arrow heads (the target end of the arrow). See Graphviz documentation for the format. If empty, the default type is used. Or, if the edge attribute "arrowhead" is defined in the GraphML file, each edge gets its type from this attribute.
arrowtail string "" Type of arrow tails (the source end of the arrow). See Graphviz documentation for the format. If empty, the default type is used. Or, if the edge attribute "arrowtail" is defined in the GraphML file, each edge gets its type from this attribute.
bgcolor string "" Background color for the canvas. See Graphviz documentation for the format. If empty, the default color is used.
circo string "circo" Graphviz/circo execution command. Only used if the layout parameter specifies this program.
dot string "dot" Graphviz/dot execution command. Only used if the layout parameter specifies this program.
edgeTitle string "label" Name of the edge attribute that is used as the title of the edge in the visualization. The attribute may contain multiple values that are separated by commas. Each attribute is tried in the order given and the first that is defined is used.
edgecolor string "" Color for drawing edges and arrows, but not text. See Graphviz documentation for the format. If empty, the default color (black) is used. Or, if the edge attribute "color" is defined in the GraphML file, each edge gets its color from this attribute.
fdp string "fdp" Graphviz/fdp execution command. Only used if the layout parameter specifies this program.
fillcolor string "" Color for filling the background of nodes. See Graphviz documentation for the format. If empty, no filling is done. Or, if the node attribute "fillcolor" is defined in the GraphML file, each node gets its color from this attribute.
fontcolor string "" Color for text. See Graphviz documentation for the format. If empty, the default color (black) is used. Or, if the node/edge attribute "fontcolor" is defined in the GraphML file, each node/edge gets its color from this attribute.
fontsize float 0 Font size of text, in points. A typical value is 14. If zero, the default size is used. Or, if the node/edge attribute "fontsize" is defined in the GraphML file, each node/edge gets its font size from this attribute.
height float 0 Minimum height of nodes in INCHES. Depending on layout type, this might also be the final height. If zero, the default height is used. Or, if the node attribute "height" is defined in the GraphML file, each node gets its height from this attribute.
latexHead string "" Raw LaTeX content that will be written to the beginning of the output document
latexTail string "" Raw LaTeX content that will be written to the end of the output document
layout string "hierarchical" Determines how the visualization is layed out. Valid choices are "hierarchical" (layout done using dot), "spring" (neato: Kamada-Kawai algorithm), "spring2" (fdp: Fruchterman-Reingold algorithm), "radial" (twopi) and "circular" (circo) .
margin string "" Margin around the label of nodes. If given, this is a pair x,y of margin space in inches. If the value is empty, the default margin is used; in Graphviz 2.18 it is "0.11,0.055". Or, if the node attribute "margin" is defined in the GraphML file, each node gets its margin from this attribute.
minSize int 0 Minimum number of vertices to render the graph. The whole image will be skipped if there are too few vertices available.
neato string "neato" Graphviz/neato execution command. Only used if the layout parameter specifies this program.
nodecolor string "" Color for drawing the boundaries of nodes, but not text. See Graphviz documentation for the format. If empty, the default color (black) is used. Or, if the node attribute "color" is defined in the GraphML file, each node gets its color from this attribute.
overlap string "" Determines how overlapping nodes are handled. This corresponds to the "overlap" graph attribute in Graphviz. If the value is "true", overlapping nodes are allowed. The values "false", "scale", "ortho", "compress" and "vpsc" remove overlaps using different methods. See Graphviz documentation for details. If the value is empty, default handling is done.
ps2pdf string "ps2pdf" PS2PDF execution command.
rankdir string "" For hierarchical layouts, the layout direction. One of TB (top-to-bottom, default), BT, LR (left-to-right), RL.
reportCaption string "" Caption of the figure in the Latex report.
reportHeight float 11 Height of the figure in the Latex report in cm.
reportWidth float 14 Width of the figure in the Latex report in cm.
shape string "" Shape of the nodes. Some legal values include box, polygon, ellipse, circle, point, triangle, plaintext, diamond, none, note, box3d, component; for the rest, see Graphviz documentation. If the value is empty, the default shape (ellipse) is used. Or, if the node attribute "shape" is defined in the GraphML file, each node gets its shape from this attribute.
simplify boolean false If true, simplify the graph by removing self-loop edges and multiple edges between two vertices.
size string "8,8" Maximum width and height of the image, in INCHES.
splines string "true" Determines if edges are drawn as straight lines or curves (splines). This corresponds to the "splines" graph attribute in Graphviz. If "true", splines are enabled. If "false", straight lines are used. If the value is empty, default settings are used.
titleAttribute string "label,id" Name of the vertex attribute that is used as the title of the vertex in the visualization. The attribute may contain multiple values that are separated by commas. Each attribute is tried in the order given and the first that is defined is used. For example, if the value is "label,id", then label is used if it is defined, and id is used otherwise. The id attribute is always present.
twopi string "twopi" Graphviz/twopi execution command. Only used if the layout parameter specifies this program.
width float 0 Minimum width of nodes in INCHES. Depending on layout type, this might also be the final width. If zero, the default width is used. Or, if the node attribute "width" is defined in the GraphML file, each node gets its width from this attribute.

Test cases

Test case Parameters IN
in
OUT
out
case1_dot (missing) in out
case2_neato properties in out

layout=spring,
titleAttribute=title

case3_twopi properties in out

layout=radial,
titleAttribute=title,
shape=box,
nodecolor=red,
edgecolor=yellow,
fillcolor=green,
fontcolor=blue,
arrowhead=diamond,
arrowtail=dot,
bgcolor=\#eeaaff,
height=0.7,
width=0.1,
fontsize=8

case4_circo properties in out

layout=circular,
titleAttribute=title

case5_fdp properties in out

layout=spring2,
titleAttribute=title,
splines=false

case6_minSize properties in out

minSize = 2


Generated 2019-02-08 07:42:16 by Anduril 2.0.0