|
The following example shows a typed syntax tree. This tree
can either be drawn by the specialized algorithm for "downward laid-out
trees" or by the normal algorithms. When the normal algorithms are used
to draw a tree, it is advisable to increase the layout down factor in order to
obtain good results (see Figure 1). If the layout down factor is not used, the
incoming edges draw the nodes too much in the direction of the parent node.
A nice layout is achieved by the specialized tree algorithm
with a tree factor of 0.9 (see Figure 2).
If an orthogonal layout is needed, the attribute
smanhattan_edges
can be used (see Figure 3). For trees, this attribute is more appropriate
than the standard Manhattan layout with
manhattan_edges.
graph: {title: "Typed Syntax Tree"
//...
node: { title:"Identifier\ntst3 (0)" }
node: { title:"Identifier\nx (0)" }
node: { title:"INTEGER" }
node: { title:"VarDecl" }
// ...
node: { title:"no type" }
node: { title:"int" }
// ...
nearedge: { source:"Identifier\ntst3 (0)"
target:"int" }
// ...
}
|