]> granicus.if.org Git - graphviz/commitdiff
Update documentation to note xlp, head_lp and tail_lp attributes;
authorEmden Gansner <erg@research.att.com>
Wed, 31 Oct 2012 20:04:05 +0000 (16:04 -0400)
committerEmden Gansner <erg@research.att.com>
Wed, 31 Oct 2012 20:04:05 +0000 (16:04 -0400)
add more details and examples concerning style attribute and style=tapered;
describe style=wedged and style=striped.

35 files changed:
doc/info/attrs.html
doc/info/c_bold.png [new file with mode: 0644]
doc/info/c_dashed.png [new file with mode: 0644]
doc/info/c_dotted.png [new file with mode: 0644]
doc/info/c_filled.png [new file with mode: 0644]
doc/info/c_rounded.png [new file with mode: 0644]
doc/info/c_solid.png [new file with mode: 0644]
doc/info/c_striped.png [new file with mode: 0644]
doc/info/e_bold.png [new file with mode: 0644]
doc/info/e_dashed.png [new file with mode: 0644]
doc/info/e_dotted.png [new file with mode: 0644]
doc/info/e_solid.png [new file with mode: 0644]
doc/info/n_bold.png [new file with mode: 0644]
doc/info/n_dashed.png [new file with mode: 0644]
doc/info/n_diagonals.png [new file with mode: 0644]
doc/info/n_dotted.png [new file with mode: 0644]
doc/info/n_filled.png [new file with mode: 0644]
doc/info/n_rounded.png [new file with mode: 0644]
doc/info/n_solid.png [new file with mode: 0644]
doc/info/n_striped.png [new file with mode: 0644]
doc/info/n_wedged.png [new file with mode: 0644]
doc/info/none_back.png [new file with mode: 0644]
doc/info/none_both.png [new file with mode: 0644]
doc/info/none_forward.png [new file with mode: 0644]
doc/info/none_none.png [new file with mode: 0644]
doc/info/normal_back.png [new file with mode: 0644]
doc/info/normal_both.png [new file with mode: 0644]
doc/info/normal_forward.png [new file with mode: 0644]
doc/info/normal_none.png [new file with mode: 0644]
doc/infosrc/Makefile.old
doc/infosrc/attrs
doc/infosrc/mklang.y
doc/infosrc/mkstyles.sh [new file with mode: 0755]
doc/infosrc/mktapers.sh [new file with mode: 0755]
doc/infosrc/types

index e27868adb005a70641c6bcd53658b7b342d6653a..8494add8d7acc513f25868022cd09753a07e198c 100644 (file)
@@ -196,6 +196,9 @@ This field indicates which graph component uses the attribute.
  <TR><TD><A NAME=a:headURL HREF=#d:headURL>headURL</A>
 </TD><TD>E</TD><TD><A HREF=#k:escString>escString</A>
 </TD><TD ALIGN="CENTER">""</TD><TD></TD><TD>svg, map only</TD> </TR>
+ <TR><TD><A NAME=a:head_lp HREF=#d:head_lp>head_lp</A>
+</TD><TD>E</TD><TD><A HREF=#k:point>point</A>
+</TD><TD ALIGN="CENTER"></TD><TD></TD><TD>write only</TD> </TR>
  <TR><TD><A NAME=a:headclip HREF=#d:headclip>headclip</A>
 </TD><TD>E</TD><TD><A HREF=#k:bool>bool</A>
 </TD><TD ALIGN="CENTER">true</TD><TD></TD><TD></TD> </TR>
@@ -456,6 +459,9 @@ This field indicates which graph component uses the attribute.
  <TR><TD><A NAME=a:tailURL HREF=#d:tailURL>tailURL</A>
 </TD><TD>E</TD><TD><A HREF=#k:escString>escString</A>
 </TD><TD ALIGN="CENTER">""</TD><TD></TD><TD>svg, map only</TD> </TR>
+ <TR><TD><A NAME=a:tail_lp HREF=#d:tail_lp>tail_lp</A>
+</TD><TD>E</TD><TD><A HREF=#k:point>point</A>
+</TD><TD ALIGN="CENTER"></TD><TD></TD><TD>write only</TD> </TR>
  <TR><TD><A NAME=a:tailclip HREF=#d:tailclip>tailclip</A>
 </TD><TD>E</TD><TD><A HREF=#k:bool>bool</A>
 </TD><TD ALIGN="CENTER">true</TD><TD></TD><TD></TD> </TR>
