output.html   [plain text]


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML VERSION="2.0">
<HEAD>
<TITLE>Output Formats</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<A NAME="top"></A>
<H1 align=CENTER>Output Formats</H1>
<HR>
The output format is specified with the <STRONG>-T</STRONG><I>lang</I>
flag on the <A HREF=command.html>command line</A>, where <I>lang</I>
is one of the following: 
<TABLE ALIGN=CENTER>
<TR><TH>Command-line<BR>parameter</TH><TH>Format</TH></TR>
 <TR><TD ALIGN=CENTER><A NAME=a:canon HREF=#d:canon>canon</A>
<BR><A NAME=a:dot HREF=#d:dot>dot</A>
<BR><A NAME=a:xdot HREF=#d:xdot>xdot</A>
</TD><TD>DOT</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:fig HREF=#d:fig>fig</A>
</TD><TD>FIG</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:gd HREF=#d:gd>gd</A>
<BR><A NAME=a:gd2 HREF=#d:gd2>gd2</A>
</TD><TD>GD/GD2 formats</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:gif HREF=#d:gif>gif</A>
</TD><TD>GIF</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:hpgl HREF=#d:hpgl>hpgl</A>
</TD><TD>HP-GL/2</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:imap HREF=#d:imap>imap</A>
<BR><A NAME=a:cmap HREF=#d:cmap>cmap</A>
</TD><TD>Server-side and client-side imagemaps</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:ismap HREF=#d:ismap>ismap</A>
</TD><TD>Server-side imagemap (deprecated)</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:jpg HREF=#d:jpg>jpg</A>
<BR><A NAME=a:jpeg HREF=#d:jpeg>jpeg</A>
</TD><TD>JPEG</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:mif HREF=#d:mif>mif</A>
</TD><TD>FrameMaker MIF format</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:mp HREF=#d:mp>mp</A>
</TD><TD>MetaPost</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:pcl HREF=#d:pcl>pcl</A>
</TD><TD>PCL</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:pic HREF=#d:pic>pic</A>
</TD><TD>PIC</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:plain HREF=#d:plain>plain</A>
<BR><A NAME=a:plain-ext HREF=#d:plain-ext>plain-ext</A>
</TD><TD>Simple text format</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:png HREF=#d:png>png</A>
</TD><TD>Portable Network Graphics format</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:ps HREF=#d:ps>ps</A>
</TD><TD>PostScript</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:ps2 HREF=#d:ps2>ps2</A>
</TD><TD>PostScript for PDF</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:svg HREF=#d:svg>svg</A>
<BR><A NAME=a:svgz HREF=#d:svgz>svgz</A>
</TD><TD>Scalable Vector Graphics</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:vrml HREF=#d:vrml>vrml</A>
</TD><TD>VRML</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:vtx HREF=#d:vtx>vtx</A>
</TD><TD>Visual Thought format</TD> </TR>
 <TR><TD ALIGN=CENTER><A NAME=a:wbmp HREF=#d:wbmp>wbmp</A>
