@@ -98,58 +98,46 @@ sense that some nodes are ``nailed to the canvas'' while other
9898nodes can ``move freely''.
9999]]
100100
101- example ({options =
102- [[
103- preamble=\usetikzlibrary{graphs,graphdrawing}
104- \usegdlibrary{force}
105- ]] ,
106- code =
107- [[
108- \begin{tikzpicture}
109- \draw [help lines] (0,0) grid (3,2);
110- \graph [spring layout]
111- {
112- a[x=1] -- { b, c, d, e -- {f,g,h} };
113- { h, g } -- a;
114- };
115- \end{tikzpicture}
116- ]]
101+ example ({
102+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]] ,
103+ code = [[
104+ \begin{tikzpicture}
105+ \draw [help lines] (0,0) grid (3,2);
106+ \graph [spring layout]
107+ {
108+ a[x=1] -- { b, c, d, e -- {f,g,h} };
109+ { h, g } -- a;
110+ };
111+ \end{tikzpicture}
112+ ]]
117113})
118114
119- example ({options =
120- [[
121- preamble=\usetikzlibrary{graphs,graphdrawing}
122- \usegdlibrary{force}
123- ]] ,
124- code =
125- [[
126- \begin{tikzpicture}
127- \draw [help lines] (0,0) grid (3,2);
128- \graph [spring layout]
129- {
130- a -- { b, c, d[x=0], e -- {f[x=2], g, h[x=1]} };
131- { h, g } -- a;
132- };
133- \end{tikzpicture}
134- ]]
115+ example ({
116+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]] ,
117+ code = [[
118+ \begin{tikzpicture}
119+ \draw [help lines] (0,0) grid (3,2);
120+ \graph [spring layout]
121+ {
122+ a -- { b, c, d[x=0], e -- {f[x=2], g, h[x=1]} };
123+ { h, g } -- a;
124+ };
125+ \end{tikzpicture}
126+ ]]
135127})
136128
137- example ({options =
138- [[
139- preamble=\usetikzlibrary{graphs,graphdrawing}
140- \usegdlibrary{force}
141- ]] ,
142- code =
143- [[
144- \begin{tikzpicture}
145- \draw [help lines] (0,0) grid (3,2);
146- \graph [spring layout]
147- {
148- a -- { b, c, d[x=0], e -- {f[x=2,y=1], g, h[x=1]} };
149- { h, g } -- a;
150- };
151- \end{tikzpicture}
152- ]]
129+ example ({
130+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]] ,
131+ code = [[
132+ \begin{tikzpicture}
133+ \draw [help lines] (0,0) grid (3,2);
134+ \graph [spring layout]
135+ {
136+ a -- { b, c, d[x=0], e -- {f[x=2,y=1], g, h[x=1]} };
137+ { h, g } -- a;
138+ };
139+ \end{tikzpicture}
140+ ]]
153141})
154142---- ----------------------------------------------------------------
155143
@@ -180,34 +168,26 @@ Note how in the last example |c| is placed at |(1,1)| rather than
180168|b| as would happen by default.
181169]]
182170
183- example ({options =
184- [[
185- preamble=\usetikzlibrary{graphs,graphdrawing}
186- \usegdlibrary{layered}
187- ]] ,
188- code =
189- [[
190- \tikz \draw (0,0)
191- -- (1,0.5) graph [edges=red, layered layout, anchor node=a] { a -> {b,c} }
192- -- (1.5,0) graph [edges=blue, layered layout,
193- anchor node=y, anchor at={(2,0)}] { x -> {y,z} };
194- ]]
171+ example ({
172+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]] ,
173+ code = [[
174+ \tikz \draw (0,0)
175+ -- (1,0.5) graph [edges=red, layered layout, anchor node=a] { a -> {b,c} }
176+ -- (1.5,0) graph [edges=blue, layered layout,
177+ anchor node=y, anchor at={(2,0)}] { x -> {y,z} };
178+ ]]
195179})
196180
197- example ({options =
198- [[
199- preamble=\usetikzlibrary{graphs,graphdrawing}
200- \usegdlibrary{layered}
201- ]] ,
202- code =
203- [[
204- \begin{tikzpicture}
205- \draw [help lines] (0,0) grid (3,2);
181+ example ({
182+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]] ,
183+ code = [[
184+ \begin{tikzpicture}
185+ \draw [help lines] (0,0) grid (3,2);
206186
207- \graph [layered layout, anchor node=c, edges=rounded corners]
208- { a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a};
209- \end{tikzpicture}
210- ]]
187+ \graph [layered layout, anchor node=c, edges=rounded corners]
188+ { a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a};
189+ \end{tikzpicture}
190+ ]]
211191})
212192---- ----------------------------------------------------------------
213193
@@ -223,20 +203,16 @@ The coordinate at which the graph should be anchored when no
223203explicit anchor is given for any node. The initial value is the origin.
224204]]
225205
226- example ({options =
227- [[
228- preamble=\usetikzlibrary{graphs,graphdrawing}
229- \usegdlibrary{layered}
230- ]] ,
231- code =
232- [[
233- \begin{tikzpicture}
234- \draw [help lines] (0,0) grid (2,2);
206+ example ({
207+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]] ,
208+ code = [[
209+ \begin{tikzpicture}
210+ \draw [help lines] (0,0) grid (2,2);
235211
236- \graph [layered layout, edges=rounded corners, anchor at={(1,2)}]
237- { a -- {b, c [anchor here] } -- d -- a};
238- \end{tikzpicture}
239- ]]
212+ \graph [layered layout, edges=rounded corners, anchor at={(1,2)}]
213+ { a -- {b, c [anchor here] } -- d -- a};
214+ \end{tikzpicture}
215+ ]]
240216})
241217---- ----------------------------------------------------------------
242218
@@ -259,19 +235,15 @@ In the example, |c| is placed at the origin since this is the
259235default |anchor at| position.
260236]]
261237
262- example ({options =
263- [[
264- preamble=\usetikzlibrary{graphs,graphdrawing}
265- \usegdlibrary{layered}
266- ]] ,
267- code =
268- [[
269- \begin{tikzpicture}
270- \draw [help lines] (0,0) grid (2,2);
238+ example ({
239+ options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]] ,
240+ code = [[
241+ \begin{tikzpicture}
242+ \draw [help lines] (0,0) grid (2,2);
271243
272- \graph [layered layout, edges=rounded corners]
273- { a -- {b, c [anchor here] } -- d -- a};
274- \end{tikzpicture}
275- ]]
244+ \graph [layered layout, edges=rounded corners]
245+ { a -- {b, c [anchor here] } -- d -- a};
246+ \end{tikzpicture}
247+ ]]
276248})
277249---- ----------------------------------------------------------------
0 commit comments