`
yidongkaifa
  • 浏览: 4050484 次
文章分类
社区版块
存档分类
最新评论

Output Formats

 
阅读更多
The output format is specified with the-Tlangflag on thecommand line, wherelangis one of the parameters listed below.

The formats actually available in a given Graphviz system depend on how the system was built and the presence of additional libraries. To see what formatsdotsupports, rundot -T?. See thedescription of the -Tflag for additional information.

Note that the internal coordinate system has the origin in the lower left corner. Thus, positions in thecanon,dot,xdot,plain, andplain-extformats need to be interpreted in this manner.

Command-line
parameter Format
bmp Windows Bitmap Format
canon
dot
xdot
DOT
cmap Client-side imagemap (deprecated)
eps Encapsulated PostScript
fig FIG
gd
gd2
GD/GD2 formats
gif GIF
gtk GTK canvas
ico Icon Image File Format
imap
cmapx
Server-side and client-side imagemaps
imap_np
cmapx_np
Server-side and client-side imagemaps
ismap Server-side imagemap (deprecated)
jpg
jpeg
jpe
JPEG
pdf Portable Document Format (PDF)
plain
plain-ext
Simple text format
png Portable Network Graphics format
ps PostScript
ps2 PostScript for PDF
svg
svgz
Scalable Vector Graphics
tif
tiff
TIFF (Tag Image File Format)
vml
vmlz
Vector Markup Language (VML)
vrml VRML
wbmp Wireless BitMap format
webp Image format for the Web
xlib Xlib canvas

Format Descriptions

bmp
Outputs images in the WindowsBMPformat.
canon,
dot,
xdot
These formats produce output in thedot language. Usingcanonproduces a prettyprinted version of the input, with no layout performed.

Thedotoption corresponds to attributed dot output, and is the default output format. It reproduces the input, along with layout information for the graph. In particular, abbattribute is attached to the graph, specifying the bounding box of the drawing. If the graph has a label, its position is specified by thelpattribute.

Each node getspos,widthandheightattributes. If the node is a record, the record rectangles are given in therectsattribute. If the node is a polygon and theverticesattribute is defined, this attribute contains the vertices of the node.

Every edge is assigned aposattribute, and if the edge has a label, the label position is given inlp.

Thexdotformat extends thedotformat 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. To allow for changes in the format, Graphviz attaches the attributexdotversionto the graph.

Additional drawing attributes can appear on nodes, edges, clusters and on the graph itself. There are six new attributes:

_draw_ Drawing operations
_ldraw_ Label drawing
_hdraw_ Head arrowhead Edge only
_tdraw_ Tail arrowhead Edge only
_hldraw_ Head label Edge only
_tldraw_ Tail label Edge only

For a given graph object, one will typically a draw directive before the label directive. For example, for a node, one would first use the commands in_draw_followed by the commands in_ldraw_.

The value of these attributes consists of the concatenation of some (multi-)set of the following 13 rendering or attribute operations. (The number is parentheses gives the xdot version when the operation was added to the format. If no version number is given, the operation was in the original specification.)

E x0y0w h Filled ellipse ((x-x0)/w)2+ ((y-y0)/h)2= 1
e x0y0w h Unfilled ellipse ((x-x0)/w)2+ ((y-y0)/h)2= 1
P n x1y1... xnyn Filled polygon using the given n points
p n x1y1... xnyn Unfilled polygon using the given n points
L n x1y1... xnyn Polyline using the given n points
B n x1y1... xnyn B-spline using the given n control points
b n x1y1... xnyn Filled B-spline using the given n control points (1.1)
T x y j w n -b1b2...bn Text drawn using the baseline point (x,y). The text consists of the n bytes 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.
C n -b1b2...bn Set fill color. The color value consists of the n bytes following '-'. (1.1)
c n -b1b2...bn Set pen color. The color value consists of the n bytes following '-'. (1.1)
F s n -b1b2...bn Set font. The font size is s points. The font name consists of the n bytes following '-'. (1.1)
S n -b1b2...bn Set style attribute. The style value consists of the n bytes following '-'. The syntax of the value is the same as specified for astyleIteminstyle. (1.1)
I x y w h n -b1b2...bn Externally-specified image drawn in the box with lower left corner (x,y) and upper right corner (x+w,y+h). The name of the image consists of the n bytes following '-'. This is usually a bitmap image. Note that the image size, even when converted from pixels to points, might be different from the required size (w,h). It is assumed the renderer will perform the necessary scaling. (1.2)

Note that the filled figures (ellipses, polygons and B-Splines) imply two operations: first, drawing the filled figure with the current fill color; second, drawing an unfilled figure with the current pen color, pen width and pen style.

Style values which can be incorporated in the graphics model do not appear in xdot output. In particular, the style valuesfilled,rounded,diagonals, andinviswill not appear. Indeed, if style containsinvis, there will not be any xdot output at all.

In handling text 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, thedecorateattribute is set on an edge, its label attribute will also contain a polyline operation. In addition, if a label is a complex, HTML-like label, it will also contain non-text operations.

All coordinates and sizes are in points. Note though that if an edge or node is invisible, no drawing operations are attached to it.

Version info:

Xdot version Graphviz version
1.0 1.9
1.1 2.8
1.2 2.13
cmap
Produces map files for client-side image maps. The cmap format is mostly identical to cmapx, but the latter is well-formed XML amenable to processing by XML tools. In particular, the cmapx output is wrapped in <map></map>.

SeeNote.

eps
Produces Encapsulated PostScript output. At present, this is only guaranteed to be correct for a single input graph since the Bounding Box information has to appear at the beginning of the output, and this will be based on the first graph.
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.
gtk
Creates aGTKwindow and displays the output there.
ico
Outputs images in the WindowsICO format.
imap,
cmapx
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.gv */
digraph mainmap {
  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 and generate two output files:
dot -Timap -ox.map -Tgif -ox.gif x.gv
and then refer to it in a web page:
&lt;A HREF=&quot;x.map&quot;&gt;&lt;IMG SRC=&quot;/doc/info/x.gif&quot; ismap=&quot;ismap&quot; /&gt;&lt;/a&gt;
For client-side maps, one again generates two output files:
dot -Tcmapx -ox.map -Tgif -ox.gif x.gv
and uses the HTML
&lt;IMG SRC=&quot;/doc/info/x.gif&quot; USEMAP=&quot;#mainmap&quot; /&gt;... [content of x.map] ...
Note that the name given in the USEMAP attribute must be the same as the ID attribute of the MAP element. The Graphviz renderer uses the name of the graph as the ID. Thus, in the example above, where the graph's name ismainmap, we haveUSEMAP="#mainmap"in the IMG attribute, and x.map will look like
&lt;map id=&quot;mainmap&quot; name=&quot;mainmap&quot;&gt;... &lt;/map&gt;

URLscan 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 alabel, that will link to the URL. As for the head of the edge, this is linked to theheadURL, if set. Otherwise, it is linked to the edge's URL if that is defined. The analogous description holds for the tail and thetailURL. 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 theheadlabel, if defined. The analogous result holds for the tailURL and thetaillabel.

SeeNote.

imap_np,
cmapx_np
These are identical to the imap and cmapx formats, except they rely solely on rectangles as active areas.
ismap
Produces HTML image map files. This is a predecessor (circa 1994) of the IMAP format. Most servers now use the latter.URLscan be attached to the root graph, nodes and edges. Since edge links are attached to edge labels, an edge must have alabelfor 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,
jpe
Output JPEG compressed image files.
pdf
ProducesPDFoutput. (This option assumes Graphviz includes the Cairo renderer.) Alternatively, one can use theps2option to produce PDF-compatible PostScript, and then use a ps-to-pdf converter.

Note: At present, this option does not support anchors, etc. To get these included in your PDF output, useps2.

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
Thewidthandheightvalues give the width and height of the drawing. The lower left corner of the drawing is at the origin. Thescalevalue indicates how the drawing should be scaled if asizeattribute 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
Thenamevalue is the name of the node, andxandygive the node's position. Thewidthandheightare the width and height of the node. Thelabel,style,shape,colorandfillcolorgive the node'slabel,style,shape,colorandfillcolor, respectively, using attribute default values where necessary. If the node does not have a style attribute, "solid" is used.
edge
Thetailandheadvalues 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.nis the number of control points defining the B-spline forming the edge. This is followed by 2*nnumbers giving the x and y coordinates of the control points in order from tail to head. If the edge has alabel, this comes next followed by the x and y coordinates of the label's position. The edge description is completed by the edge'sstyleandcolor. As with nodes, if a style is not defined, "solid" is used.

Note:The control points given in an edge statement define the body of the edge. In particular, if the edge has an arrowhead to the head or tail node, there will be a gap between the last or first control points and the boundary of the associated node. There are at least 3 possible ways of handling this gap:

  • Arrange that the input graph usesdir=none,arrowhead=none, orarrowtail=nonefor all edges. In this case, the terminating control points will always touch the node.
  • Consider the line segment joining the control point and the center of the node, and determine the point where the segment intersects the node's boundary. Then use the control point and the intersection point as the main axis of an arrowhead. The problem with this approach is that, if the edge has a port, the edge will not be pointing to the center of the node. In this case, rather than use the control point and center point, one can use the control point and its tangent.
  • Arrange that the input graph usesheadclip=falseortailclip=false. In this case, the edge will terminate at the node's center rather than its boundary. If arrowheads are used, there will still be a gap, but normally this will occur within the node. The application will still need to clip the spline to the node boundary. Also, as with the previous item, if the edge points to a node port, this technique will fail.

The output consists of onegraphline, a sequence ofnodelines, one per node, a sequence ofedgelines, one per edge, and a finalstopline. All units are in inches, represented by a floating point number.

Note that the plain formats provide minimal information, really giving not much more than node positions and sizes, and edge spline control points. These formats are usually most useful to applications wanting just this geometric information, and willing to fill in all of the graphical details. The only real advantages to these formats is their terseness and their ease of parsing. In general, thedotandxdotare preferable in terms of the quantity of information provided.

png
Produces output in the PNG (Portable Network Graphics) format.
ps
Produces PostScript output.

Note: The default PostScript renderer can only handle the Latin-1 character set. To get non-Latin-1 characters into PostScript output, use-Tps:cairo, assuming your version was built with the Cairo renderer.

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 aspdflatex. 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
ProduceSVGoutput, the latter in compressed format.

SeeNote.

tif,
tiff
ProducesTIFFoutput.
vml,
vmlz
ProducesVMLoutput, the latter in compressed format.

SeeNote.

vrml
Outputs graphs in theVRMLformat. To get a 3D embedding, nodes must have azattribute. These can either be supplied as part of the input graph, or be generated by neato provideddim=3and at least one node has azvalue.

Line segments are drawn as cylinders. In general, VRML output relies on having the PNG library to produce images used to texture-fill the node shapes. However, ifshape=point, a node is drawn as a 3D sphere.

wbmp
Produces output in the Wireless BitMap (WBMP) format, optimized for mobile computing.
webp
Produces output in the image format for the Web (WEBP) format, optimized for web devices such as tablets. See Wikipedia'sWebPor Google'swebppages.
xlib
Creates anXlibwindow and displays the output there.


Image Formats


Theimageandshapefileattributes specify an image file to be included as part of the final diagram. Not all image formats can be read. In addition, even if read, not all image formats can necessarily be used in a given output format.

The graph below shows what image formats can be used in which output formats, and the required plugins. On the left are the supported image formats. On the right are the supported output formats. In the middle are the plugins: image loaders, renderers, drivers, arranged by plugin library. This presents the most general case. A given installation may not provide one of the plugins, in which case, that transformation is not possible.


Notes

  1. In the formats: -Tcmap, -Tcmapx, -Tsvg, -Tvml, the output generates 'id="node#"' properties for nodes, 'id="edge#"' properties for edges, and 'id="cluster#"' properties for clusters, with the '#' replaced by an internally assigned integer. These strings can be provided instead by an externally provided "id=xxx" attribute on the object. Normal "'N" "'E" "'G" substitutions are applied. Externally provided id values are not used internally, and it is the use's reponsibilty to ensure that they are sufficiently unique for their intended downstream use. Note, in particular, that "'E" is not a unique id for multiedges.
分享到:
评论

相关推荐

    Pygments-1.6-py2.6

    a number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences it is usable as a command-line tool and as a library ... and it highlights even Brainf*ck!

    Mz Tools v7.0.0.102 crack 破解版

    Generate documentation: in either XML or customizable HTML output formats. Ensure quality and standards: define standards through flexible rules and ensure that the team follows them.

    ADV212相关资料

    能够找到的关于ADV212的相关资料都在这儿了,有用的话请自取 ADV212.pdf ADV212_UserGuide_Rev1.1.pdf ...TechNote_ADV202_output_format_1.pdf ADV202_HIPI_mode_rev03.pdf HIPI_mode_overview_2.pdf

    mistletoe-ebp-master_PURE_ebp_

    This is a version of mistletoe maintained ... Parsing Markdown into an abstract syntax tree also allows us to swap out renderers for different output formats without touching any of the core components.

    [R.Books]R Graphics

    1.3 Graphical output formats 1.3.1 Graphics devices 1.3.2 Multiple pages of output 1.3.3 Display lists I TRADITIONALGRAPHICS 2 SimpleUsageofTraditionalGraphics 2.1 The traditional graphics model 2.2 ...

    一个win32下的ARM开源编译器

    Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. ...

    Automating Junos Administration - Jonathan_. Looney.pdf

    2. Preface 1. Assumptions 2. How to Read This Book 3. What’s in This Book?...1. RPC Output Formats 2. Discovering Operational RPC Syntax 3. Discovering RPC Reply Syntax 4. Configuration

    IRIG_B.zip

    sampling, data-to-phasor conversions, and formats for timing input and phasor data output from a Phasor Measurement Unit (PMU). It does not specify response time, accuracy, hardware, software, or a ...

    Moo0系列软件之 《Moo0 音频格式转换器 》(免费版)

    It currently supports 33 output formats [3GP, 3GP (AAC), 3G2, 3G2 (AAC), AAC, AC3, AIFF, AMR, AU, AU (a-Law), AU (u-Law), FLAC, M4A, M4A (ALAC), MMF, MOV, MP2, MP3, MP4, OGG, OGG (FLAC), RA, RM, WAV,...

    Qwinff_0.1.9中文版(跨平台媒体转换器qt)

    - Added output formats: asf, swf, aiff, flac, au, mp2 - Added more output path options. - Added update checker. - Automatically start conversion after adding files (off by default) - Several ...

    MT9V032_DS_D.pdf

    Features • Array format: Wide-VGA, active ...• Data output formats: – Single sensor mode: 10-bit parallel/stand-alone 8-bit or 10-bit serial LVDS – Stereo sensor mode: Interspersed 8-bit serial LVDS

    安装CD音频文件提取工具Flacon.zip

    完整 Flacon 功能列表:supports the following input formats: WAV, FLAC, APE, WavPack, True Audio (TTA).supported output formats: LAC, WAV, WavPack, AAC, OGG, MP3 and Opus (with the latest Flacon 1.2.0...

    分块渲染插件superender3e

    Super Render V3.0 by Chrome What is this script made for: Super Render V3.0 is the utility for the people who need to make really large ,1 frame renders....- Output formats: JPG,TGA, BMP

    ov7740_datasheet

     output formats (8-bit): 8-/10-bit Raw RGB data, 8-bit YUV  lens size: 1/5"  lens chief ray angle: TBD  input clock frequency: 6 ~ 27 MHz  S/N ratio: TBD  dynamic range: TBD  maximum image ...

    DELPHI 音频格式互转控件(MP3、WMA、APE、FLAC、MPC、Ogg、WV)

    因为项目需要将wav音频格式的文件压缩...WMA2Ogg - This converter demostrates how to select WMA output formats。 另外还可以实现各类音频格式的播放、编辑功能。 本控件在delphi7上经本人调试通过,确认没有问题。

    tesseract-master.zip

    Tesseract supports various output formats: plain-text, hocr(html), pdf, tsv, invisible-text-only pdf. You should note that in many cases, in order to get better OCR results, you'll need to improve ...

    hadoop 权威指南(第三版)英文版

    hadoop权威指南第三版(英文版)。 Foreword . . . . . . . ....Preface ....1. Meet Hadoop ....2. MapReduce ....Output Formats Text Output Binary Output Multiple Outputs Lazy Output Database Output

    VisioForge_Video_Capture_SDK_v10_D6-XE10.2

    custom output formats (using 3rd-party DirectShow filters) Audio capture to WAV (compressed or not) MP3 (using LAME) Frame capture to Bitmap class, BMP, JPEG and PNG files Video processing and effects...

    Jasper_Report用户手册

    Jasper Report用户手册 version1.0 1 简介 2 API概览 Class net.sf.jasper.engine.design.JasperDesign Class net.sf.jasper.engine.JasperReport Class ...10.4 Exporting to New Output Formats

    ABAP Programming Standards ABAP Programming Standards

    Currency Output Formats 7 Paper Size 7 AUTHORIZATION CHECKING 7 Reports (Read only) 7 Update Programs 8 Adding Authorization Checks 8 COMMENTS 8 STATEMENT FORMATTING 8 Code Formatting 8 Chaining 8 ...

Global site tag (gtag.js) - Google Analytics