summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-12 20:23:02 +0000
committerKarl Berry <karl@freefriends.org>2019-05-12 20:23:02 +0000
commit22cbaf8cd711b82b3fe4b387a7e72b58409ecdbd (patch)
tree0b785b59273566c030b567add8671b7f06167054 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
parent692a797099b0acfd35d4bbd6a322acdc87c2c3a8 (diff)
pgf
git-svn-id: svn://tug.org/texlive/trunk@51107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua53
1 files changed, 27 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
index 8eb9d7d7019..c22c4decf22 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
@@ -31,33 +31,34 @@ declare {
algorithm = SimpleEdgeDemo,
summary = "This algorithm shows how edges can be created by an algorithm.",
- documentation = [["
- For its job, the algorithm uses the function |createEdge|, which can be
- called during the run of the algorithm to create edges in the
- syntactic graph. The algorithm first does exactly the same as the
- simple demo layout, then it creates an edge for every node where the
- |new edge to| option is set. You will see in the code how this
- option is declared and how we use it to look up a vertex in the
- graph by its name.
-
+ documentation = [["
+ For its job, the algorithm uses the function |createEdge|, which can be
+ called during the run of the algorithm to create edges in the
+ syntactic graph. The algorithm first does exactly the same as the
+ simple demo layout, then it creates an edge for every node where the
+ |new edge to| option is set. You will see in the code how this
+ option is declared and how we use it to look up a vertex in the
+ graph by its name.
+ %
\begin{codeexample}[]
\tikz [simple edge demo layout]
\graph [radius=2cm] {
a, b, c, d, e, f;
-
+
e -> [red] f; % normal edge
-
+
% Edges generated by the algorithm:
- a[new edge to=b];
+ a[new edge to=b];
b[new edge to=d];
c[new edge to=f];
};
\end{codeexample}
-
- And the algorithm:
+
+ And the algorithm:
+ %
\begin{codeexample}[code only, tikz syntax=false]
-- File pgf.gd.examples.SimpleEdgeDemo
-
+
-- Imports
local InterfaceToAlgorithms = require "pgf.gd.interface.InterfaceToAlgorithms"
local declare = InterfaceToAlgorithms.declare
@@ -71,9 +72,9 @@ declare {
summary = "This algorithm shows...",
}
\end{codeexample}
-
- Next comes the declaration of the new option |new edge to|:
-
+
+ Next comes the declaration of the new option |new edge to|:
+ %
\begin{codeexample}[code only, tikz syntax=false]
declare {
key = "new edge to",
@@ -81,9 +82,9 @@ declare {
summary = "This option takes the name of a vertex..."
}
\end{codeexample}
-
- Finally, the algorithm's code:
-
+
+ Finally, the algorithm's code:
+ %
\begin{codeexample}[code only, tikz syntax=false]
function SimpleEdgeDemo:run()
-- As in a SimpleDemo:
@@ -108,15 +109,15 @@ declare {
key = "new edge to",
type = "string",
- summary = [["
- This option takes the name of a vertex. An edge leading to this
- vertex is added to the syntactic digraph.
- "]]
+ summary = [["
+ This option takes the name of a vertex. An edge leading to this
+ vertex is added to the syntactic digraph.
+ "]]
}
function SimpleEdgeDemo:run()
-
+
-- As in a SimpleDemo:
local g = self.digraph
local alpha = (2 * math.pi) / #g.vertices