summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua58
2 files changed, 36 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
index 7d34726f47b..1f68bd99f5f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
@@ -17,7 +17,7 @@
-- vertex positioning algorithms from the choice of edge routing
-- algorithm. For instance, for a simple necklace routing, it is
-- unclear whether the edges on the necklace should be routing ``along
--- the necklace'' or not. Thus, necklace routing algorithms will
+-- the necklace'' or not. Thus, necklace routing algoirthms will
-- ``hint'' that a necklace is present and only when the
-- |necklace routing| algorithm is selected will these hints lead to
-- actual bending of edges.
@@ -47,14 +47,14 @@ local necklaces = Storage.new()
-- Adds a necklace hint. In this case, the hint indicates that the
-- given sequence of vertices lie on a circle.
--
--- The idea is that an algorithm may specify that in a
--- given graph certain sequences of nodes form a ``necklace'', which
+-- The idea is that an algorithm may specify that in a
+-- given graph certain sequences of nodes form a ``necklace,'' which
-- is typically a circle. There may be more than one necklace inside a
--- given graph. For each necklace,
+-- given graph. For each necklace,
-- whenever an arc connects subsequent nodes on the necklace, they get
-- bend in such a way that they lie follow the path of the
-- necklace. If an arc lies on more than one necklace, the ``last one
--- wins''.
+-- wins.''
--
-- @param ugraph The ugraph to which this hint is added
-- @param necklace The sequence of vertices that form the necklace. If
@@ -68,7 +68,7 @@ local necklaces = Storage.new()
function Hints.addNecklaceCircleHint(ugraph, necklace, center, clockwise)
local a = necklaces[ugraph] or {}
necklaces[ugraph] = a
-
+
a[#a+1] = {
necklace = necklace,
center = center or Coordinate.origin,
@@ -95,6 +95,6 @@ function Hints.getNecklaceHints(ugraph)
end
-- done
-
+
return Hints
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
index defcf9f8c61..9a99ea2275f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
@@ -35,28 +35,28 @@ declare {
summary = "Bends all edges of a graph that lie on ``necklaces'' along these necklaces.",
documentation = [["
- Some graph drawing algorithms lay out some or all nodes along a
- path, which is then called a \emph{necklace}. For instance, the
- |simple necklace layout| places all nodes on a circle and that
- circle is the ``necklace''. When the |necklace routing| edge
- routing algorithm is selected, all edges that connect subsequent
- nodes on such a necklace are bend in such a way that the
- ``follow the necklace path''. In the example case, this will
- cause all edges that connect adjacent nodes to become arcs on
- of the circle on which the nodes lie.
-
- Note that local edge routing options for an edge may overrule
- the edge routing computed by the algorithm as in the edge from 6
- to 7 in the example.
+ Some graph drawing algorithms lay out some or all nodes along a
+ path, which is then called a \emph{necklace.} For instance, the
+ |simple necklace layout| places all nodes on a circle and that
+ circle is the ``necklace.'' When the |necklace rounting| edge
+ routing algorithm is selected, all edges that connect subsequent
+ nodes on such a necklace are bend in such a way that the
+ ``follow the necklace path.'' In the example case, this will
+ cause all edges that connect adjacent nodes to become arcs on
+ of the circle on which the nodes lie.
+
+ Note that local edge routing options for an edge may overrule
+ the edge routing computed by the algorithm as in the edge from 6
+ to 7 in the example.
"]],
-
+
examples = [["
- \tikz \graph [simple necklace layout, node distance=1.5cm,
- necklace routing,
- nodes={draw,circle}, edges={>={Stealth[round,sep,bend]}}]
- { 1 -> 2 [minimum size=30pt] <- 3 <-> 4 --
- 5 -- 6 -- [bend left] 7 -- 1 -- 4 };
- "]]
+ \tikz \graph [simple necklace layout, node distance=1.5cm,
+ necklace routing,
+ nodes={draw,circle}, edges={>={Stealth[round,sep,bend]}}]
+ { 1 -> 2 [minimum size=30pt] <- 3 <-> 4 --
+ 5 -- 6 -- [bend left] 7 -- 1 -- 4 };
+ "]]
}
@@ -65,19 +65,19 @@ declare {
function NecklaceRouting:run()
local ugraph = self.ugraph
-
+
for _,entry in ipairs(Hints.getNecklaceHints(ugraph)) do
assert (entry.center) -- no other necklace types, yet
local prev
for _,vertex in ipairs(entry.necklace) do
if prev then
- local a = ugraph:arc(prev, vertex)
- if a then
- local p = Path.new()
- p:appendMoveto(a.tail.pos:clone())
- p:appendArcTo(a.head.pos:clone(), entry.center, entry.clockwise)
- a.path = p
- end
+ local a = ugraph:arc(prev, vertex)
+ if a then
+ local p = Path.new()
+ p:appendMoveto(a.tail.pos:clone())
+ p:appendArcTo(a.head.pos:clone(), entry.center, entry.clockwise)
+ a.path = p
+ end
end
prev = vertex
end
@@ -87,4 +87,4 @@ end
-- done
-return NecklaceRouting
+return NecklaceRouting \ No newline at end of file