From 2cfe4bd5465fd4b5654031c3fb2dcfe4aa725733 Mon Sep 17 00:00:00 2001 From: north Date: Wed, 4 Jan 2006 03:28:06 +0000 Subject: [PATCH] Mention dotty syntax errors due to shell environment, some other cleanup, add anchors to questions. --- doc/FAQ.html | 111 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 9 deletions(-) diff --git a/doc/FAQ.html b/doc/FAQ.html index f330477e2..daf82a613 100644 --- a/doc/FAQ.html +++ b/doc/FAQ.html @@ -1,9 +1,9 @@ -Graphviz FAQ 2005-12-27 +Graphviz FAQ 2006-01-03 -

Graphviz FAQ 2005-12-27

+

Graphviz FAQ 2006-01-03

Stephen North, Emden Gansner, @@ -20,8 +20,10 @@ for a partial list of compatible tools and packages.

General

+ Q. Where can I see a list of all the attributes that control dot or neato? +

See Graph Attributes. There is also information on @@ -31,7 +33,9 @@ command-line usage and output formats.

+ Q. Where can I discuss Graphviz? +

We run a mailing list.

@@ -79,7 +83,9 @@ text form, fill in the fields, and email it to gviz-bugs@research.att.com.

+ Q. I'm trying to make a layout larger. How? +

There are various ways to increase the size of a layout. In doing this, one has to decide if the sizes of the nodes and text should be @@ -133,7 +139,9 @@ manually adding a command such as 2 2 scale where the Postscript environment is set up. Make sure to adjust the BoundingBox too if your tools look at this header.

+ Q. How can I join or merge certain edge routes in dot? +

You can try running dot -Gconcentrate=true or you can introduce your own virtual nodes drawn as tiny circles where @@ -178,7 +186,9 @@ Set the label at the end of the graph (before the closing brace), after all its contents have been defined. (We admit it seems desirable to define some special syntax for non-inherited attribute settings.)

+ Q. How can I draw multiple parallel edges in neato? +

This is possible when the splines attribute is false, which is the default. When splines=true, we have no good answer but @@ -241,13 +251,17 @@ A similar check is done for logical tails. In these cases, the edge is drawn between the real nodes as usual.

+ Q. Clusters are hard to see. +

Set bgcolor=grey (or some other color) in the cluster.

+ Q. How can I symmetrize (balance) tree layouts? +

When a tree node has an even number of children, it isn't necessarily centered above the two middle ones. If you know the order of the children, @@ -273,7 +287,9 @@ layouts other than trees, too).

Output features

+ Q. How can I get high quality (antialiased) output? +

The easiest thing may be to make the layout in Postscript (option -Tps), then run through Ghostview with @@ -301,14 +317,18 @@ and binary RPMs for Fedora Core 4 are around. Then you need to install the optional graphviz-cairo plugin. It is believed that Cairo will be part of FC5, so this will become a more standard feature.

+ Q. I can only get 11x17 output. +

It's not us! It's probably your printer setup. If you don't believe this, run dot -Tps and look at the BoundingBox header. The coords are in 1/72ths of an inch.

+ Q. How do I create special symbols and accents in labels? +

The following solution only works with the raster drivers that load Truetype or Type1 @@ -326,7 +346,9 @@ You can look up other examples in this handy character set reference .

+ Q. How do I get font and color changes in record labels or other labels? +

This is not possible in record shapes. However, you can do this using @@ -336,7 +358,9 @@ the effect you want. The intention is to support arbitrary font changes within running text in the not-too-distant future.

+ Q. In plain format, splines do not touch the nodes (arrowheads are missing). +

Edges are specified as the main spline and, if necessary, arrowheads which actually abut the node. If the arrowheads are not given, drawing @@ -350,7 +374,9 @@ A workaround is to set Since the edges have no arrowheads, the spline specification will go all the way to both nodes.

+ Q. Record nodes are drawn differently in dot and neato when rankdir=LR. +

