<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>
<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>
<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>
<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
<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
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>
<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 ≤ <I>F</I> ≤ 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
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> \ <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.
#
# 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.
#
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 \
$(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
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 \
: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,
: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
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>
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)
char* s = p;
while (!isspace ((c = *p)) && (c != '\0')) p++;
- yylval.str = strndup (s, p-s);
+ yylval.str = mystrndup (s, p-s);
return p;
}
--- /dev/null
+#! /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
+
+
--- /dev/null
+#! /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
+
+
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 ≤ <I>F</I> ≤ 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
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> \ <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.