summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
committerKarl Berry <karl@freefriends.org>2019-04-04 20:55:44 +0000
commitacab24042d34dd439e1d074820d1da2fa1d591cd (patch)
tree32881f869e20a69711c5fe86134aa48143d9b1e8 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
parent93f5c4643a3d0a596d220ff14756ce68d99afe33 (diff)
pgf (4apr19)
git-svn-id: svn://tug.org/texlive/trunk@50758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua37
1 files changed, 22 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
index 2d8317bd72d..c7adfab830e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
@@ -30,6 +30,7 @@ documentation
Now, when you set this key for a single node of a graph,
then, by shifting the graph around, this ``wish'' can obviously
always be fulfill:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -39,6 +40,7 @@ always be fulfill:
};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -48,6 +50,7 @@ always be fulfill:
};
\end{tikzpicture}
\end{codeexample}
+%
Since the key's name is a bit long and since the many braces and
parentheses are a bit cumbersome, there is a special support for
this key inside a |graph|: The standard |/tikz/at| key is redefined
@@ -57,6 +60,7 @@ specify an |at| position for a node whose position it to be computed
by a graph drawing algorithm.) A nice side effect of this is that
you can use the |x| and |y| keys (see
Section~\ref{section-graphs-xy}) to specify desired positions:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -66,6 +70,7 @@ Section~\ref{section-graphs-xy}) to specify desired positions:
};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -75,7 +80,7 @@ Section~\ref{section-graphs-xy}) to specify desired positions:
};
\end{tikzpicture}
\end{codeexample}
-
+
A problem arises when two or more nodes have this key set, because
then your ``desires'' for placement and the positions computed by
the graph drawing algorithm may clash. Graph drawing algorithms are
@@ -83,10 +88,10 @@ the graph drawing algorithm may clash. Graph drawing algorithms are
ignore these desired positions since they will be taken care of in
the so-called post-anchoring phase, see below. However, for some
algorithms it makes a lot of sense to fix the positions of some
-nodes and only compute the positions
-of the other nodes relative to these nodes. For instance, for a
-|spring layout| it makes perfect sense that some nodes are
-``nailed to the canvas'' while other nodes can ``move freely''.
+nodes and only compute the positions of the other nodes relative
+to these nodes. For instance, for a |spring layout| it makes perfect
+sense that some nodes are ``nailed to the canvas'' while other
+nodes can ``move freely''.
]]
example
@@ -134,19 +139,21 @@ key "anchor node"
summary
[[
This option can be used with a graph to specify a node that
-should be used for anchoring the whole graph.
+should be used for anchoring the whole graph.
]]
documentation
[[
When this option is specified, after the layout has been computed, the
whole graph will be shifted in such a way that the \meta{node name} is
-either
+either
+%
\begin{itemize}
-\item at the current value of |anchor at| or
-\item at the position that is specified in the form of a
- |desired at| for the \meta{node name}.
+ \item at the current value of |anchor at| or
+ \item at the position that is specified in the form of a
+ |desired at| for the \meta{node name}.
\end{itemize}
+%
Note how in the last example |c| is placed at |(1,1)| rather than
|b| as would happen by default.
]]
@@ -163,7 +170,7 @@ example
[[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
-
+
\graph [layered layout, anchor node=c, edges=rounded corners]
{ a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a};
\end{tikzpicture}
@@ -178,15 +185,15 @@ key "anchor at"
summary
[[
-The coordinate at which the graph should be anchored when no
-explicit anchor is given for any node. The initial value is the origin.
+The coordinate at which the graph should be anchored when no
+explicit anchor is given for any node. The initial value is the origin.
]]
example
[[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
-
+
\graph [layered layout, edges=rounded corners, anchor at={(1,2)}]
{ a -- {b, c [anchor here] } -- d -- a};
\end{tikzpicture}
@@ -216,7 +223,7 @@ example
[[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
-
+
\graph [layered layout, edges=rounded corners]
{ a -- {b, c [anchor here] } -- d -- a};
\end{tikzpicture}