It's true. dot -Grankdir=LR rotates record nodes so that their top level fields are still listed across levels. rankdir=LR has no effect in neato. @@ -362,7 +388,9 @@ record labels in { } to rotate/unrotate the record contents. See also, How To Avoid Foolish Consistency by Scott Berkun (Microsoft Corp.)

+ Q. How can I print a big graph on multiple pages? +

The page attribute, if set, tells Graphviz to print the graph as an array of pages of the given size. Thus, the graph @@ -380,9 +408,11 @@ Alternatively, there are various tools and viewers which will take a large picture and allow you to extract page-size pieces, which can then be printed.

+ Q. When I have a red edge it shows up as a solid red in PNG and GIF formats, but has a black border when rendered to JPEG. +

This is an artifact of JPEG's lossy compression algorithm. JPEG isn't very good @@ -392,7 +422,9 @@ eventually remove the JPEG driver, but North is reluctant to change anything that people might already rely on.

+ Q. How can I get custom shapes or images in my graph? +

Please see the @@ -402,15 +434,36 @@ custom shapes that work with dot/neato, dotty front end), because they don't share any universal back end structure. We're thinking about it.

+ Q. Sometimes in dotty, right mouse click shows the global menu but none of the items can be selected. +

Check that the NUMLOCK key is off. It's a known bug.

+ +Q. Why does dotty report a syntax error on a legal dot file? + +Typically this error is reported as: +