@@ -498,6 +504,9 @@ This field indicates which graph component uses the attribute.
  <TR><TD><A NAME=a:xlabel HREF=#d:xlabel>xlabel</A>
 </TD><TD>EN</TD><TD><A HREF=#k:lblString>lblString</A>
 </TD><TD ALIGN="CENTER">""</TD><TD></TD><TD></TD> </TR>
+ <TR><TD><A NAME=a:xlp HREF=#d:xlp>xlp</A>
+</TD><TD>NE</TD><TD><A HREF=#k:point>point</A>
+</TD><TD ALIGN="CENTER"></TD><TD></TD><TD>write only</TD> </TR>
  <TR><TD><A NAME=a:z HREF=#d:z>z</A>
 </TD><TD>N</TD><TD>double</TD><TD ALIGN="CENTER">0.0</TD><TD>-MAXFLOAT<BR>-1000</TD><TD></TD> </TR>
 </TABLE>
@@ -881,6 +890,10 @@ This field indicates which graph component uses the attribute.
   <A HREF=#d:URL>URL</A> value.
   See <A HREF=#h:undir_note>limitation</A>.
 
+<DT><A NAME=d:head_lp HREF=#a:head_lp><STRONG>head_lp</STRONG></A>
+<DD>  Position of an edge's head label, <A HREF=#points>in points</A>.
+  The position indicates the center of the label.
+
 <DT><A NAME=d:headclip HREF=#a:headclip><STRONG>headclip</STRONG></A>
 <DD>  If true, the head of an edge is clipped to the boundary of the head node;
   otherwise, the end of the edge goes to the center of the node, or the
@@ -1789,6 +1802,10 @@ This field indicates which graph component uses the attribute.
   <A HREF=#d:URL>URL</A> value.
   See <A HREF=#h:undir_note>limitation</A>.
 
+<DT><A NAME=d:tail_lp HREF=#a:tail_lp><STRONG>tail_lp</STRONG></A>
+<DD>  Position of an edge's tail label, <A HREF=#points>in points</A>.
+  The position indicates the center of the label.
+
 <DT><A NAME=d:tailclip HREF=#a:tailclip><STRONG>tailclip</STRONG></A>
 <DD>  If true, the tail of an edge is clipped to the boundary of the tail node;
   otherwise, the end of the edge goes to the center of the node, or the
@@ -1901,6 +1918,10 @@ This field indicates which graph component uses the attribute.
   so that they do not overlap any node or label. This means it may not be possible to place all
   of them. To force placing all of them, use the  <A HREF=#d:forcelabels><B>forcelabels</B></A> attribute.
 
+<DT><A NAME=d:xlp HREF=#a:xlp><STRONG>xlp</STRONG></A>
+<DD>  Position of an exterior label, <A HREF=#points>in points</A>.
+  The position indicates the center of the label.
+
 <DT><A NAME=d:z HREF=#a:z><STRONG>z</STRONG></A>
 <DD>  <B>Deprecated:</B>Use <A HREF=#d:pos><B>pos</B></A> attribute, along
   with <A HREF=#d:dimen><B>dimen</B></A> and/or <A HREF=#d:dim><B>dim</B></A>
@@ -2031,8 +2052,10 @@ enclosed in the parentheses,  <TT>(...)+</TT> indicates 1 or more, and
    <A HREF=#d:style>style</A> to <TT>invis</TT>.
 
 <DT><A NAME=k:colorList><STRONG>colorList</STRONG></A>
-<DD>A colon-separated list of color values: <I>C</I>(:<I>C</I>)*
-   where each <I>C</I> is a <A HREF=#k:color>color</A> value.
+<DD>A colon-separated list of weighted color values: <I>WC</I>(:<I>WC</I>)*
+  where each <I>WC</I> has the form <I>C(;F)?</I> with C a <A HREF=#k:color>color</A> value
+  and the optional <I>F</I> a floating-point number, 0 &le; <I>F</I> &le; 1. The sum of the 
+  floating-point numbers in a <TT>colorList</TT> must sum to at most 1.
   <P>
   Depending on the related attribute and graph object, two colors may specify a gradient fill.
   The following table shows some variations of the <TT>yellow:blue</TT> color list depending on the
@@ -2313,10 +2336,59 @@ enclosed in the parentheses,  <TT>(...)+</TT> indicates 1 or more, and
   At present, the recognized style names are
   "dashed", "dotted", "solid", "invis" and "bold" for nodes and edges,
   "tapered" for edges only,
