layout.dag Function (GPL)
Syntax
layout.dag(<function>))
or
layout.dag(<algebra>, <function>)
<algebra>. Graph algebra, such as x*y
.
Refer to Brief Overview of GPL Algebra for an introduction to graph algebra. The algebra
for network graphs is 1*1
because the position of
elements is determined by the layout method and is not tied to a coordinate
value (such as a value on a dimension). This algebra is implied and
needs to be specified for network graphs only when faceting is needed.
<functions>. Valid functions. The from
and to
functions
are required. The node
function is optional for edges,
allowing you to draw edges without a separate node data source.
Description
Lays out graphic elements as a directed acyclic graph (DAG). The
function is used for network graphs, which are visual representations
of data that consist of nodes and relations between nodes (edges).
The DAG layout should be used only for directed graphs without a
primary root node (compare with layout.tree
). This
layout produces tree-like structures from parent nodes down to leaf
nodes, so the layout works well with hierarchical data.
Note: Network
graphs that display nodes and edges require two data sources, one for the
unique nodes and one for the edges. If the edge data source includes weights
and the weight variable is indicated in the SOURCE
statement,
the weights influence the length of edges in the graph, with higher weights
having shorter edges.
Examples
ELEMENT: edge(position(layout.dag(node(id), from(fromVar), to(toVar))))
ELEMENT: point(position(layout.dag(node(id), from(fromVar), to(toVar))), label(id))