man(1) Manual page archive


     DAG(1)                                                     DAG(1)

     NAME
          dag - preprocessor for drawing directed graphs

     SYNOPSIS
          dag [ option ... ] [ file ... ]

     DESCRIPTION
          Dag is a pic(1) or PostScript preprocessor for laying out
          directed graphs.  It does well on acyclic graphs (dags) and
          other graphs that can be drawn hierarchically.  Graph state-
          ments are contained between .GD (node ranks increase down-
          ward) or .GR (rightward) and .GE.  Edges point in the direc-
          tion of increasing rank if possible; the other direction is
          favored for edges within rank.  A summary of statements fol-
          lows.

          edge from tail to head0 edge-items, to head1 edge-items, to
          head2 edge-items...; Create edges from the tail node to the
          head node(s).  Nodes are created if they do not already
          exist.  Edge-items (described below) and the noise words
          edge, from, to, and comma are optional.  Node names may be
          quoted to protect blanks or keywords.

          ordered tail head0 head1 head2...; Make edges with heads in
          given left-to-right order on the same rank.  May contain
          noise words and edge-items.

          path node0 node1 node2...; Make a path of edges.  May con-
          tain noise words and edge-items.

          backedge tail head0 head1 head2...; Same as edges with oppo-
          site node ranking preferred.

          backpath node0 node1 node2...; Make a path of backedges.

          draw nodes node-items; Set properties of subsequently cre-
          ated nodes.  Legal node-items:

               as shape      Known shapes are Box, Circle,
                             Doublecircle, Ellipse (default), Diamond,
                             Square, Plaintext.  Other shapes may be
                             specified within braces {} in the output
                             language (e.g.  pic) or defined; see
                             below.
               label "string"
                             Label with string instead of node name.
               pointsize points
               width inches
               heightinches
               color "string"

     DAG(1)                                                     DAG(1)

                             Hue-saturation-brightness triple; works
                             only with PostScript.

          draw nodelist node-items; Set properties of listed nodes.

          draw edges edge-items; Set properties of subsequently cre-
          ated edges.  Legal edge-items:

               dotted, dashed, solid, invis
               label "string"
               weight n      High-weight edges are kept short. Default
                             weight 1.
               color "string"
               pointsize points

          minimum rank nodelist; Listed nodes must be on the topmost
          rank (leftmost with .GR).
          maximum rank nodelist; Bottommost or rightmost rank.
          same rank nodelist;

          separate ranks inches how ; Set minimum separation between
               ranks.  The optional how is exactly or equally.
          separate nodes inches ;

          The options are

          -O        Place nodes `optimally'; practical for graphs of a
                    few dozen nodes.

          -Tps      Prepare output for PostScript rather than pic.
          -Tsimple  Output similar to that of graphdraw(9.1).
          -Tcip     Output readable by cip(9.1).

          -pwidthxheight,marginwidthxmarginheight
                    Set PostScript page dimensions; marginwidth and/or
                    marginheight may be omitted.

          -l        Disable automatic loading of the dag graphics
                    library.

          The introductory .GD or .GR line may carry optional parame-
          ters in the form .GD width height fill.  Width and height
          are maximum values in inches; fill causes the graph to be
          stretched to the full dimensions.

          Graphics code written in the output language (pic or
          PostScript) may be embedded between .PS and .PE.  Macros
          defined with three arguments-label, width, and height-may be
          used as shape names in node-items.

     EXAMPLES

     DAG(1)                                                     DAG(1)

          .GD 2 2
          a b c;
          path a x y;
          draw nodes as Box;
          a z label "hi" weight 1000;
          draw edges dashed;
          b x;
          same rank b x;
          .GE

     FILES
          default            TOOLS=/usr/lib
          Edge labels may overlap.