Skip to content

Commit af40f01

Browse files
committed
docs: correct/add subgraph preamble comments
Signed-off-by: Stefan Pinnow <[email protected]>
1 parent 0280303 commit af40f01

File tree

5 files changed

+65
-43
lines changed

5 files changed

+65
-43
lines changed

doc/generic/pgf/pgfmanual-en-tikz-graphs.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ \subsection{Overview}
4040
};
4141
\end{codeexample}
4242

43-
\begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
43+
\begin{codeexample}[preamble={\usetikzlibrary{graphs.standard}}]
4444
\tikz
4545
\graph [nodes={draw, circle}, clockwise, radius=.5cm, empty nodes, n=5] {
4646
subgraph I_n [name=inner] --[complete bipartite]
@@ -49,7 +49,7 @@ \subsection{Overview}
4949
\end{codeexample}
5050

5151
\begin{codeexample}[
52-
preamble={\usetikzlibrary{graphs}},
52+
preamble={\usetikzlibrary{graphs.standard}},
5353
pre={\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}},
5454
]
5555
\tikz
@@ -410,7 +410,7 @@ \subsubsection{Concept: Graph Expressions and Color Classes}
410410
all red and all green nodes. More advanced connectors, like the |butterfly|
411411
connector, allow you to add edges between color classes in a fancy manner.
412412
%
413-
\begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
413+
\begin{codeexample}[preamble={\usetikzlibrary{graphs.standard}}]
414414
\tikz [x=8mm, y=6mm, circle]
415415
\graph [nodes={fill=blue!70}, empty nodes, n=8] {
416416
subgraph I_n [name=A] --[butterfly={level=4}]
@@ -3471,7 +3471,7 @@ \subsubsection{Graph Macros}
34713471
% The names of the two shores |V| and |W| can be changed as described in
34723472
% the documentation of the keys |/tikz/graphs/name shore V| and
34733473
% |/tikz/graphs/name shore W|.
3474-
% \begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
3474+
% \begin{codeexample}[preamble={\usetikzlibrary{graphs.standard}}]
34753475
%\tikz \graph [grid placement] { subgraph Grid_nm [V={1,2,3}, W={4, 5, 6}] };
34763476
% \end{codeexample}
34773477
%\end{graph}

tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ declare {
5353
This behavior can be changed using this option. When the key is
5454
invoked, nodes are placed \emph{behind} the edges.
5555
"]],
56-
examples = [["
57-
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
58-
nodes behind edges]
59-
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
60-
"]]
56+
examples = {
57+
{
58+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{circular}}"]],
59+
code = [["
60+
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
61+
nodes behind edges]
62+
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
63+
"]]
64+
}
65+
}
6166
}
6267

6368

@@ -72,11 +77,16 @@ declare {
7277
summary = [["
7378
This is the default placement of edges: Behind the nodes.
7479
"]],
75-
examples = [["
76-
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
77-
edges behind nodes]
78-
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
79-
"]]
80+
examples = {
81+
{
82+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{circular}}"]],
83+
code = [["
84+
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
85+
edges behind nodes]
86+
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
87+
"]]
88+
}
89+
}
8090
}
8191

8292
---
@@ -193,4 +203,3 @@ declare {
193203
key = InterfaceCore.subgraph_node_kind,
194204
layer = 0
195205
}
196-

tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,20 @@ declare {
9595
in the two graphs, the nodes are placed at exactly two and four
9696
coordinates in the final drawing.
9797
"]],
98-
examples = [["
99-
\tikz \graph [spring layout, iterations=0,
100-
minimum coarsening size=2]
101-
{ subgraph C_n [n=8] };
102-
103-
\tikz \graph [spring layout, iterations=0,
104-
minimum coarsening size=4]
105-
{ subgraph C_n [n=8] };
106-
"]]
98+
examples = {
99+
{
100+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
101+
code = [["
102+
\tikz \graph [spring layout, iterations=0,
103+
minimum coarsening size=2]
104+
{ subgraph C_n [n=8] };
105+
106+
\tikz \graph [spring layout, iterations=0,
107+
minimum coarsening size=4]
108+
{ subgraph C_n [n=8] };
109+
"]]
110+
}
111+
}
107112
}
108113

109114
---
@@ -145,4 +150,3 @@ declare {
145150
{ { [clique] 1, 2 } -- 3 -- 4 -- { 5, 6, 7 } };
146151
"]]
147152
}
148-

tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,19 @@ declare {
4141
"]],
4242
examples = {
4343
{
44-
options = [["preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}}"]],
44+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
4545
code = [["
4646
\tikz \graph [spring electrical layout, horizontal=0 to 1]
4747
{ 0 [electric charge=1] -- subgraph C_n [n=10] };
4848
"]]
4949
},{
50+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
5051
code = [["
5152
\tikz \graph [spring electrical layout, horizontal=0 to 1]
5253
{ 0 [electric charge=5] -- subgraph C_n [n=10] };
5354
"]]
5455
},{
56+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
5557
code = [["
5658
\tikz \graph [spring electrical layout, horizontal=0 to 1]
5759
{ [clique] 1 [electric charge=5], 2, 3, 4 };
@@ -102,4 +104,3 @@ declare {
102104
least the results are somewhat strange when this key is used.
103105
"]]
104106
}
105-

tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,30 @@ declare {
4747
The examples shows two drawings generated using two
4848
different |iteration| limits.
4949
"]],
50-
examples = {[["
51-
\tikz \graph [spring layout, iterations=10] { subgraph K_n [n=4] };
52-
"]],[["
53-
\tikz \graph [spring layout, iterations=500] { subgraph K_n [n=4] };
54-
"]],[["
55-
\tikz \graph [spring electrical layout, iterations=10]
56-
{ subgraph K_n [n=4] };
57-
"]],[["
58-
\tikz \graph [spring electrical layout, iterations=500]
59-
{ subgraph K_n [n=4] };
60-
"]]
50+
examples = {
51+
{
52+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
53+
code = [["
54+
\tikz \graph [spring layout, iterations=10] { subgraph K_n [n=4] };
55+
"]]
56+
},{
57+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
58+
code = [["
59+
\tikz \graph [spring layout, iterations=500] { subgraph K_n [n=4] };
60+
"]]
61+
},{
62+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
63+
code = [["
64+
\tikz \graph [spring electrical layout, iterations=10]
65+
{ subgraph K_n [n=4] };
66+
"]]
67+
},{
68+
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
69+
code = [["
70+
\tikz \graph [spring electrical layout, iterations=500]
71+
{ subgraph K_n [n=4] };
72+
"]]
73+
}
6174
}
6275
}
6376

@@ -129,8 +142,3 @@ declare {
129142
"]]
130143
}
131144
}
132-
133-
134-
135-
136-

0 commit comments

Comments
 (0)