next up previous contents index
Next: Control Flow Graph Up: Examples of GDL Specifications Previous: Examples of GDL Specifications

A Cyclic Graph

These examples show a number of small cyclic graphs without any labels but with different edge types. The titles are displayed in the nodes. The last example in this sequence shows how the anchor edge attribute is used.

The layout of the following three example specifications are shown in Figure 14.

Example 1: Ordinary Edges
aiSee tries to give all edges the same orientation. But since the graph is cyclic, one edge has to be reverted (edge D->A).

<>01  graph: {
<>02       /* list of nodes */
<>03       node: { title: "A" } node: { title: "B" }
<>04       node: { title: "C" } node: { title: "D" }
<>05       node: { title: "E" }
<>06       /* list of edges */
<>07       edge: { thickness: 3 sourcename: "A" targetname: "B" }
<>08       edge: { thickness: 3 sourcename: "A" targetname: "C" }
<>09       edge: { thickness: 3 sourcename: "C" targetname: "D" }
<>10       edge: { thickness: 3 sourcename: "D" targetname: "E" }
<>11       edge: { thickness: 3 sourcename: "D" targetname: "A" }
<>12  }

Example 2: Back Edge
The edge to be reverted can be specified as a back edge.

<>09       backedge: { thickness: 3 sourcename: "C" targetname: "D" }

Example 3: Near Edges
Near edges can be used to express a close relationship between two nodes and to place nodes right- or left-neighbored.

<>07       nearedge: { thickness: 3 sourcename: "A" targetname: "B" }
<>08       nearedge: { thickness: 3 sourcename: "A" targetname: "C" }
<>10       nearedge: { thickness: 3 sourcename: "D" targetname: "E" }


  
Figure 14: Ordinary, Back and Near Edges
\begin{figure}\begin{center}
\epsfig{file=pics_vcg/example1.eps}
\end{center}\end{figure}

The layout of the following three example specifications are shown in Figure 15.

Example 4: Bent Near Edge
In some situations, edges are to be horizontally anchored, like near edges, yet the target node is not to be at the same level. These edges have to have a bend point. This is why bent near edges are used.

<>07       bentnearedge: { thickness: 3 sourcename: "A" targetname: "B" }
<>10       bentnearedge: { thickness: 3 sourcename: "D" targetname: "E" }

Example 5: Right-Bent Near Edge
The left or right versions of bent near edges or near edges can be used if it is important to have edges anchored to a particular side of a node.

<>07       rightbentnearedge: { thickness: 3 sourcename: "A" targetname: "B" }
<>08       leftnearedge: { thickness: 3 sourcename: "A" targetname: "C" }
<>10       rightnearedge: { thickness: 3 sourcename: "D" targetname: "E" }
Example 6: Anchor
The anchor edge attribute can be used if a node label consists of one or more fields that are on separate lines where outgoing edges are to start. For example, if node D represents a struct with two fields whose first field is to point to node E and the second one to node A, then the edges are anchored to the corresponding anchor points 1 and 2. Counting of anchor points starts with 1 at the top of a node and increases from top to bottom.

Anchor points and near edge specifications cannot be used together, consequently the specification for Example 6 looks like this:

<>01  graph: {
<>02       /* list of nodes */
<>03       node: { title: "A" } node: { title: "B" }
<>04       node: { title: "C" } node: { title: "D" label: "Field1\nField2" }
<>05       node: { title: "E" }
<>06       /* list of edges */
<>07       bentnearedge: { thickness: 3 sourcename: "A" targetname: "B" }
<>08       nearedge: { thickness: 3 sourcename: "A" targetname: "C" }
<>09       backedge: { thickness: 3 sourcename: "C" targetname: "D" }
<>10       edge: { thickness: 3 sourcename: "D" targetname: "E" anchor: 1 }
<>11       edge: { thickness: 3 sourcename: "D" targetname: "A" anchor: 2}
<>12  }


  
Figure 15: Bent Near, Right-Bent Near and Anchor Edges
\begin{figure}\begin{center}
\epsfig{file=pics_vcg/example2.eps}
\end{center}\end{figure}


next up previous contents index
Next: Control Flow Graph Up: Examples of GDL Specifications Previous: Examples of GDL Specifications
© AbsInt Angewandte Informatik GmbH