-  and "filled", "diagonals" and "rounded" for nodes only.
-  The styles "filled" and "rounded" are recognized for clusters.
+  and "filled", "striped", "wedged", "diagonals" and "rounded" for nodes only.
+  The styles "filled", "striped" and "rounded" are recognized for clusters.
   The style "radial" is recognized for nodes, clusters and graphs, and indicates a
   radial-style gradient fill if applicable.
+  The style "striped" is recognized for clusters and rectangularly-shaped nodes, and causes the
+  fill to be done as a set of vertical stripes. The colors are specified via a <A HREF=#k:colorList>colorList</A>, 
+  the colors drawn from left to right in list order. Optional color weights can be specified to indicate the
+  proportional widths of the bars. If the sum of the weights is less than 1, the remainder is divided evenly
+  among the colors with no weight. 
+  The style "wedged" is recognized for elliptically-shaped nodes, and causes the
+  fill to be done as a set of wedges. The colors are specified via a <A HREF=#k:colorList>colorList</A>, 
+  with the colors drawn counter-clockwise starting at angle 0. Optional color weights are interpreted
+  analogously to the striped case described above.
+  <P>
+  The following tables illustrate some of the effects of the style settings. 
+  Examples of tapered line styles are given below.
+  Examples of linear and radial gradient fill can be seen under  <A HREF=#k:colorList>colorList</A>.
+  <P>
+    <TABLE border=1>
+      <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt><TD align="center"><tt>rounded</tt><TD align="center"><tt>diagonals</tt><TD align="center"><tt>filled</tt><TD align="center"><tt>striped</tt><TD align="center"><tt>wedged</tt></TR>
+      <TR><TD><IMG SRC="n_solid.png"><TD><IMG SRC="n_dashed.png"><TD><IMG SRC="n_dotted.png"><TD><IMG SRC="n_bold.png"><TD><IMG SRC="n_rounded.png"><TD><IMG SRC="n_diagonals.png"><TD><IMG SRC="n_filled.png"><TD><IMG SRC="n_striped.png"><TD><IMG SRC="n_wedged.png"></TR>
+      <CAPTION>Basic style settings for nodes</CAPTION>
+    </TABLE>
+  <P>
+    <TABLE border=1>
+      <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt></TR>
+      <TR><TD><IMG SRC="e_solid.png"><TD><IMG SRC="e_dashed.png"><TD><IMG SRC="e_dotted.png"><TD><IMG SRC="e_bold.png"></TR>
+      <CAPTION>Basic style settings for edges</CAPTION>
+    </TABLE>
+  <P>
+    <TABLE border=1>
+      <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt><TD align="center"><tt>rounded</tt><TD align="center"><tt>filled</tt><TD align="center"><tt>striped</tt></TR>
+      <TR><TD><IMG SRC="c_solid.png"><TD><IMG SRC="c_dashed.png"><TD><IMG SRC="c_dotted.png"><TD><IMG SRC="c_bold.png"><TD><IMG SRC="c_rounded.png"><TD><IMG SRC="c_filled.png"><TD><IMG SRC="c_striped.png"></TR>
+      <CAPTION>Basic style settings for clusters</CAPTION>
+    </TABLE>
+  <P>
+  The effect of <tt>style=tapered</tt> depends on the <A HREF=#d:penwidth>penwidth</A>,
+  <A HREF=#d:dir>dir</A>, <A HREF=#d:arrowhead>arrowhead</A> and <A HREF=#d:arrowtail>arrowtail</A> attributes.
+  The edge starts with width <tt>penwidth</tt> and tapers to width 1, in points. The <tt>dir</tt> attribute
+  determines whether the tapering goes from tail to head (<tt>dir=forward</tt>), from head to 
+  tail (<tt>dir=forward</tt>), from the middle to both the head and tail (<tt>dir=both</tt>), or no
+  tapering at all (<tt>dir=none</tt>). If the <tt>dir</tt> is not explicitly set, the default for the
+  graph type is used (see <A HREF=#a:dir>dir</A>). Arrowheads and arrowtails are also drawn, based on the
+  value of <tt>dir</tt>; to avoid this, set <tt>arrowhead</tt> and/or <TT>arrowtail</TT> to <TT>"none"</TT>.
+  <P>
+  The following table illustrates the <tt>style=tapered</tt> with <tt>penwidth=7</tt> and
+  <tt>arrowtail=none</tt>.
+    <TABLE border=1>
+      <TR><TD><tt>arrowhead</tt> &#92; <tt>dir</tt><TD align="center"><tt>forward</tt><TD align="center"><tt>back</tt><TD align="center"><tt>both</tt><TD align="center"><tt>none</tt></TR>
+      <TR><TD><tt>normal</tt><TD><IMG SRC="normal_forward.png"><TD><IMG SRC="normal_back.png"><TD><IMG SRC="normal_both.png"><TD><IMG SRC="normal_none.png"></TR>
+      <TR><TD><tt>none</tt><TD><IMG SRC="none_forward.png"><TD><IMG SRC="none_back.png"><TD><IMG SRC="none_both.png"><TD><IMG SRC="none_none.png"></TR>
+    </TABLE>
+  <P>
   Additional styles are available in
   device-dependent form. Style lists are passed to device drivers, which
   can use this to generate appropriate output.
diff --git a/doc/info/c_bold.png b/doc/info/c_bold.png
new file mode 100644 (file)
index 0000000..4124934
Binary files /dev/null and b/doc/info/c_bold.png differ
diff --git a/doc/info/c_dashed.png b/doc/info/c_dashed.png
new file mode 100644 (file)
index 0000000..e561c25
Binary files /dev/null and b/doc/info/c_dashed.png differ
diff --git a/doc/info/c_dotted.png b/doc/info/c_dotted.png
new file mode 100644 (file)
index 0000000..0616290
Binary files /dev/null and b/doc/info/c_dotted.png differ
diff --git a/doc/info/c_filled.png b/doc/info/c_filled.png
new file mode 100644 (file)
index 0000000..f8b21e9
Binary files /dev/null and b/doc/info/c_filled.png differ
diff --git a/doc/info/c_rounded.png b/doc/info/c_rounded.png
new file mode 100644 (file)
index 0000000..e2bde0a
Binary files /dev/null and b/doc/info/c_rounded.png differ
diff --git a/doc/info/c_solid.png b/doc/info/c_solid.png
new file mode 100644 (file)
index 0000000..87c7cdc
Binary files /dev/null and b/doc/info/c_solid.png differ
diff --git a/doc/info/c_striped.png b/doc/info/c_striped.png
new file mode 100644 (file)
index 0000000..860deb2
Binary files /dev/null and b/doc/info/c_striped.png differ
diff --git a/doc/info/e_bold.png b/doc/info/e_bold.png
new file mode 100644 (file)
index 0000000..036ad97
Binary files /dev/null and b/doc/info/e_bold.png differ
diff --git a/doc/info/e_dashed.png b/doc/info/e_dashed.png
new file mode 100644 (file)
index 0000000..f11233e
Binary files /dev/null and b/doc/info/e_dashed.png differ
diff --git a/doc/info/e_dotted.png b/doc/info/e_dotted.png
new file mode 100644 (file)
index 0000000..c467fa8
Binary files /dev/null and b/doc/info/e_dotted.png differ
diff --git a/doc/info/e_solid.png b/doc/info/e_solid.png
new file mode 100644 (file)
index 0000000..ac4461a
Binary files /dev/null and b/doc/info/e_solid.png differ
diff --git a/doc/info/n_bold.png b/doc/info/n_bold.png
new file mode 100644 (file)
index 0000000..e348de3
Binary files /dev/null and b/doc/info/n_bold.png differ
diff --git a/doc/info/n_dashed.png b/doc/info/n_dashed.png
new file mode 100644 (file)
index 0000000..f237858
Binary files /dev/null and b/doc/info/n_dashed.png differ
diff --git a/doc/info/n_diagonals.png b/doc/info/n_diagonals.png
new file mode 100644 (file)
index 0000000..0938054
Binary files /dev/null and b/doc/info/n_diagonals.png differ
diff --git a/doc/info/n_dotted.png b/doc/info/n_dotted.png
new file mode 100644 (file)
index 0000000..89e7eef
Binary files /dev/null and b/doc/info/n_dotted.png differ
diff --git a/doc/info/n_filled.png b/doc/info/n_filled.png
new file mode 100644 (file)
index 0000000..69fa566
Binary files /dev/null and b/doc/info/n_filled.png differ
diff --git a/doc/info/n_rounded.png b/doc/info/n_rounded.png
new file mode 100644 (file)
index 0000000..e29e1e6
Binary files /dev/null and b/doc/info/n_rounded.png differ
diff --git a/doc/info/n_solid.png b/doc/info/n_solid.png
new file mode 100644 (file)
index 0000000..e8332ff
Binary files /dev/null and b/doc/info/n_solid.png differ
diff --git a/doc/info/n_striped.png b/doc/info/n_striped.png
new file mode 100644 (file)
index 0000000..5c97325
Binary files /dev/null and b/doc/info/n_striped.png differ
diff --git a/doc/info/n_wedged.png b/doc/info/n_wedged.png
new file mode 100644 (file)
index 0000000..a47ab4c
Binary files /dev/null and b/doc/info/n_wedged.png differ
diff --git a/doc/info/none_back.png b/doc/info/none_back.png
new file mode 100644 (file)
index 0000000..e299885
Binary files /dev/null and b/doc/info/none_back.png differ
diff --git a/doc/info/none_both.png b/doc/info/none_both.png
new file mode 100644 (file)
index 0000000..893eaa4
Binary files /dev/null and b/doc/info/none_both.png differ
diff --git a/doc/info/none_forward.png b/doc/info/none_forward.png
new file mode 100644 (file)
index 0000000..f3cc88a
Binary files /dev/null and b/doc/info/none_forward.png differ
diff --git a/doc/info/none_none.png b/doc/info/none_none.png
new file mode 100644 (file)
index 0000000..0dba7fe
Binary files /dev/null and b/doc/info/none_none.png differ
diff --git a/doc/info/normal_back.png b/doc/info/normal_back.png
new file mode 100644 (file)
index 0000000..e299885
Binary files /dev/null and b/doc/info/normal_back.png differ
diff --git a/doc/info/normal_both.png b/doc/info/normal_both.png
new file mode 100644 (file)
index 0000000..089ee46
Binary files /dev/null and b/doc/info/normal_both.png differ
diff --git a/doc/info/normal_forward.png b/doc/info/normal_forward.png
new file mode 100644 (file)
index 0000000..019900f
Binary files /dev/null and b/doc/info/normal_forward.png differ
diff --git a/doc/info/normal_none.png b/doc/info/normal_none.png
new file mode 100644 (file)
index 0000000..0dba7fe
Binary files /dev/null and b/doc/info/normal_none.png differ
index 231e99c173470c7718963a13ae0a49b24b42ae69..2bda2928cbb8385a9c19bd6377bdfd9c617b2d8d 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Required tools: cc, dot, awk, ksh, yacc, gs.
 #  gs and awk are used in ps_to_jpg.sh
-#  dot is used in mkarrows.sh and mkshapes.sh
+#  dot is used in mkarrows.sh, mkshapes.sh, mkstyles.sh, mktapers.sh
 #  ps_to_png.sh and other make rules rely on netpbm tools 
 #  and ps2raster, which is part of the GMT library.
 #
@@ -34,7 +34,15 @@ MJPG = sdlshapes.jpg
 GRADPNG = g_lin0.png g_rad0.png g_lin45.png g_rad45.png g_lin90.png g_rad90.png \
           g_lin180.png g_rad180.png g_lin270.png g_rad270.png g_lin360.png g_rad360.png
 
-MPNG = plugins.png sdlshapes.png $(GRADPNG)
+STYLEPNG = n_solid.png n_dashed.png n_dotted.png n_bold.png n_filled.png n_rounded.png n_striped.png \
+           n_wedged.png n_diagonals.png \
+           e_solid.png e_dashed.png e_dotted.png e_bold.png \
+           c_solid.png c_dashed.png c_dotted.png c_bold.png c_filled.png c_rounded.png c_striped.png
+
+TAPERPNG = normal_forward.png normal_back.png normal_both.png normal_none.png \
+           none_forward.png none_back.png none_both.png none_none.png
+
+MPNG = plugins.png sdlshapes.png $(GRADPNG) $(STYLEPNG) $(TAPERPNG)
 
 SGIF = Mcircle.gif Mdiamond.gif Msquare.gif box.gif \
       circle.gif diamond.gif doublecircle.gif \
@@ -178,9 +186,15 @@ $(AGIF) :
 $(A2GIF) :
        ./mkarrows.sh -s $@
 
-$(GRADPNG) :
+$(GRADPNG) : mkgrads.sh
        ./mkgrads.sh $@
 
+$(STYLEPNG) : mkstyles.sh
+       ./mkstyles.sh $@
+
+$(TAPERPNG) : mktapers.sh
+       ./mktapers.sh $@
+
 clean :
        rm -f mklang sdlshapes.ps sdlshapes.ppm html.html
 
@@ -189,7 +203,7 @@ distclean : clean
        rm -f $(A2GIF) $(AGIF) $(SGIF) $(MJPG) $(MGIF) $(MPNG) shapes
        (for s in $$(cat shapelist); do rm -f $$s.gif; done)
 
-EXTRA_DIST = $(XGIF) mklang.y mkarrows.sh mkattrs.sh mkshapes.sh \
+EXTRA_DIST = $(XGIF) mklang.y mkarrows.sh mkattrs.sh mkshapes.sh mkstyles.sh mktapers.sh \
              mktypes.sh mkarrowtbl.sh mkoutput.sh mkshhtml.sh \
                 ps_to_jpg.sh ps_to_png.sh arrow_grammar grammar html_grammar \
              shapelist attrs.1 colors.1 colors.n \
index 77dd22e659f81876075810d5d3cf541a0c40b28b..6ed86197780d125fd4bb2dd55102227e65efa81a 100644 (file)
@@ -385,6 +385,9 @@ Synonym for <A HREF=#d:headURL>headURL</A>.
 :headlabel:E:lblString:"";
 Text label to be placed near head of edge.
 See <A HREF=#h:undir_note>limitation</A>.
+:head_lp:E:point; write
+Position of an edge's head label, <A HREF=#points>in points</A>.
+The position indicates the center of the label.
 :headport:E:portPos:center;
 Indicates where on the head node to attach the head of the edge.
 In the default case, the edge is aimed towards the center of the node,
@@ -1199,6 +1202,9 @@ See <A HREF=#h:undir_note>limitation</A>.
 :tailport:E:portPos:center;
 Indicates where on the tail node to attach the tail of the edge.
 See <A HREF=#h:undir_note>limitation</A>.
+:tail_lp:E:point; write
+Position of an edge's tail label, <A HREF=#points>in points</A>.
+The position indicates the center of the label.
 :tailtarget:E:escString:<none>;   map,svg
 If the edge has a <A HREF=#d:tailURL>tailURL</A>,
 this attribute determines which window of the
@@ -1290,6 +1296,9 @@ for the <A HREF=#d:label><B>label</B></A> attribute.
 These labels are added after all nodes and edges have been placed. The labels will be placed
 so that they do not overlap any node or label. This means it may not be possible to place all
 of them. To force placing all of them, use the  <A HREF=#d:forcelabels><B>forcelabels</B></A> attribute.
+:xlp:NE:point; write
+Position of an exterior label, <A HREF=#points>in points</A>.
+The position indicates the center of the label.
 :z:N:double:0.0:-MAXFLOAT/-1000;
 <B>Deprecated:</B>Use <A HREF=#d:pos><B>pos</B></A> attribute, along
 with <A HREF=#d:dimen><B>dimen</B></A> and/or <A HREF=#d:dim><B>dim</B></A>
index b9bb338078b39803fae4727c7bb4ac01c837ff94..e5eebbc6c03207af1143ed1387c6d8fb886d84fa 100644 (file)
@@ -185,16 +185,14 @@ skipSpace (char* p)
     return p;
 }
 