</TD><TD>Wireless BitMap format</TD> </TR>
</TABLE>
<HR>
<H2>Format Descriptions</H2>
<DL>
<DT><A NAME=d:canon HREF=#a:canon><STRONG>canon</STRONG></A>
,<DT><A NAME=d:dot HREF=#a:dot><STRONG>dot</STRONG></A>
,<DT><A NAME=d:xdot HREF=#a:xdot><STRONG>xdot</STRONG></A>
<DD>  These formats produce output in the 
  <A HREF=lang.html>dot language</A>.
  Using <B>canon</B> produces a prettyprinted version of the input, 
  with no layout performed.
  <P>
  The <B>dot</B> option corresponds to attributed dot output, 
  and is the default output format.
  It reproduces the input, along with layout information for the graph.
  In particular, a <A HREF=attrs.html#d:bb>bb</A> attribute is
  attached to the graph, specifying the bounding box of the drawing.
  If the graph has a label, its position is specified by the 
  <A HREF=attrs.html#d:lp>lp</A> attribute.
  <P>
  Each node gets <A HREF=attrs.html#d:pos>pos</A>,
  <A HREF=attrs.html#d:width>width</A> and 
  <A HREF=attrs.html#d:height>height</A> attributes. If the node is a record,
  the record rectangles are given in the 
  <A HREF=attrs.html#d:rects>rects</A> attribute.
  If the node is a polygon and the 
  <A HREF=attrs.html#d:vertices>vertices</A> attribute is defined, this
  attribute contains the vertices of the node. 
  <P>
  Every edge is
  assigned a <A HREF=attrs.html#d:pos>pos</A> attribute, 
  and if the edge has a label, the label position
  is given in <A HREF=attrs.html#d:lp>lp</A>.
  <P>
  The <B>xdot</B> format extends the
  <B>dot</B> format by providing much more detailed information about
  how graph components are drawn. It relies on additional attributes
  for nodes, edges and graphs. The format is preliminary; comments and
  suggestions for better representations are welcome.
  Not also that we will have to extend the descriptions in the near 
  future to handle richer record and text representations.
  <P>
  At present, additional drawing attributes are only attached to nodes
  and edges. There are six new attributes:
  <SPACER TYPE=VERTICAL size=10>
  <TABLE  border bgcolor=beige>
  <TR><TD>_draw_<TD colspan=2>Drawing operations
  <TR><TD>_ldraw_<TD colspan=2>Label drawing
  <TR><TD>_hdraw_<TD>Head arrowhead<TD>Edge only
  <TR><TD>_tdraw_<TD>Tail arrowhead<TD>Edge only
  <TR><TD>_hldraw_<TD>Head label<TD>Edge only
  <TR><TD>_tldraw_<TD>Tail label<TD>Edge only
  </TABLE>
  <P>
  The value of these attributes consists of the concatenation of some
  (multi-)set of the following 7 rendering operations.
  <SPACER TYPE=VERTICAL size=10>
  <TABLE border bgcolor=beige>
  <TR><TD>E x<sub>0</sub> y<sub>0</sub> w h
    <TD>Filled ellipse ((x-x<sub>0</sub>)/w)<sup>2</sup> + ((y-y<sub>0</sub>)/h)<sup>2</sup> = 1
  <TR><TD>e x<sub>0</sub> y<sub>0</sub> w h
    <TD>Unfilled ellipse ((x-x<sub>0</sub>)/w)<sup>2</sup> + ((y-y<sub>0</sub>)/h)<sup>2</sup> = 1
  <TR><TD>P n x<sub>1</sub> y<sub>1</sub> ... x<sub>n</sub> y<sub>n</sub>
    <TD>Filled polygon using the given n points
  <TR><TD>p n x<sub>1</sub> y<sub>1</sub> ... x<sub>n</sub> y<sub>n</sub>
    <TD>Unfilled polygon using the given n points
  <TR><TD>L n x<sub>1</sub> y<sub>1</sub> ... x<sub>n</sub> y<sub>n</sub>
    <TD>Polyline using the given n points
  <TR><TD>B n x<sub>1</sub> y<sub>1</sub> ... x<sub>n</sub> y<sub>n</sub>
    <TD>B-spline using the given n control points
  <TR><TD>T x y j w n -<I>c<sub>1</sub>c<sub>2</sub>...c<sub>n</sub><I>
    <TD>Text drawn using the baseline point (x,y). The text consists of the
    n characters following '-'. The text should be left-aligned (centered,
    right-aligned) on the point if j is -1 (0, 1), respectively. The value
    w gives the width of the text as computed by the library.
  </TABLE>
  <SPACER TYPE=VERTICAL size=10>
  In handling alignment, the application may want to recompute the
  string width using its own rendering primitives.
  <P>
  The text operation is only used in the label attributes. Normally,
  the non-text operations are only used in the non-label attributes;
  if, however, the <A HREF=attrs.html#d:decorate>decorate</A>
  attribute is set on an edge, its label
  attribute will also contain a polyline operation.
  <P>
  All coordinates and sizes are in points. Additional information
  such a line style, fill color, font name or size must be gleaned from
  the corresponding attributes of the component. Note though that if
  an edge or node is invisible, no drawing operations are attached to it.

<DT><A NAME=d:fig HREF=#a:fig><STRONG>fig</STRONG></A>
<DD>   Outputs graphs in the FIG graphics language.

<DT><A NAME=d:gd HREF=#a:gd><STRONG>gd</STRONG></A>
,<DT><A NAME=d:gd2 HREF=#a:gd2><STRONG>gd2</STRONG></A>
<DD>  Output images in the GD and GD2 format. These are the internal
  formats used by the gd library. The latter is compressed.

<DT><A NAME=d:gif HREF=#a:gif><STRONG>gif</STRONG></A>
<DD>  Outputs GIF bitmap images.

<DT><A NAME=d:hpgl HREF=#a:hpgl><STRONG>hpgl</STRONG></A>
<DD>  Produces output in the HP-GL/2 vector graphic printer language.