+>> graph parser: syntax error near line 14
+>> context:  >>>  <<< digraph G {
+>> dotty.lefty: giving up on dot
+>> dotty.lefty: graph that causes dot
+>> dotty.lefty: to fail has been saved in file dottybug.dot
+
+Probably there is a command in your shell environment (such as +.alias or .profile) that does output even for non-interactive shells. +When this occurs, those characters go in the pipe to the dot parser +and cause this problem. An easy check is whether other users have +the same problem. +

+ Q. How can I get some display feature (such as bold lines) in dotty? +

Dotty has not really changed for many years. Therefore, there are myriad features available in Graphviz which it cannot handle. @@ -437,16 +490,20 @@ various front ends don't use it yet. This would be a good project for someone who wants to get involved here (along with porting dotty to GTK.)

+ Q. How can I get rid of the little circles on edges ("edge handles") in dotty? +

Edit the file dotty.lefty and change the line that says: 'edgehandles' = 1; to 'edgehandles' = 0; it's around line 110.

+ Q. I already have all the coordinates for the nodes and edges of my graph and just want to use dot, neato, or dotty to render it. How? +

Put the graph with layout attributes into a dot file. @@ -460,8 +517,10 @@ defined, neato will perform whatever edge routing it would normally do. All of the usual backend attributes (size, overlap, page, etc.) are available.

+ Q. I already have all the coordinates for the nodes, and I want dot or neato to route the edges. +

It's not really too convenient to use dot for this. It is possible to use neato for this, @@ -479,22 +538,30 @@ you have to specify -Gsplines=true. And this will only work if none of the nodes overlap. Since the input graph supplies fixed node positions, it is the user's task to insure this.

+ Q. I already have all the coordinates for the nodes and edges of my graph and just want to use dotty to render it. How? +

Just run dotty on it. Dotty will use the given pos attributes.

+ Q. Same as above, but I have only node coords, not edges. +

neato -n -s is some help, but neato doesn't handle spline-based parallel edges.

+ Q. How can I make client-side image maps? +

Use the -Tcmap command line option (only version 1.8.9 and beyond!)

+ Q. Why aren't my server-side maps being recognized? I've checked the HTML! +

Make sure that your server has map files enabled. For example, if running apache, check that httpd.conf has a line like the following: @@ -503,6 +570,7 @@ AddHandler imap-file map and that it is not commented out!

+ Q. I've installed Debian Graphviz and it works just fine on the command line, but when I execute a Perl/CGI script through Apache, no output is generated. For example, the code @@ -510,6 +578,7 @@ For example, the code system("/usr/local/bin/dot -Tpng /tmp/tree.dot -o /tmp/tree.png"); produces no file /tmp/tree.png. +

As best as we can tell, dot dies with no stdout or stderr messages on Debian systems when run from an Apache cgi program @@ -520,7 +589,9 @@ Someone has also suggested using the Perl module for Graphviz.

+ Q. How can I get 3D output? +

The Graphviz authors have qualms about the gratuitous use of 3D.

@@ -538,11 +609,15 @@ This would need some (minor) driver work and a good 7-dimensional viewer. Well, dim=3 ought to be possible.

Problems

+ Q. How can I avoid node overlaps in neato? +

Use the graph attribute overlap.

+ Q. How can I avoid node-edge overlaps in neato? +

Use the overlap attribute to leave room among the nodes, then use -Gsplines=true. @@ -558,7 +633,9 @@ The actual value may require some tinkering. slows down neato, so should be used sparingly and only with modest-sized graphs.

+ Q. Neato runs forever on a certain example. +

First, how big is your graph? Neato is a quadratic algorithm, roughly equivalent to statistical multidimensional scaling. If you @@ -594,14 +671,18 @@ Note that, if you have a large graph, the generation of edges as splines is a cubic algorithm, so you would do well to avoid using splines=true. (This commment applies to circo, fdp and twopi as well.)

+ Q. Edge label placement in neato is bad. +

Difficult problem. We're working on it. If anyone has some general label placement code (e.g. a simulated annealer based on the Marks et al. technique in Graphics Gems IV), please get in touch.

+ Q. Dot runs forever on a certain example. +

Try dot -v to observe its progress.

@@ -641,8 +722,10 @@ digraph G { The addition of attr0 touches every node of the graph. Then the addition of attr1 touches every node again, and so on.

-Q. Neato has unnecessary edge crossings, or has missed an -obvious change to make a much nicer layout. + +Q. Neato has unnecessary edge crossings, or has missed an +obvious chance to make a much nicer layout. +

Neato and all similar virtual physical model algorithms rely on heuristic solutions of optimization problems. The better @@ -661,7 +744,9 @@ In particular, note that there are no guarantees that neato will produce a planar layout of a planar graph, or expose all or most of a graph's symmetries.

-Q. Webdot doesn't work. + +Q. Webdot doesn't work. +

We assume you're using Apache and have TCL installed. If you don't, it's probably better to just use the @@ -694,7 +779,7 @@ can't read "LIBTCLDOT": no such variable " (file "scaffold.tcl" line 22) -The above is a strong clue that webdot is not configured properly properly. +The above is a strong clue that webdot is not configured properly.

Finally, test whether webdot runs as a cgi-bin program. It may help to examine the cgi-bin environment using a @@ -708,7 +793,9 @@ simple cgi-bin tcl script like: Save this script as .../cgi-bin/test.tcl, make it executable, then look at: http://localhost/cgi-bin/test.tcl

-Q. I have "Font not found" errors, or text labels missing in webdot. + +Q. I have "Font not found" errors, or text labels missing in webdot. +

Firstly, recent versions of graphviz will use fontconfig if it is available on your platform. With fontconfig, this error should not occur, so you @@ -733,7 +820,9 @@ the webdot script, or recompile Graphviz with the correct DEFAULT_FONTPATH (or set fontpath="/your/font/directory" in every graph you lay out, but that's pretty clumsy.)

-Q. My browser doesn't recognize SVG. + +Q. My browser doesn't recognize SVG. +

The correct MIME type for svg images is: image/svg+xml (note "+" not "-").

@@ -742,14 +831,18 @@ SVG is not built into all browsers; you can get from Adobe for Windows, Linux and some other operating systems. The Amaya browser from W3C is said to have builtin SVG. +Firefox 1.5 has a (a href="http://developer.mozilla.org/en/docs/SVG_in_Firefox_1.5">large subset of SVG (somebody please let us know if it can +render graphviz -Tsvg output>. Batik is an SVG renderer in Java and can be run as a stand-alone program.

For help with embedding SVG in HTML pages, see here.

-Q. libexpat is reported as containing a virus or as a security hole. + +Q. libexpat is reported as containing a virus or as a security hole. Is this a real problem? +

No, this is a false positive reported by various security software. See http://www.pcreview.co.uk/forums/thread-1689630.php or -- 2.40.0