next up previous contents index
Next: Graph Attributes Up: Examples of GDL Specifications Previous: Tree Layout

Combination of Features

The following example (see Figure 25) is taken from [GKNV93] and shows the dependencies of different shell programs. A combination of aiSee features has been used to visualize it. There is a time scale to indicate the origin of the programs. The shells themselves are nodes that have to be placed at the same rank as their birth dates. The vertical_order attribute is used to set the nodes at these positions. In addition, the time axis should be positioned at the left side of the shell dependence graph. This is achieved by the horizontal_order attribute at some of the nodes. However, this attribute doesn't work unless the graph is connected, which is why three invisible edges are created.

Like any other edges, invisible edges influence the positions of the nodes. They pull their adjacent nodes together. To avoid this effect on the invisible edges, the priority of the invisible edges is set to zero and the priority of the visible edges to 100. There are many ways to change the priority. The priority attribute can be set, and the factors layout_downfactor, layout_downfactor and layout_downfactor as well. The real priority of a downward edge is the product layout_downfactor x priority.

The Bourne shell should be positioned to the left of the Mashey shell and the csh shell to the right of the Mashey shell. Therefore, the level two nodes receive a horizontal order. However, csh is on level three, and only its edge crosses level two. Therefore, the horizontal_order attribute is set for this edge as well. Now the edge is drawn to the right of the Mashey shell.

Default attribute specifications are used for the height, width and border width of nodes and for the style of edges in order to reduce the amount of specification. The various shell types are differentiated by using ellipses for the variations of the Korn shell, triangles for C shells and a rhomboid for the tcl shell. The graph is acyclic, which is why the layout algorithm minbackward is used. Edges are drawn by splines.


  
Figure 25: Example 12: Development of Shells
\begin{figure}
\begin{center}
\epsfig{file=pics_vcg/exa4.ps, height=13.5cm}
\end{center}\end{figure}

