layout.data Function (GPL)
Syntax
layout.data(<algebra>, <function>)
or
layout.data(<function>))
<algebra>. Graph algebra, such as x*y
.
Refer to Brief Overview of GPL Algebra for an introduction to graph algebra. Unlike
other network graphs, the algebra determines the position of elements
and ties the position to a specific coordinate value (such as a value
on a dimension). You can omit the algebra for edges if you are using
algebra in another ELEMENT
statement to specify the
position of the points.
<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 in the coordinate positions specified by the data. The function is used for network graphs, which are visual representations of data that consist of nodes and relations between nodes (edges).
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: point(position(layout.data(x*y, node(id), from(fromVar), to(toVar))), label(id))
ELEMENT: edge(position(layout.data(node(id), from(fromVar), to(toVar))))