Output Formats


The output format is specified with the -Tlang flag on the command line, where lang is one of the following:
Command-line
parameter
Format
canon
dot
xdot
DOT
fig FIG
gd
gd2
GD/GD2 formats
gif GIF
hpgl HP-GL/2
imap
cmap
Server-side and client-side imagemaps
ismap Server-side imagemap (deprecated)
jpg
jpeg
JPEG
mif FrameMaker MIF format
mp MetaPost
pcl PCL
pic PIC
plain
plain-ext
Simple text format
png Portable Network Graphics format
ps PostScript
ps2 PostScript for PDF
svg
svgz
Scalable Vector Graphics
vrml VRML
vtx Visual Thought format
wbmp Wireless BitMap format

Format Descriptions

canon ,
dot ,
xdot
These formats produce output in the dot language. Using canon produces a prettyprinted version of the input, with no layout performed.

The dot 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 bb 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 lp attribute.

Each node gets pos, width and height attributes. If the node is a record, the record rectangles are given in the rects attribute. If the node is a polygon and the vertices attribute is defined, this attribute contains the vertices of the node.

Every edge is assigned a pos attribute, and if the edge has a label, the label position is given in lp.

The xdot format extends the dot 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.

At present, additional drawing attributes are only attached to nodes and edges. There are six new attributes:
_draw_Drawing operations
_ldraw_Label drawing
_hdraw_Head arrowheadEdge only
_tdraw_Tail arrowheadEdge only
_hldraw_Head labelEdge only
_tldraw_Tail labelEdge only

The value of these attributes consists of the concatenation of some (multi-)set of the following 7 rendering operations.
E x0 y0 w h Filled ellipse ((x-x0)/w)2 + ((y-y0)/h)2 = 1
e x0 y0 w h Unfilled ellipse ((x-x0)/w)2 + ((y-y0)/h)2 = 1
P n x1 y1 ... xn yn Filled polygon using the given n points
p n x1 y1 ... xn yn Unfilled polygon using the given n points
L n x1 y1 ... xn yn Polyline using the given n points
B n x1 y1 ... xn yn B-spline using the given n control points
T x y j w n -c1c2...cn 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.
In handling alignment, the application may want to recompute the string width using its own rendering primitives.

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 decorate attribute is set on an edge, its label attribute will also contain a polyline operation.

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.

fig
Outputs graphs in the FIG graphics language.
gd ,
gd2
Output images in the GD and GD2 format. These are the internal formats used by the gd library. The latter is compressed.
gif
Outputs GIF bitmap images.
hpgl
Produces output in the HP-GL/2 vector graphic printer language.
imap ,
cmap
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
  /* 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"];
  }
  
one would process the graph twice:
  dot -Timap x.dot > x.map
  dot -Tgif x.dot > x.gif
  
and then refer to it in a web page: <A HREF="x.map"> <IMG SRC="x.gif" ISMAP> </A> For client-side maps, one again processes the graph twice:
  dot -Tcmap x.dot > x.map
  dot -Tgif x.dot > x.gif
  
and uses the HTML <IMG SRC="x.gif" USEMAP=#mainmap> <MAP NAME="mainmap"> ... [content of x.map] ... </MAP> URLs 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 label, that will link to the URL. As for the head of the edge, this is linked to the headURL, if set. Otherwise, it is linked to the edge's URL if that is defined. The analogous description holds for the tail and the tailURL. A URL associated with the graph is used as a default link.

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 headlabel, if defined. The analogous result holds for the tailURL and the taillabel.

ismap
Produces HTML image map files. This is a predecessor (circa 1994) of the IMAP format. Most servers now use the latter. URLs can be attached to the root graph, nodes and edges. Since edge links are attached to edge labels, an edge must have a label 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.
jpg ,
jpeg
Output JPEG compressed image files. This format relies on the installation having the JPEG library.
mif
Generates Frame Maker MIF files.
mp
Produces MetaPost output.
pcl
Produces output in the PCL printer language. HP-GL 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.
pic
Outputs in PIC, the picture description language in the troff-family
plain ,
plain-ext
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.

There are four types of statements.

   graph scale width height
   node name x y width height label style shape color fillcolor
   edge tail head n x1 y1 .. xn yn [label xl yl] style color
   stop
  
graph
The width and height values give the width and height of the drawing. The lower left corner of the drawing is at the origin. The scale value indicates how the drawing should be scaled if a size 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.
node
The name value is the name of the node, and x and y give the node's position. The width and height are the width and height of the node. The label, style, shape, color and fillcolor give the node's label, style, shape, color and fillcolor, respectively, using attribute default values where necessary. If the node does not have a style attribute, "solid" is used.
edge
The tail and head 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. n is the number of control points defining the B-spline forming the edge. This is followed by 2*n numbers giving the x and y coordinates of the control points in order from tail to head. If the edge has a label, this comes next followed by the x and y coordinates of the label's position. The edge description is completed by the edge's style and color. As with nodes, if a style is not defined, "solid" is used.
The output consists of one graph line, a sequence of node lines, one per node, a sequence of edge lines, one per edge, and a final stop line. All units are in inches, represented by a floating point number.
png
Produces output in the PNG (Portable Network Graphics) format. PNG relies on having libz and the PNG library.
ps
Produces PostScript output.
ps2
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 pdflatex. 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., acroread, 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.
svg ,
svgz
Produce SVG output, the latter in compressed format. SVG relies on having libz.
vrml
Outputs graphs in the VRML format. VRML relies on having the PNG library.
vtx
Generates graph diagrams in the format for Confluents's Visual Thought.
wbmp
Produces output in the Wireless BitMap (WBMP) format, optimized for mobile computing.