<DT><A NAME=d:imap HREF=#a:imap><STRONG>imap</STRONG></A>
,<DT><A NAME=d:cmap HREF=#a:cmap><STRONG>cmap</STRONG></A>
<DD>  Produces map files for server-side and client-side image maps,
  These can be used in a web page with
  a graphical form of the output, e.g. in JPEG or GIF format, to attach
  links to nodes and edges. For example, to create a server-side map
  given the dot file
  <PRE>
  /* x.dot */
  digraph G {
    URL="http://www.research.att.com/base.html";
    command [URL="http://www.research.att.com/command.html"];
    command -> output [URL="colors.html"];
  }
  </PRE>
  one would process the graph twice:
  <PRE>
  dot -Timap x.dot > x.map
  dot -Tgif x.dot > x.gif
  </PRE>
  and then refer to it in a web page:
  <XMP>
  <A HREF="x.map">
  <IMG SRC="x.gif" ISMAP>
  </A>
  </XMP>
  For client-side maps, one again processes the graph twice:
  <PRE>
  dot -Tcmap x.dot > x.map
  dot -Tgif x.dot > x.gif
  </PRE>
  and uses the HTML
  <XMP>
  <IMG SRC="x.gif" USEMAP=#mainmap>
  <MAP NAME="mainmap">
    ... [content of x.map] ...
  </MAP>
  </XMP>
  <A HREF=attrs.html#d:URL>URLs</A> can be attached to the root 
  graph, nodes and edges. If a node has a URL, clicking in the node
  will activate the link.
  If an edge has a URL, various
  points along the edge (but not necessarily the head or tail) 
  will link to it. In addition, if the edge has a 
  <A HREF=attrs.html#d:label>label</A>, that will link
  to the URL.
  As for the head of the edge, this is linked to the 
  <A HREF=attrs.html#d:headURL>headURL</A>, if set.
  Otherwise, it is linked to the edge's URL if that is defined. 
  The analogous description holds for the tail and the
  <A HREF=attrs.html#d:tailURL>tailURL</A>.
  A URL associated with the graph is used as a default link.
  <P>
  If the URL
  of a node contains the escape sequence "\N", it will be replaced by 
  the node's name. 
  If the headURL is defined and contains the escape sequence "\N", 
  it will be replaced by
  the <A HREF=attrs.html#d:headlabel>headlabel</A>, if defined.
  The analogous result holds for the tailURL and the
  <A HREF=attrs.html#d:taillabel>taillabel</A>.

<DT><A NAME=d:ismap HREF=#a:ismap><STRONG>ismap</STRONG></A>
<DD>  Produces HTML image map files. This is a predecessor (circa 1994)
  of the IMAP format.  Most servers now use the latter.
  <A HREF=attrs.html#d:URL>URLs</A> can be attached to the root graph, 
  nodes and edges. Since edge
  links are attached to edge labels, an edge must 
  have a <A HREF=attrs.html#d:label>label</A> for its
  URL to be used. For both nodes and edges, if the URL has the escape
  sequence "\N" embedded in its string, this will be replaced with the
  node or edge name.

<DT><A NAME=d:jpg HREF=#a:jpg><STRONG>jpg</STRONG></A>
,<DT><A NAME=d:jpeg HREF=#a:jpeg><STRONG>jpeg</STRONG></A>
<DD>  Output JPEG compressed image files.
  This format relies on the installation having the JPEG library.

<DT><A NAME=d:mif HREF=#a:mif><STRONG>mif</STRONG></A>
<DD>  Generates Frame Maker MIF files.

<DT><A NAME=d:mp HREF=#a:mp><STRONG>mp</STRONG></A>
<DD>  Produces <A HREF="http://cm.bell-labs.com/who/hobby/MetaPost.html">MetaPost</A> output.

<DT><A NAME=d:pcl HREF=#a:pcl><STRONG>pcl</STRONG></A>
<DD>  Produces output in the PCL printer language. 
  <A HREF=#d:hpgl>HP-GL</A> is a subset of
  PCL, so that PCL output is the same as HP-GL, wrapped with some initial
  and final commands to set the printer to and from HP-GL mode.

<DT><A NAME=d:pic HREF=#a:pic><STRONG>pic</STRONG></A>
<DD>  Outputs in PIC, the picture description language in the troff-family