-#if 0
 static char*
-strndup (char* p, int sz)
+mystrndup (char* p, int sz)
 {
     char* s = malloc (sz+1);
     memcpy (s, p, sz);
     s[sz] = '\0';
     return s;
 }
-#endif
 
 static char*
 readLiteral (char* p)
@@ -218,7 +216,7 @@ readName (char* p)
     char* s = p;
 
     while (!isspace ((c = *p)) && (c != '\0')) p++;
-    yylval.str = strndup (s, p-s);
+    yylval.str = mystrndup (s, p-s);
     return p;
 }
 
diff --git a/doc/infosrc/mkstyles.sh b/doc/infosrc/mkstyles.sh
new file mode 100755 (executable)
index 0000000..c087729
--- /dev/null
@@ -0,0 +1,60 @@
+#! /bin/ksh
+#
+# usage: mkstyles.sh <style>
+#
+# where style has the form [nce]_<styleattr>.fmt
+# where .fmt gives the desired output format.
+
+if (( $# == 0 ))
+then
+  echo "mkstyles: missing style name argument"
+  exit 1
+fi
+
+TGT=$1                  # x_style.fmt
+STYLE=${1%.*}           # x_style
+FMT=${1#$STYLE.}        # fmt
+F=$STYLE.gv             # x_style.gv
+OBJ=${STYLE%_*}         # x
+STYLE=${STYLE#${OBJ}_}  # style
+
+    exec 3> $F
+
+    echo "digraph G { rankdir=LR" >&3
+case "$OBJ" in
+ c )
+    echo "  fillcolor=greenyellow" >&3
+    echo "  node[style=filled label=\"\"]" >&3
+    if [[ $STYLE == striped ]]
+    then
+        echo "  fillcolor=\"greenyellow:yellow:lightblue\"" >&3
+    fi
+    echo "  subgraph cluster { style=$STYLE 0}" >&3
+  ;;
+ e )
+    echo "  node[ style=filled label=\"\"]" >&3
+    echo "  a -> b [ style=$STYLE ]" >&3
+  ;;
+ n )
+    case "$STYLE" in
+      rounded | diagonals )
+        echo "  node[ shape=box]" >&3
+        ;;
+      striped )
+        echo "  node[ shape=box fillcolor=\"greenyellow:yellow:lightblue\"]" >&3
+        ;;
+      wedged )
+        echo "  node[ fillcolor=\"greenyellow:yellow:lightblue\"]" >&3
+        ;;
+    esac
+    echo "  0 [style=$STYLE label=\"\"]" >&3
+  ;;
+esac
+    echo "}" >&3
+
+    exec 3>&-
+
+    dot -T$FMT $F > $TGT
+    rm -f $F
+
+
diff --git a/doc/infosrc/mktapers.sh b/doc/infosrc/mktapers.sh
new file mode 100755 (executable)
index 0000000..76d8874
--- /dev/null
@@ -0,0 +1,34 @@
+#! /bin/ksh
+#
+# usage: mktapers.sh <taper>
+#
+# where taper has the form <arrowheadattr>_<dirattr>.fmt
+# where .fmt gives the desired output format.
+
+if (( $# == 0 ))
+then
+  echo "mktapers: missing taper name argument"
+  exit 1
+fi
+
+TGT=$1                  # ah_dir.fmt
+TAPER=${1%.*}           # ah_dir
+FMT=${1#$TAPER.}        # fmt
+F=$TAPER.gv             # ah_dir.gv
+AH=${TAPER%_*}          # ah
+DIR=${TAPER#${AH}_}  # dir
+
+    exec 3> $F
+
+    echo "digraph G { rankdir=LR ranksep=1 " >&3
+    echo "  edge [style=tapered penwidth=7 arrowtail=none ]" >&3
+    echo "  node[ style=filled label=\"\" ]" >&3
+    echo "  a -> b [ dir=$DIR arrowhead=$AH ]" >&3
+    echo "}" >&3
+
+    exec 3>&-
+
+    dot -T$FMT $F > $TGT
+#    rm -f $F
+
+
index fae1f25dd649906a54fb699ac7d35407daade656..9b13b2d2dd24ad40d7fd80953f2ed06533cae047 100644 (file)
@@ -98,8 +98,10 @@ Examples:<BR>
  Usually, the same effect can be achieved by setting
  <A HREF=#d:style>style</A> to <TT>invis</TT>.
 :colorList
-A colon-separated list of color values: <I>C</I>(:<I>C</I>)*
- where each <I>C</I> is a <A HREF=#k:color>color</A> value.
+A colon-separated list of weighted color values: <I>WC</I>(:<I>WC</I>)*
+where each <I>WC</I> has the form <I>C(;F)?</I> with C a <A HREF=#k:color>color</A> value
+and the optional <I>F</I> a floating-point number, 0 &le; <I>F</I> &le; 1. The sum of the 
+floating-point numbers in a <TT>colorList</TT> must sum to at most 1.
 <P>
 Depending on the related attribute and graph object, two colors may specify a gradient fill.
 The following table shows some variations of the <TT>yellow:blue</TT> color list depending on the
@@ -327,10 +329,59 @@ Note that whitespace characters are ignored.
 At present, the recognized style names are
 "dashed", "dotted", "solid", "invis" and "bold" for nodes and edges,
 "tapered" for edges only,
-and "filled", "diagonals" and "rounded" for nodes only.
-The styles "filled" and "rounded" are recognized for clusters.
+and "filled", "striped", "wedged", "diagonals" and "rounded" for nodes only.
+The styles "filled", "striped" and "rounded" are recognized for clusters.
 The style "radial" is recognized for nodes, clusters and graphs, and indicates a
 radial-style gradient fill if applicable.
+The style "striped" is recognized for clusters and rectangularly-shaped nodes, and causes the
+fill to be done as a set of vertical stripes. The colors are specified via a <A HREF=#k:colorList>colorList</A>, 
+the colors drawn from left to right in list order. Optional color weights can be specified to indicate the
+proportional widths of the bars. If the sum of the weights is less than 1, the remainder is divided evenly
+among the colors with no weight. 
+The style "wedged" is recognized for elliptically-shaped nodes, and causes the
+fill to be done as a set of wedges. The colors are specified via a <A HREF=#k:colorList>colorList</A>, 
+with the colors drawn counter-clockwise starting at angle 0. Optional color weights are interpreted
+analogously to the striped case described above.
+<P>
+The following tables illustrate some of the effects of the style settings. 
+Examples of tapered line styles are given below.
+Examples of linear and radial gradient fill can be seen under  <A HREF=#k:colorList>colorList</A>.
+<P>
+  <TABLE border=1>
+    <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt><TD align="center"><tt>rounded</tt><TD align="center"><tt>diagonals</tt><TD align="center"><tt>filled</tt><TD align="center"><tt>striped</tt><TD align="center"><tt>wedged</tt></TR>
+    <TR><TD><IMG SRC="n_solid.png"><TD><IMG SRC="n_dashed.png"><TD><IMG SRC="n_dotted.png"><TD><IMG SRC="n_bold.png"><TD><IMG SRC="n_rounded.png"><TD><IMG SRC="n_diagonals.png"><TD><IMG SRC="n_filled.png"><TD><IMG SRC="n_striped.png"><TD><IMG SRC="n_wedged.png"></TR>
+    <CAPTION>Basic style settings for nodes</CAPTION>
+  </TABLE>
+<P>
+  <TABLE border=1>
+    <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt></TR>
+    <TR><TD><IMG SRC="e_solid.png"><TD><IMG SRC="e_dashed.png"><TD><IMG SRC="e_dotted.png"><TD><IMG SRC="e_bold.png"></TR>
+    <CAPTION>Basic style settings for edges</CAPTION>
+  </TABLE>
+<P>
+  <TABLE border=1>
+    <TR><TD align="center"><tt>solid</tt><TD align="center"><tt>dashed</tt><TD align="center"><tt>dotted</tt><TD align="center"><tt>bold</tt><TD align="center"><tt>rounded</tt><TD align="center"><tt>filled</tt><TD align="center"><tt>striped</tt></TR>
+    <TR><TD><IMG SRC="c_solid.png"><TD><IMG SRC="c_dashed.png"><TD><IMG SRC="c_dotted.png"><TD><IMG SRC="c_bold.png"><TD><IMG SRC="c_rounded.png"><TD><IMG SRC="c_filled.png"><TD><IMG SRC="c_striped.png"></TR>
+    <CAPTION>Basic style settings for clusters</CAPTION>
+  </TABLE>
+<P>
+The effect of <tt>style=tapered</tt> depends on the <A HREF=#d:penwidth>penwidth</A>,
+<A HREF=#d:dir>dir</A>, <A HREF=#d:arrowhead>arrowhead</A> and <A HREF=#d:arrowtail>arrowtail</A> attributes.
+The edge starts with width <tt>penwidth</tt> and tapers to width 1, in points. The <tt>dir</tt> attribute
+determines whether the tapering goes from tail to head (<tt>dir=forward</tt>), from head to 
+tail (<tt>dir=forward</tt>), from the middle to both the head and tail (<tt>dir=both</tt>), or no
+tapering at all (<tt>dir=none</tt>). If the <tt>dir</tt> is not explicitly set, the default for the
+graph type is used (see <A HREF=#a:dir>dir</A>). Arrowheads and arrowtails are also drawn, based on the
+value of <tt>dir</tt>; to avoid this, set <tt>arrowhead</tt> and/or <TT>arrowtail</TT> to <TT>"none"</TT>.
+<P>
+The following table illustrates the <tt>style=tapered</tt> with <tt>penwidth=7</tt> and
+<tt>arrowtail=none</tt>.
+  <TABLE border=1>
+    <TR><TD><tt>arrowhead</tt> &#92; <tt>dir</tt><TD align="center"><tt>forward</tt><TD align="center"><tt>back</tt><TD align="center"><tt>both</tt><TD align="center"><tt>none</tt></TR>
+    <TR><TD><tt>normal</tt><TD><IMG SRC="normal_forward.png"><TD><IMG SRC="normal_back.png"><TD><IMG SRC="normal_both.png"><TD><IMG SRC="normal_none.png"></TR>
+    <TR><TD><tt>none</tt><TD><IMG SRC="none_forward.png"><TD><IMG SRC="none_back.png"><TD><IMG SRC="none_both.png"><TD><IMG SRC="none_none.png"></TR>
+  </TABLE>
+<P>
 Additional styles are available in
 device-dependent form. Style lists are passed to device drivers, which
 can use this to generate appropriate output.