Universitaet Bremen
FB3->Group BKB

->Main->Tutorial->Basic Tasks->Layout
Home
uDraw(Graph)
Download
Service & Support
Legal



Layout

Tutorial Exercise 1.2: Starting the Graph Layout Algorithm

After successfully loading the graph "graph_example.udg" from the "samples/graphs" directory of the uDraw(Graph) distribution, the visualization appears in the graph area of the base window. This graph is probably larger than the base window, so you can only see a portion of the whole graph visualization. Use the two scrollbars of the base window to move the scrolling region to other areas of the graph. A more comfortable method to set the scrolling region in a large graph visualization is 2D-scrolling. This operation is available inside the graph area of a base window if you press and hold down the middle mouse button (if available) while moving the mouse. Try this with the current graph and you will see how the system scrolls in both directions simultaneously by following the movements of the mouse.

As you can see on the screen, all graph nodes are automatically placed on horizontal levels so all (directed) edges between two nodes are pointing downwards. This is called a hierarchical visualization of a directed graph. Other styles of graph layout are currently not supported by uDraw(Graph). Background information about graphs can be found in the concepts document.

Except for assigning nodes to levels, the graph layout algorithm is not used directly after loading a graph. This is done to display it as soon as possible. By looking at the graph visualization, you can see that the layout is not as good as it can be. For example, several edges cross each other, which makes the layout confusing and somehow unattractive. You can see the total number of edge crossings of the current graph layout by opening a statistic window with menu View/Graph Info.... Improving the graph layout can be done by reordering the nodes at each level so the number of edges is reduced. uDraw(Graph) offers an automatic graph layout algorithm for this task. Start this algorithm by using menu Layout/Improve All. After doing this, you will notice a significantly improved layout. You can read more about graph layout in the chapter about concepts.

In uDraw(Graph), a graph is drawn top-down by default, so edges are usually pointing downwards. You can choose one of the other three layout orientations (upward, to the left or to the right) with menu Layout/Orientation. For example, try to rotate the layout by selecting menu Layout/Orientation/Left to Right.

End of Exercise 1.2. Go back to the Section 1 Overview.