]> granicus.if.org Git - graphviz/commitdiff
Clarify the need to specify the layout algorithm in demo.c.
authorEmden R. Gansner <erg@alum.mit.edu>
Thu, 21 Aug 2014 19:12:54 +0000 (15:12 -0400)
committerEmden R. Gansner <erg@alum.mit.edu>
Thu, 21 Aug 2014 19:12:54 +0000 (15:12 -0400)
doc/libguide/drivers.tex
doc/libguide/libguide.pdf
doc/libguide/samples.tex

index 06d2dfc459893cd3218f58b5930794aa7e86d48f..930e5877c71e41e46de99df30019397e69a07727 100644 (file)
@@ -37,9 +37,12 @@ call the function {\tt gvParseArgs}:
 This function takes the context value, plus an array of strings
 using the same conventions as the parameters to {\tt main} function
 in a C program. In particular, {\tt argc} should be the number of
-values in {\tt argv}. If {\tt argv[0]} is the name of one of the
+values in {\tt argv}. If the base part of {\tt argv[0]} ({\tt argv[0]} with the
+directory portion removed) is the name of one of the
 layout algorithms, this will be bound to the \gvc\ value and used
 at layout time.
+(This can always be overridden by supplying a {\tt "-K"} flag, or by
+supplying a {\tt "layout"} attribute in the graph.)
 The remaining {\tt argv} values, if any, are interpreted exactly like
 the allowed command line flags for any \gviz\ program.
 Thus, {\tt "-T"} can be used to set the output type, and {\tt "-o"}
index 7a071e0f5a36a89d7257b73d41c2071650edd9eb..0ba7a62afbcd5124cd52025e5aaed555942e1234 100644 (file)
Binary files a/doc/libguide/libguide.pdf and b/doc/libguide/libguide.pdf differ
index 258d315334db5e78e1712ec055b763d05c3760ee..a6e78cf8d17f74a07c4c9daf3dfa5f5eacceb9bb 100644 (file)
@@ -1,7 +1,7 @@
 \section{A sample program: {\tt simple.c}}
 \label{sec:simple}
 This following code illustrates an application which uses \gviz\ to
-position a graph using the \dot\ layout and then write the output
+position a graph using the \dot\ layout and then writes the output
 using the {\tt plain} format.
 An application can replace the call to {\tt gvRender} with its own
 function for rendering the graph, using the layout information
@@ -76,6 +76,14 @@ int main(int argc, char **argv)
 This example provides a modification of the previous example. Again it
 relies on the \gviz\ renderers, but now it creates the graph dynamically
 rather than reading the graph from a file.   
+
+Note that either the graph or the {\tt argv[]} values have to specify which
+layout algorithm is used, as explained in Section~\ref{sec:gvc}. Specifically,
+the input graph must have the {\tt layout} attribute set, or the command line
+arguments must contain a valid {\tt "-K"} flag.
+If not, {\tt gvParseArgs} will look at the base name part of {\tt argv[0]} and
+use that as the name of desired layout program. For this to work, the executable
+program needs to be renamed as one of the \gviz\ layout programs (cf. Section~\ref{sec:intro}).
 \begin{verbatim}
 #include <gvc.h>