Daniel@0: Daniel@0: Daniel@0: Daniel@0:
Daniel@0:Daniel@0: The formats actually available in a given Graphviz system depend on Daniel@0: how the system was built and the presence of additional libraries. Daniel@0: To see what formats dot supports, run dot -T?. Daniel@0: See the description of the -T Daniel@0: flag for additional information. Daniel@0:
Daniel@0: Note that the internal coordinate system has the origin Daniel@0: in the lower left corner. Daniel@0: Thus, positions in the Daniel@0: canon, Daniel@0: dot, Daniel@0: xdot, Daniel@0: plain, and Daniel@0: plain-ext Daniel@0: formats need to be interpreted in this manner. Daniel@0:
Daniel@0:
Command-line parameter | Format |
---|---|
bmp Daniel@0: | Windows Bitmap Format |
canon
Daniel@0: dot Daniel@0: xdot Daniel@0: | DOT |
cmap Daniel@0: | Client-side imagemap (deprecated) |
dia Daniel@0: | Dia format |
eps Daniel@0: | Encapsulated PostScript |
fig Daniel@0: | FIG |
gd
Daniel@0: gd2 Daniel@0: | GD/GD2 formats |
gif Daniel@0: | GIF |
gtk Daniel@0: | GTK canvas |
hpgl Daniel@0: | HP-GL/2 |
ico Daniel@0: | Icon Image File Format |
imap
Daniel@0: cmapx Daniel@0: | Server-side and client-side imagemaps |
imap_np
Daniel@0: cmapx_np Daniel@0: | Server-side and client-side imagemaps |
ismap Daniel@0: | Server-side imagemap (deprecated) |
jpg
Daniel@0: jpeg Daniel@0: jpe Daniel@0: | JPEG |
mif Daniel@0: | FrameMaker MIF format |
mp Daniel@0: | MetaPost |
pcl Daniel@0: | PCL |
pdf Daniel@0: | Portable Document Format (PDF) |
pic Daniel@0: | PIC |
plain
Daniel@0: plain-ext Daniel@0: | Simple text format |
png Daniel@0: | Portable Network Graphics format |
ps Daniel@0: | PostScript |
ps2 Daniel@0: | PostScript for PDF |
svg
Daniel@0: svgz Daniel@0: | Scalable Vector Graphics |
tga Daniel@0: | Truevision Targa Format (TGA) |
tif
Daniel@0: tiff Daniel@0: | TIFF (Tag Image File Format) |
vml
Daniel@0: vmlz Daniel@0: | Vector Markup Language (VML) |
vrml Daniel@0: | VRML |
vtx Daniel@0: | Visual Thought format |
wbmp Daniel@0: | Wireless BitMap format |
xlib Daniel@0: | Xlib canvas |
Daniel@0: The dot option corresponds to attributed dot output, Daniel@0: and is the default output format. Daniel@0: It reproduces the input, along with layout information for the graph. Daniel@0: In particular, a bb attribute is Daniel@0: attached to the graph, specifying the bounding box of the drawing. Daniel@0: If the graph has a label, its position is specified by the Daniel@0: lp attribute. Daniel@0:
Daniel@0: Each node gets pos, Daniel@0: width and Daniel@0: height attributes. If the node is a record, Daniel@0: the record rectangles are given in the Daniel@0: rects attribute. Daniel@0: If the node is a polygon and the Daniel@0: vertices attribute is defined, this Daniel@0: attribute contains the vertices of the node. Daniel@0:
Daniel@0: Every edge is Daniel@0: assigned a pos attribute, Daniel@0: and if the edge has a label, the label position Daniel@0: is given in lp. Daniel@0:
Daniel@0: The xdot format extends the Daniel@0: dot format by providing much more detailed information about Daniel@0: how graph components are drawn. It relies on additional attributes Daniel@0: for nodes, edges and graphs. Daniel@0:
Daniel@0: The format is preliminary; comments and Daniel@0: suggestions for better representations are welcome. Daniel@0: To allow for changes in the format, Graphviz attaches the attribute Daniel@0: xdotversion to the graph. Daniel@0:
Daniel@0: Additional drawing attributes can appear on nodes, edges, clusters and
Daniel@0: on the graph itself. There are six new attributes:
Daniel@0:
Daniel@0: For a given graph object, one will typically a draw directive before the
Daniel@0: label directive. For example, for a node, one would first use the commands
Daniel@0: in _draw_ followed by the commands in _ldraw_.
Daniel@0:
Daniel@0: The value of these attributes consists of the concatenation of some
Daniel@0: (multi-)set of the following 13 rendering or attribute operations.
Daniel@0: (The number is parentheses gives the xdot version when the operation
Daniel@0: was added to the format. If no version number is given, the operation
Daniel@0: was in the original specification.)
Daniel@0:
Daniel@0: Note that the filled figures (ellipses, polygons and B-Splines)
Daniel@0: imply two operations: first, drawing the filled figure with the
Daniel@0: current fill color; second, drawing an unfilled figure with the
Daniel@0: current pen color, pen width and pen style.
Daniel@0: the
Daniel@0:
Daniel@0: Style values which can be incorporated in the graphics model do not
Daniel@0: appear in xdot output. In particular, the style values
Daniel@0: filled, rounded, diagonals, and invis
Daniel@0: will not appear. Indeed, if style contains invis,
Daniel@0: there will not be any xdot output at all.
Daniel@0:
Daniel@0: In handling text alignment, the application may want to recompute the
Daniel@0: string width using its own rendering primitives.
Daniel@0:
Daniel@0: The text operation is only used in the label attributes. Normally,
Daniel@0: the non-text operations are only used in the non-label attributes.
Daniel@0: If, however, the decorate
Daniel@0: attribute is set on an edge, its label
Daniel@0: attribute will also contain a polyline operation.
Daniel@0: In addition, if a label is a complex, HTML-like label, it will also
Daniel@0: contain non-text operations.
Daniel@0:
Daniel@0: All coordinates and sizes are in points.
Daniel@0: Note though that if
Daniel@0: an edge or node is invisible, no drawing operations are attached to it.
Daniel@0:
Daniel@0: Version info:
Daniel@0:
Daniel@0: See Note.
Daniel@0:
Daniel@0:
Daniel@0: If the URL
Daniel@0: of a node contains the escape sequence "\N", it will be replaced by
Daniel@0: the node's name.
Daniel@0: If the headURL is defined and contains the escape sequence "\N",
Daniel@0: it will be replaced by
Daniel@0: the headlabel, if defined.
Daniel@0: The analogous result holds for the tailURL and the
Daniel@0: taillabel.
Daniel@0:
Daniel@0: See Note.
Daniel@0:
Daniel@0:
Daniel@0: Note: At present, this option does not support anchors, etc. To get these
Daniel@0: included in your PDF output, use ps2.
Daniel@0:
Daniel@0:
Daniel@0: There are four types of statements.
Daniel@0:
Daniel@0: Note: The control points given in an edge statement define the
Daniel@0: body of the edge. In particular, if the edge has an arrowhead to the
Daniel@0: head or tail node,
Daniel@0: there will be a gap between the last or first control points and the
Daniel@0: boundary of the associated node. There are at least 3 possible ways
Daniel@0: of handling this gap:
Daniel@0:
Daniel@0: Note that the plain formats provide minimal information, really giving not
Daniel@0: much more than node positions and sizes, and edge spline control points.
Daniel@0: These formats are usually most useful to applications wanting just this
Daniel@0: geometric information, and willing to fill in all of the graphical details.
Daniel@0: The only real advantages to these formats is their terseness and their
Daniel@0: ease of parsing. In general, the dot and
Daniel@0: xdot are preferable in terms of the quantity of
Daniel@0: information provided.
Daniel@0:
Daniel@0:
Daniel@0: Note: The default PostScript renderer can only handle the Latin-1
Daniel@0: character set. To get non-Latin-1 characters into PostScript output,
Daniel@0: use -Tps:cairo, assuming your version was built with the
Daniel@0: Cairo renderer.
Daniel@0:
Daniel@0:
Daniel@0: See Note.
Daniel@0:
Daniel@0:
Daniel@0: See Note.
Daniel@0:
Daniel@0:
Daniel@0: Line segments are drawn as cylinders.
Daniel@0: In general, VRML output relies on having the PNG library to produce images
Daniel@0: used to texture-fill the node shapes. However, if
Daniel@0: shape=point,
Daniel@0: a node is drawn as a 3D sphere.
Daniel@0:
Daniel@0:
Daniel@0:
Daniel@0: _draw_ Drawing operations
Daniel@0: _ldraw_ Label drawing
Daniel@0: _hdraw_ Head arrowhead Edge only
Daniel@0: _tdraw_ Tail arrowhead Edge only
Daniel@0: _hldraw_ Head label Edge only
Daniel@0: _tldraw_ Tail label Edge only
Daniel@0:
Daniel@0:
Daniel@0: E x0 y0 w h
Daniel@0: Filled ellipse ((x-x0)/w)2 + ((y-y0)/h)2 = 1
Daniel@0: e x0 y0 w h
Daniel@0: Unfilled ellipse ((x-x0)/w)2 + ((y-y0)/h)2 = 1
Daniel@0: P n x1 y1 ... xn yn
Daniel@0: Filled polygon using the given n points
Daniel@0: p n x1 y1 ... xn yn
Daniel@0: Unfilled polygon using the given n points
Daniel@0: L n x1 y1 ... xn yn
Daniel@0: Polyline using the given n points
Daniel@0: B n x1 y1 ... xn yn
Daniel@0: B-spline using the given n control points
Daniel@0: b n x1 y1 ... xn yn
Daniel@0: Filled B-spline using the given n control points (1.1)
Daniel@0: T x y j w n -b1b2...bn
Daniel@0: Text drawn using the baseline point (x,y). The text consists of the
Daniel@0: n bytes following '-'. The text should be left-aligned (centered,
Daniel@0: right-aligned) on the point if j is -1 (0, 1), respectively. The value
Daniel@0: w gives the width of the text as computed by the library.
Daniel@0: C n -b1b2...bn
Daniel@0: Set fill color. The color value consists of the
Daniel@0: n bytes following '-'. (1.1)
Daniel@0: c n -b1b2...bn
Daniel@0: Set pen color. The color value consists of the
Daniel@0: n bytes following '-'. (1.1)
Daniel@0: F s n -b1b2...bn
Daniel@0: Set font. The font size is s points. The font name consists of the
Daniel@0: n bytes following '-'. (1.1)
Daniel@0: S n -b1b2...bn
Daniel@0: Set style attribute. The style value consists of the
Daniel@0: n bytes following '-'. The syntax of the value is the same as
Daniel@0: specified for a styleItem in style. (1.1)
Daniel@0: I x y w h n -b1b2...bn
Daniel@0: Externally-specified image drawn in the box with lower left
Daniel@0: corner (x,y) and upper right corner (x+w,y+h). The name of the image
Daniel@0: consists of the n bytes following '-'. This is usually a bitmap
Daniel@0: image. Note that the image size, even when converted from pixels to
Daniel@0: points, might be different from the required size (w,h). It is
Daniel@0: assumed the renderer will perform the necessary scaling. (1.2)
Daniel@0:
Daniel@0:
Daniel@0:
Daniel@0:
Daniel@0: Xdot version Graphviz version
Daniel@0: 1.0 1.9
Daniel@0: 1.1 2.8
Daniel@0: 1.2 2.13
Daniel@0: /* x.dot */
Daniel@0: digraph mainmap {
Daniel@0: URL="http://www.research.att.com/base.html";
Daniel@0: command [URL="http://www.research.att.com/command.html"];
Daniel@0: command -> output [URL="colors.html"];
Daniel@0: }
Daniel@0:
Daniel@0: one would process the graph and generate two output files:
Daniel@0:
Daniel@0: dot -Timap -ox.map -Tgif -ox.gif x.dot
Daniel@0:
Daniel@0: and then refer to it in a web page:
Daniel@0:
Daniel@0:
Daniel@0: dot -Tcmapx -ox.map -Tgif -ox.gif x.dot
Daniel@0:
Daniel@0: and uses the HTML
Daniel@0:
Daniel@0: ... [content of x.map] ...
Daniel@0:
Daniel@0: graph scale width height
Daniel@0: node name x y width height label style shape color fillcolor
Daniel@0: edge tail head n x1 y1 .. xn yn [label xl yl] style color
Daniel@0: stop
Daniel@0:
Daniel@0:
Daniel@0:
Daniel@0: The output consists of one graph line, a sequence of
Daniel@0: node lines, one per node, a sequence of
Daniel@0: edge lines, one per edge, and a final stop
Daniel@0: line. All units are in inches, represented by a floating point number.
Daniel@0:
Daniel@0:
Daniel@0:
Daniel@0: The graph below shows what image formats can be used in which output formats,
Daniel@0: and the required plugins. On the left are the supported image formats.
Daniel@0: On the right are the supported output formats.
Daniel@0: In the middle are the plugins: image loaders, renderers, drivers, arranged by
Daniel@0: plugin library.
Daniel@0: This presents the most general case. A given installation may not provide
Daniel@0: one of the plugins, in which case, that transformation is not possible.
Daniel@0:
Daniel@0:
Daniel@0: