Execute Graphviz actions

Execute Graphviz actions use the Graphviz graphics package to generate directed or undirected graphs that are stored in Image datasets. In order to use this action, Graphviz must be installed on the LiveCompare server, and in the Configuration - General screen, the GraphvizPath field must be set to the directory location of the Graphviz program files.

Execute Graphviz actions generate graphs using:

  • The specified layout engine, stored in the Command property.

  • Graph attributes stored in the Graph Attributes property.

  • Default node attributes stored in the Node Attributes property.

  • Source data specifying the graph’s nodes and links, stored in the Source property.

Action property Description
Command A String parameter specifying the layout engine to use when generating graphs.
Graph Attributes A String List parameter specifying the display attributes for the graph. The parameter should be set to a list of <Attribute>=<Value> entries, with each entry stored as a separate list element.
Node Attributes A String List parameter specifying the display attributes for the graph’s nodes. A String List parameter specifying the display attributes for the graph. The parameter should be set to a list of <Attribute>=<Value> entries, with each entry stored as a separate list element.
Result An Image dataset that stores the generated graph.
Source A Table parameter or dataset that defines the graph’s nodes and their connections.

Command

The Command parameter specifies which layout engine to use for generating graphs. It may be set to one of the following:

Command Description
dot Used to generate directed graphs.
fdp A layout engine for undirected graphs.
neato Generates ‘spring model’ or ‘energy minimized’ graphs.
sfdp A layout engine for undirected graphs that scales to generate very large graphs.
twopi Used for radial graph layouts.

Graph attributes

Graph Attributes specify the display attributes for the graph. The following attributes may be set in the Graph Attributes parameter, using the format <Attribute>=<Value> for each string element.

Attribute Description
label The label or caption to be displayed on the graph’s background, for example, "My Graph".
labelloc The location of the graph’s label, either top or bottom. If you don’t set this attribute, the action uses bottom as the default value.
labeljust The horizontal alignment used to display the graph’s label, either left, center or right. If you don’t set this attribute, the action uses center as the default value.
fontname The font to be used for the label text, for example, helvetica, "helvetica bold" or "helvetica bold italic". If you don’t set this attribute, the action uses times-roman as the default value.
fontcolor The color to be used for the label text, for example, blue. If you don’t set this attribute, the action uses black as the default value.
fontsize The point size of the label text, for example, 10. If you don’t set this attribute, the action uses 14 as the default value.

A complete list of graph attributes may be found at: http://www.graphviz.org/doc/info/attrs.html.

Node attributes

Node Attributes specify the display attributes for the graph’s nodes. The following attributes may be set in the Node Attributes parameter, using the format <Attribute>=<Value> for each string element.

Attribute Description
sides The number of sides that the nodes have, used only of the shape attribute is set to polygon. If you don’t set this attribute, the action uses 4 as the default value.
color The background color used for the nodes, for example, yellow. If you don’t set this attribute, the action uses white as the default value.
style The style used to display the nodes, either filled, striped, wedged, diagonals or rounded. Note that the striped style is only supported for rectangular nodes. If you don’t set this attribute, the action displays the nodes as unfilled.
fontname The font to be used for the nodes’ text, for example, helvetica, "helvetica bold" or "helvetica bold italic". If you don’t set this attribute, the action uses times-roman as the default value.
fontcolor The color to be used for the nodes’ text, for example, blue. If you don’t set this attribute, the action uses black as the default value.
fontsize The point size of the nodes’ text, for example 10. If you don’t set this attribute, the action uses 14 as the default value.

You can find a complete list of node attributes at: http://www.graphviz.org/doc/info/attrs.html.

Source

The Source Table parameter or dataset defines the nodes in the graph and their connections. The Source table should have the following columns:

Column Description
SOURCE The name of a source node.
TARGET The name of a target node to which the source node is linked.
SOURCE_ATTRIBUTES The node attributes for the source node, specified as a comma-separated list of <Attribute>=<Value> entries. Any attributes specified in this column for individual nodes overwrite the attributes set in the Node Attributes parameter.
TARGET_ATTRIBUTES The node attributes for the target node, specified as a comma-separated list of <Attribute>=<Value> entries. Any attributes specified in this column for individual nodes overwrite the attributes set in the Node Attributes parameter.
EDGE_ATTRIBUTES The attributes used to display the link between two nodes, specified as a comma-separated list of <Attribute>=<Value> entries.

The following attributes may be specified in the EDGE_ATTRIBUTES column:

Attribute Description
label A text label associated with the link, for example, “My Link”.
fontname The font to be used for the label text, for example, helvetica, "helvetica bold" or "helvetica bold italic". If you don’t set this attribute, the action uses times-roman as the default value.
fontcolor The color to be used for the label text, for example, blue. If you don’t set this attribute, the action uses black as the default value.
fontsize The point size of the label text, for example 10. If you don’t set this attribute, the action uses 14 as the default value.
penwidth The width of the link in points. If you don’t set this attribute, the action uses 1 as the default value.
arrowhead The style to be used for the arrowhead on the head node of a link, for example, normal, inv, dot, invdot, none, empty. If you don’t set this attribute, the action uses normal as the default value. See https://graphviz.org/docs/attr-types/arrowType for a complete list of arrow types.
arrowsize A scale factor for the size of arrowheads. If you don’t set this attribute, the action uses 1 as the default value.

A complete list of edge attributes may be found at: http://www.graphviz.org/doc/info/attrs.html.

Example

Execute Graphviz action example.

Related topics

Execute Graphviz action examples