Example 12: Development of Shells
<>01  graph: {
<>02       title: "shells"
<>03       splines: yes
<>04       layoutalgorithm: minbackward
<>05       layout_nearfactor: 0
<>06       layout_downfactor: 100
<>07       layout_upfactor: 100
<>08       
<>09       // First the time scale
<>10       
<>11       node.height: 26
<>12       node.width: 60
<>13       node.borderwidth: 0
<>14       edge.linestyle: dashed
<>15       
<>16       node: { title: "1972" vertical_order: 1 horizontal_order: 1}
<>17       node: { title: "1976" vertical_order: 2 horizontal_order: 1 }
<>18       node: { title: "1978" vertical_order: 3 }
<>19       node: { title: "1980" vertical_order: 4 }
<>20       node: { title: "1982" vertical_order: 5 horizontal_order: 1 }
<>21       node: { title: "1984" vertical_order: 6 }
<>22       node: { title: "1986" vertical_order: 7 }
<>23       node: { title: "1988" vertical_order: 8 }
<>24       node: { title: "1990" vertical_order: 9 }
<>25       node: { title: "future" vertical_order: 10 horizontal_order: 1 }
<>26       
<>27       edge: { sourcename: "1972" targetname: "1976" }
<>28       edge: { sourcename: "1976" targetname: "1978" }
<>29       edge: { sourcename: "1978" targetname: "1980" }
<>30       edge: { sourcename: "1980" targetname: "1982" }
<>31       edge: { sourcename: "1982" targetname: "1984" }
<>32       edge: { sourcename: "1984" targetname: "1986" }
<>33       edge: { sourcename: "1986" targetname: "1988" }
<>34       edge: { sourcename: "1988" targetname: "1990" }
<>35       edge: { sourcename: "1990" targetname: "future" }
<>36       
<>37       // We need some invisible edge to make the graph fully connected.
<>38       // Otherwise, the horizontal_order attribute would not work.
<>39       
<>40       edge: { sourcename: "ksh-i" targetname: "Perl" linestyle: invisible priority: 0 }
<>41       edge: { sourcename: "tcsh" targetname: "tcl" linestyle: invisible priority: 0 }
<>42       nearedge: { sourcename: "1988" targetname: "rc" linestyle: invisible }
<>43       nearedge: { sourcename: "rc" targetname: "Perl" linestyle: invisible }
<>44       
<>45       // Now the shells themselves
<>46       // Note: the default value -1 means: no default
<>47       
<>48       node.height: -1
<>49       node.width: -1
<>50       node.borderwidth: 2
<>51       edge.linestyle: solid
<>52       
<>53       node: { title: "Thompson" vertical_order: 1 horizontal_order: 2 }
<>54       node: { title: "Mashey" vertical_order: 2 horizontal_order: 3 }
<>55       node: { title: "Bourne" vertical_order: 2 horizontal_order: 2 }
<>56       node: { title: "Formshell" vertical_order: 3 }
<>57       node: { title: "csh" vertical_order: 3 shape: triangle }
<>58       node: { title: "esh" vertical_order: 4 horizontal_order: 2 }
<>59       node: { title: "vsh" vertical_order: 4 }
<>60       node: { title: "ksh" vertical_order: 5 horizontal_order: 3 shape: ellipse }
<>61       node: { title: "System V" vertical_order: 5 horizontal_order: 5 }
<>62       node: { title: "v9sh" vertical_order: 6 }
<>63       node: { title: "tcsh" vertical_order: 6 shape: triangle }
<>64       node: { title: "ksh-i" vertical_order: 7 shape: ellipse }
<>65       node: { title: "KornShell" vertical_order: 8 shape: ellipse }
<>66       node: { title: "Perl" vertical_order: 8 }
<>67       node: { title: "rc" vertical_order: 8 }
<>68       node: { title: "tcl" vertical_order: 9 shape: rhomb }
<>69       node: { title: "Bash" vertical_order: 9 }
<>70       node: { title: "POSIX" vertical_order: 10 horizontal_order: 3 }
<>71       node: { title: "ksh-POSIX" vertical_order: 10 horizontal_order: 2 shape: ellipse }
<>72       
<>73       edge: { sourcename: "Thompson" targetname: "Mashey" }
<>74       edge: { sourcename: "Thompson" targetname: "Bourne" }
<>75       edge: { sourcename: "Thompson" targetname: "csh" horizontal_order: 4 }
<>76       edge: { sourcename: "Bourne" targetname: "ksh" }
<>77       edge: { sourcename: "Bourne" targetname: "esh" }
<>78       edge: { sourcename: "Bourne" targetname: "vsh" }
<>79       edge: { sourcename: "Bourne" targetname: "System-V" }
<>80       edge: { sourcename: "Bourne" targetname: "v9sh" }
<>81       edge: { sourcename: "Bourne" targetname: "Formshell" }
<>82       edge: { sourcename: "Bourne" targetname: "Bash" }
<>83       edge: { sourcename: "csh" targetname: "tcsh" }
<>84       edge: { sourcename: "csh" targetname: "ksh" }
<>85       edge: { sourcename: "Formshell" targetname: "ksh" horizontal_order: 4 }
<>86       edge: { sourcename: "esh" targetname: "ksh" }
<>87       edge: { sourcename: "vsh" targetname: "ksh" }
<>88       edge: { sourcename: "ksh" targetname: "ksh-i" }
<>89       edge: { sourcename: "System-V" targetname: "POSIX" }
<>90       edge: { sourcename: "v9sh" targetname: "rc" }
<>91       edge: { sourcename: "ksh-i" targetname: "KornShell" }
<>92       edge: { sourcename: "ksh-i" targetname: "Bash" }
<>93       edge: { sourcename: "KornShell" targetname: "Bash" }
<>94       edge: { sourcename: "KornShell" targetname: "POSIX" }
<>95       edge: { sourcename: "KornShell" targetname: "ksh-POSIX" }
<>96  }


next up previous contents index
Next: Graph Attributes Up: Examples of GDL Specifications Previous: Tree Layout
© AbsInt Angewandte Informatik GmbH