Skip to content

Commit

Permalink
docs: correct/add subgraph preamble comments
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Pinnow <[email protected]>
  • Loading branch information
Mo-Gul committed Oct 8, 2022
1 parent 0280303 commit af40f01
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 43 deletions.
8 changes: 4 additions & 4 deletions doc/generic/pgf/pgfmanual-en-tikz-graphs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ \subsection{Overview}
};
\end{codeexample}

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

\begin{codeexample}[
preamble={\usetikzlibrary{graphs}},
preamble={\usetikzlibrary{graphs.standard}},
pre={\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}},
]
\tikz
Expand Down Expand Up @@ -410,7 +410,7 @@ \subsubsection{Concept: Graph Expressions and Color Classes}
all red and all green nodes. More advanced connectors, like the |butterfly|
connector, allow you to add edges between color classes in a fancy manner.
%
\begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
\begin{codeexample}[preamble={\usetikzlibrary{graphs.standard}}]
\tikz [x=8mm, y=6mm, circle]
\graph [nodes={fill=blue!70}, empty nodes, n=8] {
subgraph I_n [name=A] --[butterfly={level=4}]
Expand Down Expand Up @@ -3471,7 +3471,7 @@ \subsubsection{Graph Macros}
% The names of the two shores |V| and |W| can be changed as described in
% the documentation of the keys |/tikz/graphs/name shore V| and
% |/tikz/graphs/name shore W|.
% \begin{codeexample}[preamble={\usetikzlibrary{graphs}}]
% \begin{codeexample}[preamble={\usetikzlibrary{graphs.standard}}]
%\tikz \graph [grid placement] { subgraph Grid_nm [V={1,2,3}, W={4, 5, 6}] };
% \end{codeexample}
%\end{graph}
Expand Down
31 changes: 20 additions & 11 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ declare {
This behavior can be changed using this option. When the key is
invoked, nodes are placed \emph{behind} the edges.
"]],
examples = [["
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
nodes behind edges]
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
"]]
examples = {
{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{circular}}"]],
code = [["
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
nodes behind edges]
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
"]]
}
}
}


Expand All @@ -72,11 +77,16 @@ declare {
summary = [["
This is the default placement of edges: Behind the nodes.
"]],
examples = [["
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
edges behind nodes]
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
"]]
examples = {
{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{circular}}"]],
code = [["
\tikz \graph [simple necklace layout, nodes={draw,fill=white},
edges behind nodes]
{ subgraph K_n [n=7], 1 [regardless at={(0,-1)}] };
"]]
}
}
}

---
Expand Down Expand Up @@ -193,4 +203,3 @@ declare {
key = InterfaceCore.subgraph_node_kind,
layer = 0
}

24 changes: 14 additions & 10 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,20 @@ declare {
in the two graphs, the nodes are placed at exactly two and four
coordinates in the final drawing.
"]],
examples = [["
\tikz \graph [spring layout, iterations=0,
minimum coarsening size=2]
{ subgraph C_n [n=8] };
\tikz \graph [spring layout, iterations=0,
minimum coarsening size=4]
{ subgraph C_n [n=8] };
"]]
examples = {
{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring layout, iterations=0,
minimum coarsening size=2]
{ subgraph C_n [n=8] };
\tikz \graph [spring layout, iterations=0,
minimum coarsening size=4]
{ subgraph C_n [n=8] };
"]]
}
}
}

---
Expand Down Expand Up @@ -145,4 +150,3 @@ declare {
{ { [clique] 1, 2 } -- 3 -- 4 -- { 5, 6, 7 } };
"]]
}

Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ declare {
"]],
examples = {
{
options = [["preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}}"]],
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ 0 [electric charge=1] -- subgraph C_n [n=10] };
"]]
},{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ 0 [electric charge=5] -- subgraph C_n [n=10] };
"]]
},{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ [clique] 1 [electric charge=5], 2, 3, 4 };
Expand Down Expand Up @@ -102,4 +104,3 @@ declare {
least the results are somewhat strange when this key is used.
"]]
}

40 changes: 24 additions & 16 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,30 @@ declare {
The examples shows two drawings generated using two
different |iteration| limits.
"]],
examples = {[["
\tikz \graph [spring layout, iterations=10] { subgraph K_n [n=4] };
"]],[["
\tikz \graph [spring layout, iterations=500] { subgraph K_n [n=4] };
"]],[["
\tikz \graph [spring electrical layout, iterations=10]
{ subgraph K_n [n=4] };
"]],[["
\tikz \graph [spring electrical layout, iterations=500]
{ subgraph K_n [n=4] };
"]]
examples = {
{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring layout, iterations=10] { subgraph K_n [n=4] };
"]]
},{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring layout, iterations=500] { subgraph K_n [n=4] };
"]]
},{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring electrical layout, iterations=10]
{ subgraph K_n [n=4] };
"]]
},{
options = [["preamble={\usetikzlibrary{graphs.standard,graphdrawing} \usegdlibrary{force}}"]],
code = [["
\tikz \graph [spring electrical layout, iterations=500]
{ subgraph K_n [n=4] };
"]]
}
}
}

Expand Down Expand Up @@ -129,8 +142,3 @@ declare {
"]]
}
}





0 comments on commit af40f01

Please sign in to comment.