diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua | 281 |
1 files changed, 135 insertions, 146 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua index 10f5ecdf471..1890fa4f39d 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua @@ -27,7 +27,7 @@ -- you can specify that the line from a certain vertex to another -- vertex should have a certain slope. How these vertices and slopes -- are specified in explained momentarily. Second, you can specify a --- so-called ``growth direction'' for trees. +-- so-called ``growth direction'' for trees. -- -- @end @@ -48,42 +48,40 @@ declare { type = "direction", default = 0, - summary = [[" - This key specifies that the straight line from the |orient tail| to - the |orient head| should be at an angle of \meta{direction} relative to - the right-going $x$-axis. Which vertices are used as tail an head - depends on where the |orient| option is encountered: When used with - an edge, the tail is the edge's tail und the head is the edge's - head. When used with a node, the tail or the head must be specified - explicitly and the node is used as the node missing in the - specification. When used with a graph as a whole, both the head and - tail nodes must be specified explicitly. + summary = [[" + This key specifies that the straight line from the |orient tail| to + the |orient head| should be at an angle of \meta{direction} relative to + the right-going $x$-axis. Which vertices are used as tail an head + depends on where the |orient| option is encountered: When used with + an edge, the tail is the edge's tail and the head is the edge's + head. When used with a node, the tail or the head must be specified + explicitly and the node is used as the node missing in the + specification. When used with a graph as a whole, both the head and + tail nodes must be specified explicitly. "]], documentation = [[" - Note that the \meta{direction} is independent of the actual to-path - of an edge, which might define a bend or more complicated shapes. For - instance, a \meta{angle} of |45| requests that the end node is ``up - and right'' relative to the start node. - - You can also specify the standard direction texts |north| or |south east| - and so forth as \meta{direction} and also |up|, |down|, |left|, and |right|. Also, you - can specify |-| for ``right'' and \verb!|! for ``down.'' - "]], - examples = { - [[" - \tikz \graph [spring layout] - { - a -- { b, c, d, e -- {f, g, h} }; - h -- [orient=30] a; - }; - "]], - [[" - \tikz \graph [spring layout] - { - a -- { b, c, d[> orient=right], e -- {f, g, h} }; - h -- a; - }; - "]] + Note that the \meta{direction} is independent of the actual to-path + of an edge, which might define a bend or more complicated shapes. For + instance, a \meta{angle} of |45| requests that the end node is ``up + and right'' relative to the start node. + + You can also specify the standard direction texts |north| or |south east| + and so forth as \meta{direction} and also |up|, |down|, |left|, and + |right|. Also, you can specify |-| for ``right'' and \verb!|! for ``down''. + "]], + examples = {[[" + \tikz \graph [spring layout] + { + a -- { b, c, d, e -- {f, g, h} }; + h -- [orient=30] a; + }; + "]],[[" + \tikz \graph [spring layout] + { + a -- { b, c, d[> orient=right], e -- {f, g, h} }; + h -- a; + }; + "]] } } @@ -95,16 +93,16 @@ declare { type = "direction", default = 0, - summary = [[" - Same as |orient|, only the rest of the graph should be - flipped relative to the connection line. + summary = [[" + Same as |orient|, only the rest of the graph should be + flipped relative to the connection line. "]], examples = [[" - \tikz \graph [spring layout] - { - a -- { b, c, d[> orient'=right], e -- {f, g, h} }; - h -- a; - }; + \tikz \graph [spring layout] + { + a -- { b, c, d[> orient'=right], e -- {f, g, h} }; + h -- a; + }; "]] } @@ -114,26 +112,24 @@ declare { key = "orient tail", type = "string", - summary = [[" - Specifies the tail vertex for the orientation of a graph. See - |orient| for details. + summary = [[" + Specifies the tail vertex for the orientation of a graph. See + |orient| for details. "]], - examples = { - [[" - \tikz \graph [spring layout] { - a [orient=|, orient tail=f] -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; - "]], - [[" - \tikz \graph [spring layout] { - a [orient=down, orient tail=h] -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; - "]] + examples = {[[" + \tikz \graph [spring layout] { + a [orient=|, orient tail=f] -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; + "]],[[" + \tikz \graph [spring layout] { + a [orient=down, orient tail=h] -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; + "]] } } - + @@ -144,23 +140,21 @@ declare { key = "orient head", type = "string", - summary = [[" - Specifies the head vertex for the orientation of a graph. See - |orient| for details. + summary = [[" + Specifies the head vertex for the orientation of a graph. See + |orient| for details. "]], - examples = { - [[" - \tikz \graph [spring layout] - { - a [orient=|, orient head=f] -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; - "]], - [[" - \tikz \graph [spring layout] { a -- b -- c -- a }; - \tikz \graph [spring layout, orient=10, - orient tail=a, orient head=b] { a -- b -- c -- a }; - "]] + examples = {[[" + \tikz \graph [spring layout] + { + a [orient=|, orient head=f] -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; + "]],[[" + \tikz \graph [spring layout] { a -- b -- c -- a }; + \tikz \graph [spring layout, orient=10, + orient tail=a, orient head=b] { a -- b -- c -- a }; + "]] } } @@ -170,17 +164,17 @@ declare { key = "horizontal", type = "string", - summary = [[" - A shorthand for specifying |orient tail|, |orient head| and - |orient=0|. The tail will be everything before the part ``| to |'' - and the head will be everything following it. + summary = [[" + A shorthand for specifying |orient tail|, |orient head| and + |orient=0|. The tail will be everything before the part ``| to |'' + and the head will be everything following it. "]], - examples = [[" - \tikz \graph [spring layout] { a -- b -- c -- a }; - \tikz \graph [spring layout, horizontal=a to b] { a -- b -- c -- a }; + examples = [[" + \tikz \graph [spring layout] { a -- b -- c -- a }; + \tikz \graph [spring layout, horizontal=a to b] { a -- b -- c -- a }; "]] } - + @@ -190,11 +184,11 @@ declare { key = "horizontal'", type = "string", - summary = [[" - Like |horizontal|, but with a flip. + summary = [[" + Like |horizontal|, but with a flip. "]] } - + @@ -207,16 +201,15 @@ declare { key = "vertical", type = "string", - summary = [[" - A shorthand for specifying |orient tail|, |orient head| and - |orient=-90|. + summary = [[" + A shorthand for specifying |orient tail|, |orient head| and |orient=-90|. "]], examples = [[" - \tikz \graph [spring layout] { a -- b -- c -- a }; - \tikz \graph [spring layout, vertical=a to b] { a -- b -- c -- a }; + \tikz \graph [spring layout] { a -- b -- c -- a }; + \tikz \graph [spring layout, vertical=a to b] { a -- b -- c -- a }; "]] } - + @@ -227,8 +220,8 @@ declare { key = "vertical'", type = "string", - summary = [[" - Like |vertical|, but with a flip. + summary = [[" + Like |vertical|, but with a flip. "]] } @@ -240,54 +233,50 @@ declare { key = "grow", type = "direction", - summary = [[" - This key specifies in which direction the neighbors of a node - ``should grow.'' For some graph drawing algorithms, especially for - those that layout trees, but also for those that produce layered - layouts, there is a natural direction in which the ``children'' of - a node should be placed. For instance, saying |grow=down| will cause - the children of a node in a tree to be placed in a left-to-right - line below the node (as always, you can replace the \meta{angle} - by direction texts). The children are requested to be placed in a - counter-clockwise fashion, the |grow'| key will place them in a - clockwise fashion. + summary = [[" + This key specifies in which direction the neighbors of a node + ``should grow''. For some graph drawing algorithms, especially for + those that layout trees, but also for those that produce layered + layouts, there is a natural direction in which the ``children'' of + a node should be placed. For instance, saying |grow=down| will cause + the children of a node in a tree to be placed in a left-to-right + line below the node (as always, you can replace the \meta{angle} + by direction texts). The children are requested to be placed in a + counter-clockwise fashion, the |grow'| key will place them in a + clockwise fashion. "]], - documentation = [[" - Note that when you say |grow=down|, it is not necessarily the case - that any particular node is actually directly below the current - node; the key just requests that the direction of growth is - downward. - - In principle, you can specify the direction of growth for each node - individually, but do not count on graph drawing algorithms to - honour these wishes. - - When you give the |grow=right| key to the graph as a whole, it will - be applied to all nodes. This happens to be exactly what you want: + documentation = [[" + Note that when you say |grow=down|, it is not necessarily the case + that any particular node is actually directly below the current + node; the key just requests that the direction of growth is downward. + + In principle, you can specify the direction of growth for each node + individually, but do not count on graph drawing algorithms to + honor these wishes. + + When you give the |grow=right| key to the graph as a whole, it will + be applied to all nodes. This happens to be exactly what you want: "]], - examples = { - [[" - \tikz \graph [layered layout, sibling distance=5mm] - { - a [grow=right] -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; - "]], - [[" - \tikz \graph [layered layout, grow=right, sibling distance=5mm] - { - a -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; - "]], - [[" - \tikz - \graph [layered layout, grow=-80] - { - {a,b,c} --[complete bipartite] {e,d,f} - --[complete bipartite] {g,h,i}; - }; - "]] + examples = {[[" + \tikz \graph [layered layout, sibling distance=5mm] + { + a [grow=right] -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; + "]],[[" + \tikz \graph [layered layout, grow=right, sibling distance=5mm] + { + a -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; + "]],[[" + \tikz + \graph [layered layout, grow=-80] + { + {a,b,c} --[complete bipartite] {e,d,f} + --[complete bipartite] {g,h,i}; + }; + "]] } } @@ -300,11 +289,11 @@ declare { summary = "Same as |grow|, only with the children in clockwise order.", examples = [[" - \tikz \graph [layered layout, sibling distance=5mm] - { - a [grow'=right] -- { b, c, d, e -- {f, g, h} }; - { h, g } -- a; - }; + \tikz \graph [layered layout, sibling distance=5mm] + { + a [grow'=right] -- { b, c, d, e -- {f, g, h} }; + { h, g } -- a; + }; "]] } |