diff options
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.lua | 53 |
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 |