<DT><A NAME=d:plain HREF=#a:plain><STRONG>plain</STRONG></A>
,<DT><A NAME=d:plain-ext HREF=#a:plain-ext><STRONG>plain-ext</STRONG></A>
<DD>  The plain and plain-ext formats produce output using
  a simple, line-based language.
  The latter format differs in that, on edges, it provides port names 
  on head and tail nodes when applicable.
  <P>
  There are four types of statements.
  <PRE>
   <STRONG>graph</STRONG> <I>scale</I> <I>width</I> <I>height</I>
   <STRONG>node</STRONG> <I>name</I> <I>x</I> <I>y</I> <I>width</I> <I>height</I> <I>label</I> <I>style</I> <I>shape</I> <I>color</I> <I>fillcolor</I>
   <STRONG>edge</STRONG> <I>tail</I> <I>head</I> <I>n</I> <I>x<sub>1</sub></I> <I>y<sub>1</sub></I> .. <I>x<sub>n</sub></I> <I>y<sub>n</sub></I> [<I>label</I> <I>xl</I> <I>yl</I>] <I>style</I> <I>color</I>
   <STRONG>stop</STRONG>
  </PRE>
  <DL>
  <DT><STRONG>graph</STRONG>
  <DD>The <I>width</I> and <I>height</I> values give the width and height
  of the drawing. The lower left corner of the drawing is at the origin.
  The <I>scale</I> value indicates how the drawing should be scaled
  if a <A HREF=attrs.html#d:size>size</A> attribute was given and the drawing
  needs to be scaled to conform to that size. If no scaling is necessary,
  it will be set to 1.0. Note that all graph, node and edge 
  coordinates and lengths are given unscaled.
  <DT><STRONG>node</STRONG>
  <DD>The <I>name</I> value is the name of the node, and <I>x</I> and <I>y</I>
  give the node's position. The <I>width</I> and <I>height</I> are the
  width and height of the node.
  The <I>label</I>, 
  <I>style</I>, <I>shape</I>, <I>color</I> and <I>fillcolor</I> give the
  node's <A HREF=attrs.html#d:label>label</A>, 
  <A HREF=attrs.html#d:style>style</A>, <A HREF=attrs.html#d:shape>shape</A>, 
  <A HREF=attrs.html#d:color>color</A> and 
  <A HREF=attrs.html#d:fillcolor>fillcolor</A>,
  respectively, using attribute default values where necessary. If the
  node does not have a style attribute, "solid" is used.
  <DT><STRONG>edge</STRONG>
  <DD>The <I>tail</I> and <I>head</I> values give the names of the head and
  tail nodes. In plain-ext format, the head or tail name will be appended
  with a colon and a portname if the edge connects to the node at a port.
  <I>n</I> is the number of control points defining the
  B-spline forming the edge. This is followed by 2*<I>n</I> numbers giving
  the x and y coordinates of the control points in order from tail to head.
  If the edge has a <A HREF=attrs.html#d:label>label</A>, this comes next
  followed by the x and y coordinates of the label's position.
  The edge description is completed by the edge's 
  <A HREF=attrs.html#d:style>style</A> and <A HREF=attrs.html#d:color>color</A>.
  As with nodes, if a style is not defined, "solid" is used.
  </DL>
  The output consists of one <STRONG>graph</STRONG> line, a sequence of
  <STRONG>node</STRONG> lines, one per node, a sequence of 
  <STRONG>edge</STRONG> lines, one per edge, and a final <STRONG>stop</STRONG>
  line. All units are in inches, represented by a floating point number.

<DT><A NAME=d:png HREF=#a:png><STRONG>png</STRONG></A>
<DD>   Produces output in the PNG (Portable Network Graphics) format.
   PNG relies on having libz and the PNG library.

<DT><A NAME=d:ps HREF=#a:ps><STRONG>ps</STRONG></A>
<DD>  Produces PostScript output.

<DT><A NAME=d:ps2 HREF=#a:ps2><STRONG>ps2</STRONG></A>
<DD>  Produces PostScript output with PDF notations. It is assumed the output
  will be directly converted into PDF format. The notations include PDF
  bounding box information, so that the resulting PDF file can be correctly
  used with pdf tools, such as <STRONG>pdflatex</STRONG>. 
  In addition, if a node has a URL
  attribute, this gets translated into PDF code such that the node, 
  when viewed in a PDF-viewer, e.g.,
  <STRONG>acroread</STRONG>,
  is a link to the given URL. If a URL is attached to the graph, this serves
  as a base, such that relative URLs on nodes are derived from it.

<DT><A NAME=d:svg HREF=#a:svg><STRONG>svg</STRONG></A>
,<DT><A NAME=d:svgz HREF=#a:svgz><STRONG>svgz</STRONG></A>
<DD>  Produce <A HREF="http://www.adobe.com/svg/">SVG</A> output, 
  the latter in compressed format.
  SVG relies on having libz.

<DT><A NAME=d:vrml HREF=#a:vrml><STRONG>vrml</STRONG></A>
<DD>  Outputs graphs in the <A HREF="http://www.vrml.org/">VRML</A> format.
  VRML relies on having the PNG library.

<DT><A NAME=d:vtx HREF=#a:vtx><STRONG>vtx</STRONG></A>
<DD>   Generates graph diagrams in the format for 
   <A HREF="http://www.bombshellstudios.com/samples/co/vt.html">Confluents's Visual Thought</A>.

<DT><A NAME=d:wbmp HREF=#a:wbmp><STRONG>wbmp</STRONG></A>
<DD>  Produces output in the Wireless BitMap (WBMP) format, optimized for
  mobile computing.

</DL>
<HR>
</BODY>
</HTML>