diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
commit | 8876a8021514f190d676e4e5261f1084a66754d3 (patch) | |
tree | 9a496107a312a1acbbdb06ea0e1657c285109729 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua | |
parent | 693eacf895c01285e2992460bb489142ead8ae8a (diff) |
pgf (19dec19)
git-svn-id: svn://tug.org/texlive/trunk@53187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua')
13 files changed, 107 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua index 0bd9090a1c1..9198885965d 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua @@ -14,7 +14,6 @@ local documentation = require 'pgf.gd.doc'.documentation local summary = require 'pgf.gd.doc'.summary local example = require 'pgf.gd.doc'.example - -------------------------------------------------------------------- key "simple necklace layout" @@ -45,8 +44,10 @@ clockwise). The order of the nodes is the order in which they appear in the graph, the edges are not taken into consideration, unless the |componentwise| option is given. % -\begin{codeexample}[] -\tikz[>=spaced stealth'] +\begin{codeexample}[ + preamble={\usetikzlibrary{arrows.meta,graphs,graphdrawing} + \usegdlibrary{circular}}] +\tikz[>={Stealth[round,sep]}] \graph [simple necklace layout, grow'=down, node sep=1em, nodes={draw,circle}, math nodes] { @@ -60,14 +61,16 @@ decomposed into connected components, which are then laid out individually and packed using the usual component packing mechanisms: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{circular}}] \tikz \graph [simple necklace layout] { a -- b -- c -- d -- a, 1 -- 2 -- 3 -- 1 }; \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{circular}}] \tikz \graph [simple necklace layout, componentwise] { a -- b -- c -- d -- a, 1 -- 2 -- 3 -- 1 @@ -78,7 +81,7 @@ The nodes are placed in such a way that % \begin{enumerate} \item The (angular) distance between the centers of consecutive - nodes is at least |node distance|, + nodes is at least |node distance|, \item the distance between the borders of consecutive nodes is at least |node sep|, and \item the radius is at least |radius|. diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua index 5e5b0635bf4..72a82be978a 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua @@ -47,7 +47,6 @@ local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare -- -- @end - --- declare { @@ -86,7 +85,8 @@ declare { the first node of the component encountered during specification of the component. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component align=first node] { a, b -- c, d -- e[second] -- f }; @@ -99,13 +99,15 @@ declare { between the maximum and minimum value that the projected nodes have on the shift line. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component align=center] { a, b -- c, d -- e[second] -- f }; \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component direction=90, component align=center] @@ -119,13 +121,15 @@ declare { through the center of the node whose center has the highest projected value. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component align=counterclockwise] { a, b -- c, d -- e[second] -- f }; \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component direction=90, component align=counterclockwise] @@ -138,13 +142,15 @@ declare { Works like |counterclockwise|, only in the other direction: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component align=clockwise] { a, b -- c, d -- e[second] -- f }; \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [binary tree layout, nodes={draw}, component direction=90, component align=clockwise] @@ -160,7 +166,8 @@ declare { packing, this means that the components are aligned so that the bounding boxes of the components are aligned at the top. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, nodes={draw, align=center}, component sep=0pt, component align=counterclockwise] @@ -211,8 +218,8 @@ declare { summary = [[" Like |components go right top aligned|, but with - |component align| set to |counterclockwise| |bounding box|. - This means that the components will be aligned with their bounding + |component align| set to |counterclockwise| |bounding box|. + This means that the components will be aligned with their bounding boxed being top-aligned. "]], examples = [[" @@ -530,4 +537,4 @@ declare { -return Components
\ No newline at end of file +return Components diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua index 7ba4d000a7a..a2d04a178f5 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua @@ -23,7 +23,6 @@ local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare -- -- @end - --- declare { @@ -42,7 +41,8 @@ declare { are then shifted such that the padding (separating distance) between the two boxes is the current value of |component sep|. % - \begin{codeexample}[] + \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, nodes={draw}, component sep=0pt, component packing=rectangular] { a -- long text, longer text -- b}; @@ -60,7 +60,8 @@ declare { padding |component sep| can be used to avoid the nodes actually touching each other. % - \begin{codeexample}[] + \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, nodes={draw}, component sep=0pt, level distance=1.5cm, component packing=skyline] @@ -89,7 +90,8 @@ declare { which the line was moved. This means that the holes are ``filled up by slanted roofs''. % - \begin{codeexample}[] + \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \begin{tikzpicture} \graph [tree layout, nodes={draw}, component sep=0pt, component packing=skyline] @@ -103,4 +105,4 @@ declare { } -return Components
\ No newline at end of file +return Components 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 c7adfab830e..19bfd52fdf8 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 @@ -31,7 +31,8 @@ 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{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{force}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] @@ -41,7 +42,8 @@ always be fulfill: \end{tikzpicture} \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{force}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] @@ -61,7 +63,8 @@ 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{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{force}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [spring layout] @@ -71,7 +74,8 @@ Section~\ref{section-graphs-xy}) to specify desired positions: \end{tikzpicture} \end{codeexample} % -\begin{codeexample}[] +\begin{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{layered}}] \begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \graph [layered layout] @@ -94,6 +98,11 @@ sense that some nodes are ``nailed to the canvas'' while other nodes can ``move freely''. ]] +--[[ +% TODOsp: codeexamples: the following 3 examples need these libraries +% \usetikzlibrary{graphs,graphdrawing} +% \usegdlibrary{force} +--]] example [[ \begin{tikzpicture} @@ -158,6 +167,11 @@ Note how in the last example |c| is placed at |(1,1)| rather than |b| as would happen by default. ]] +--[[ +% TODOsp: codeexamples: the following 4 examples need these libraries +% \usetikzlibrary{graphs,graphdrawing} +% \usegdlibrary{layered} +--]] example [[ \tikz \draw (0,0) diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua index b7bab378191..fcd5b26fb00 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua @@ -48,7 +48,7 @@ example [[ \tikz [nodes={text height=.7em, text depth=.2em, draw=black!20, thick, fill=white, font=\footnotesize}, - >=spaced stealth', rounded corners, semithick] + >={Stealth[round,sep]}, rounded corners, semithick] \graph [FMMMLayout, node sep=1mm, variation=2] { "5th Edition" -> { "6th Edition", "PWB 1.0" }; "6th Edition" -> { "LSX", "1 BSD", "Mini Unix", "Wollongong", "Interdata" }; @@ -126,4 +126,4 @@ example -- Local Variables: -- mode:latex --- End:
\ No newline at end of file +-- End: diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua index ab9d9ee77f7..ec75fa7e6e2 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua @@ -50,7 +50,7 @@ example [[ \tikz [nodes={text height=.7em, text depth=.2em, draw=black!20, thick, fill=white, font=\footnotesize}, - >=spaced stealth', rounded corners, semithick] + >={Stealth[round,sep]}, rounded corners, semithick] \graph [SugiyamaLayout, FastSimpleHierarchyLayout, grow=-80, level distance=1.5cm, sibling distance=7mm] { "5th Edition" -> { "6th Edition", "PWB 1.0" }; @@ -110,4 +110,4 @@ documentation [[ -- Local Variables: -- mode:latex --- End:
\ No newline at end of file +-- End: 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 c22c4decf22..3ff5f4ea230 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 @@ -40,7 +40,8 @@ declare { option is declared and how we use it to look up a vertex in the graph by its name. % -\begin{codeexample}[] +\begin{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{examples}}] \tikz [simple edge demo layout] \graph [radius=2cm] { a, b, c, d, e, f; @@ -140,4 +141,4 @@ function SimpleEdgeDemo:run() end end -return SimpleEdgeDemo
\ No newline at end of file +return SimpleEdgeDemo diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua index f81abf11058..6aa9bffb724 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua @@ -51,7 +51,8 @@ declare { HuffmanNode/.style={/tikz/.cd,circle,inner sep=0pt,outer sep=0pt,draw,minimum size=3pt} } -\begin{codeexample}[] +\begin{codeexample}[preamble={ \usetikzlibrary{graphs,graphdrawing,quotes} + \usegdlibrary{examples}}] \tikz \graph [simple Huffman layout, level distance=7mm, sibling distance=8mm, grow'=up] { @@ -178,6 +179,7 @@ function SimpleHuffman:run() % Ok, we are mainly done now. Finish by computing vertical placements and do formal cleanup. + % \begin{codeexample}[code only, tikz syntax=false] layered.arrange_layers_by_baselines(layers, self.adjusted_bb, self.ugraph) end @@ -282,4 +284,4 @@ function SimpleHuffman:run() layered.arrange_layers_by_baselines(layer, self.adjusted_bb, self.ugraph) end -return SimpleHuffman
\ No newline at end of file +return SimpleHuffman diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua index 45b9c9ef55e..71005d85274 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua @@ -26,13 +26,15 @@ local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare -- The following examples shows how a simple graph can be scaled by -- changing the |node distance|: -- % --- \begin{codeexample}[] +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{force}}] -- \tikz \graph [spring layout, node distance=7mm] { subgraph C_n[n=3] }; -- \tikz \graph [spring layout] { subgraph C_n[n=3] }; -- \tikz \graph [spring layout, node distance=15mm]{ subgraph C_n[n=3] }; -- \end{codeexample} -- % --- \begin{codeexample}[] +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{force}}] -- \tikz \graph [spring electrical layout, node distance=0.7cm] { subgraph C_n[n=3] }; -- \tikz \graph [spring electrical layout] { subgraph C_n[n=3] }; -- \tikz \graph [spring electrical layout, node distance=1.5cm] { subgraph C_n[n=3] }; @@ -41,7 +43,6 @@ local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare -- @end - --- declare { @@ -56,5 +57,3 @@ declare { the nodes they connect. "]] } - - diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua index 269b81a3d7c..85a64b0a5a6 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua @@ -14,8 +14,6 @@ local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare - - --- -- @section subsubsection {Start Configuration} -- @@ -23,19 +21,21 @@ local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare -- random distribution of the vertices. You can influence it by -- changing the |random seed|: -- % ---\begin{codeexample}[] ---\tikz \graph [random seed=10, spring layout] { --- a -- {b, c, d} -- e -- f -- {g,h} -- {a,b,e}; ---}; ---\end{codeexample} +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{force}}] +-- \tikz \graph [random seed=10, spring layout] { +-- a -- {b, c, d} -- e -- f -- {g,h} -- {a,b,e}; +-- }; +-- \end{codeexample} -- % ---\begin{codeexample}[] ---\tikz \graph [random seed=11, spring layout] { --- a -- {b, c, d} -- e -- f -- {g,h} -- {a,b,e}; ---}; ---\end{codeexample} +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{force}}] +-- \tikz \graph [random seed=11, spring layout] { +-- a -- {b, c, d} -- e -- f -- {g,h} -- {a,b,e}; +-- }; +-- \end{codeexample} -- -- Other methods, like a planar preembedding, are not implemented -- currently. -- --- @end
\ No newline at end of file +-- @end diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua index 5af36428858..815f90d268e 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua @@ -13,7 +13,6 @@ --- -- @section subsection {Specifying Missing Children} --- -- \label{section-gd-missing-children} -- -- In the present section we discuss keys for specifying missing children @@ -38,7 +37,8 @@ -- \item When you use the |child| syntax, you can use the |missing| key -- with the |child| command to indicate a missing child: -- % --- \begin{codeexample}[] +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{trees}}] -- \tikz [binary tree layout, level distance=5mm] -- \node {a} -- child { node {b} @@ -57,7 +57,8 @@ -- which really must be completely empty and may not even contain a -- slash, to indicate a missing node: -- % --- \begin{codeexample}[] +-- \begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{trees}}] -- \tikz [binary tree layout, level distance=5mm] -- \graph { a -> { b -> c -> d, e -> { , f -> { , g} } } }; -- \end{codeexample} diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua index 8951ce0538c..dacf6348652 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua @@ -35,14 +35,17 @@ -- Selects the (sub)algorithm that is to be used for computing spanning -- trees whenever this is requested by a tree layout algorithm. The -- default algorithm is |breadth first spanning tree|. --- ---\begin{codeexample}[] +--% +--\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{trees}}] --\tikz \graph [tree layout, breadth first spanning tree] --{ -- 1 -- {2,3,4,5} -- 6; --}; --\end{codeexample} ---\begin{codeexample}[] +--% +--\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} +-- \usegdlibrary{trees}}] --\tikz \graph [tree layout, depth first spanning tree] --{ -- 1 --[bend right] {2,3,4,5 [>bend left]} -- 6; diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua index 169c7ff5e19..a44fd470317 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua @@ -83,7 +83,8 @@ When the subtrees of the children of a node are arranged, each position with a missing child is treated as if a zero-width, zero-height subtree were present at that positions: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz [tree layout, nodes={draw,circle}] \node {r} child { node {a} @@ -95,7 +96,8 @@ zero-height subtree were present at that positions: % or in |graph| syntax: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, nodes={draw,circle}] { r -> { @@ -109,7 +111,8 @@ or in |graph| syntax: % More than one child can go missing: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, nodes={draw,circle}, sibling sep=0pt] { r -> { a, , ,b -> {c,d}, ,e} }; \end{codeexample} @@ -122,7 +125,8 @@ root node, they are usually \emph{not} considered as part of the key ensures that |b|, |c|, |e|, and |f| all have a missing right child): % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, minimum number of children=2, nodes={draw,circle}] { a -> { b -> c -> d, e -> f -> g } }; @@ -136,7 +140,8 @@ Br\"uggemann-Klein and Wood have proposed an extension of the Reingold--Tilford method that is intended to better highlight the overall structure of a tree. Consider the following two trees: % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz [baseline=(a.base), tree layout, minimum number of children=2, sibling distance=5mm, level distance=5mm] \graph [nodes={circle, inner sep=0pt, minimum size=2mm, fill, as=}]{ @@ -165,7 +170,8 @@ minimum distance is encountered on any level other than the first level. Thus, in the first example there is no significant pair, while in the second example |a| and |b| form such a pair. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{graphs,graphdrawing} + \usegdlibrary{trees}}] \tikz \graph [tree layout, minimum number of children=2, level distance=5mm, nodes={circle,draw}] { / -> { a -> / -> /, b -> /[second] -> /[second] }}; @@ -287,6 +293,9 @@ example }; ]] +--[[ +% TODOsp: codeexamples: the next example needs the library `arrows.meta` +--]] example [[ \tikz \graph [binary tree layout] { @@ -295,7 +304,7 @@ example Tobin -> Plass -> { Lamport, Spivak } } };\qquad -\tikz [>=spaced stealth'] +\tikz [>={Stealth[round,sep]}] \graph [binary tree layout, grow'=right, level sep=1.5em, nodes={right, fill=blue!50, text=white, chamfered rectangle}, edges={decorate,decoration={snake, post length=5pt}}] |