aiSee for Unix: User Manual<>index

Example of a cyclic graph

These examples show the effect of different edge types on the graph layout. The last example in this sequence shows how the anchor edge attribute is used.

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").

graph: {

node: {title:"A"}
node: {title:"B"}
node: {title:"C"}
node: {title:"D"}
node: {title:"E"}

edge: {source:"A" target:"B"}  // 1
edge: {source:"A" target:"C"}  // 2
edge: {source:"C" target:"D"}  // 3
edge: {source:"D" target:"E"}  // 4
edge: {source:"D" target:"A"}

}

2. Back edge

The edge to be reverted can be specified as a back edge.

backedge: {source:"C" target:"D"}  // 3

3. Near edges

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

nearedge: {source:"A" target:"B"}  // 1
nearedge: {source:"A" target:"C"}  // 2
nearedge: {source:"D" target:"E"}  // 4

4. Bent near edges

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.

bentnearedge: {source:"A" target:"B"}  // 1
bentnearedge: {source:"D" target:"E"}  // 4

5. Right/left (bent) near edges

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.

rightbentnearedge: {source:"A" target:"B"}  // 1
     leftnearedge: {source:"A" target:"C"}  // 2
rightbentnearedge: {source:"D" target:"E"}  // 4

6. Edge anchors

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 resulting specification looks like this:

graph: {

node: {title:"A"}
node: {title:"B"}
node: {title:"C"}
node: {title:"D" label:"Field1\nField2"}
node: {title:"E"}

bentnearedge: {source:"A" target:"B"}
    nearedge: {source:"A" target:"C"}
    backedge: {source:"C" target:"D"}
        edge: {source:"D" target:"E" anchor:1}
        edge: {source:"D" target:"A" anchor:2}

}

» Next: Example of a control flow graph
» Prev.: Region format

HomeSitemapai
Last modified on 29 April 2002 by webmaster. © 2000-2002 AbsInt.
URL: http://www.aisee.com/manual/unix/38.htm


Home
About
Examples
Free trial

 Help
» FAQs
» Quick Guide
» User Manual
   » Windows
   » Mac
» GDL
» Options
» Changelog
» GDLedit

Store
Legal
Contact
Extras
Sitemap