The NETDRAW Procedure

Controlling the Layout

As explained in the section Layout of the Network, the procedure uses the precedence constraints between the activities to draw a reasonable diagram of the network. A very desirable feature in any procedure of this nature is the ability to change the default layout. PROC NETDRAW provides two ways of modifying the network diagram:

  • using the full-screen interface

  • using the Network data set

The full-screen method is useful for manipulating the layout of small networks, especially networks that fit on a handful of screens. You can use the full-screen mode to examine the default layout of the network and move the nodes to desired locations using the MOVE command from the command line or by using the appropriate function key. When a node is moved, the procedure reroutes all the arcs that connect to or from the node; other arcs are unchanged. For details about the MOVE command, see the section Full-Screen Version.

You can use the Network data set to modify or specify completely the layout of the network. This method is useful if you want to draw the network using information about the network layout that has been saved from an earlier invocation of the procedure. Sometimes you may want to specify only the positions of the node and let the procedure determine the routing of the arcs. The procedure looks for three default variables in the data set: _X_, _Y_, and _SEQ_ . The _X_ and _Y_ variables are assumed to denote the x and y coordinates of the nodes and all the turning points of the arcs connecting the nodes. The variable _SEQ_ is assumed to denote the order of the turning points. This interpretation is consistent with the values assigned to the _X_, _Y_, and _SEQ_ variables in the Layout data set produced by PROC NETDRAW. If there is no variable called _SEQ_ in the data set, the procedure assumes that only the node positions are specified and uses the specified coordinates to place the nodes and determines the routing of the arcs corresponding to these positions. If there is a variable called _SEQ_, the procedure requires that the turning points for each arc be specified in the proper order, with the variable _SEQ_ containing numbers sequentially starting with 1 and continuing onward. The procedure then draws the arcs exactly as specified, without checking for consistency or interpolating or extrapolating turning points that may be missing.

The ALIGN= variable provides another means of controlling the node layout (see the section Time-Scaled Network Diagrams). This variable can be used to specify the x coordinates for the different nodes of the network; the procedure then determines the y coordinates. Note that time-scaled network diagrams (without an ALIGN= specification) are equivalent to network diagrams drawn with the ALIGN= variable being set to the E_START variable.

You can also control the placement of the nodes using the ZONE=option (see the section Zoned Network Diagrams). The procedure uses the values of the ZONE variable to divide the network into horizontal zones. Thus, you can control the horizontal placement of the nodes using the ALIGN= option and the vertical placement of the nodes using the ZONE= option.

For networks that have a tree structure, the TREE option draws the network as a tree, thus providing another layout option (see the section Organizational Charts or Tree Diagrams). The procedure draws the tree from left to right, with the root at the left edge of the diagram. Thus, the children of each node are drawn to the right of the node. In the graphics mode of invocation, you can use the ROTATETEXT option in conjunction with the ROTATE option in the ACTNET statement (or the global graphics option ROTATE) to obtain a top-down tree diagram.