summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/doc.lua
blob: 620c035d5238d6f1bb3ed6c4226b2149465f2526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
-- Copyright 2014 by Ida Bruhns and Till Tantau
--
-- This file may be distributed and/or modified
--
-- 1. under the LaTeX Project Public License and/or
-- 2. under the GNU Public License
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information

-- Imports
local key           = require 'pgf.gd.doc'.key
local documentation = require 'pgf.gd.doc'.documentation
local summary       = require 'pgf.gd.doc'.summary
local example       = require 'pgf.gd.doc'.example


--------------------------------------------------------------------
key          "maximum step"

summary
[[
This option determines the maximum ditance every vertex is allowed to travel 
in one iteration. 
]]

documentation
[[
No matter how large the forces influencing a vertex, the effect 
on the drawing should be limited to avoid vertices "jumping" from one side of 
the canvas to each other due to a strong force pulling them further than their 
ideal destination. The amount of space a vertex is allowed to travel in one 
iteration is limited by the \lstinline{maximum step} parameter. It is $5000$ 
by default. That means by default, this parameter should not get in your way.
]]


example
[[
\tikz
  \graph[social degree layout, iterations = 2, maximum time = 2, maximum step = 6pt, coarsen = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };    
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 2, maximum time = 2, maximum step = 12pt, coarsen = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------





--------------------------------------------------------------------
key          "speed"

summary
[[ This is a factor every calculated step is multiplied by.]]

documentation
[[
The speed is the distance a vertex travels if it is influenced by a force of
$1$N$\cdot\gamma$. The speed is only a factor that will influence the total 
amount every vertex can move: Half the speed makes half the movement, twice 
the speed doubles the distance traveled.
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 1, maximum time = 1, maximum step = 100, speed = 0.2, coarsen = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };    
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 1, maximum time= 1, maximum step = 100, speed = 0.4, coarsen = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------



--------------------------------------------------------------------
key          "maximum time"

summary
[[ The highest amount of virtual time the algorithm is allowed to take.]]

documentation
[[
This option is part of the virtual time construct of Jedi. The virtual time 
concept allows graph drawing algorithm engineers to switch forces on and of 
after a relative or absolute amount of time has elapsed. If the iterations 
stay the same, doubling the maximum time has the same effect as doubling the 
speed: Vertices move faster, but it is possible they miss their intended 
destination. Also increasing the iterations changes the "resolution" of the 
graph drawing algorithm: More steps are simulated in the same time. 
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 20, maximum time = 100, coarsen = false, maximum step = 0.5, gravity = 2]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };  
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 20, maximum time = 200, coarsen = false, maximum step = 0.5, gravity = 2]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------


  
--------------------------------------------------------------------
key          "find equilibrium"

summary
[[ If this option is |true|, the framework checks the vertex movment to detect 
low movement near the equilibrium and stop the algorithm]]

documentation
[[
Since we often do not know how many iterations are enough, the framework will 
detect when the vertices (almost) stop moving and stop the algorithm. After 
each iteration, the framework adds up the net force influencing all the 
vertices. If it falls below the threshold |epsilon|, the algorithm 
will ignore the left over iterations and terminate. You can disable this 
behavior by setting this parameter to |false|. Allowing the framework to find 
the equilibrium usually saves you time, while allowing more iterations (or a 
  lower threshold) generates higher quality drawings.
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 300, maximum time = 300, coarsen = false,  maximum step = 10, epsilon = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };    
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 300, maximum time = 300,  maximum step = 10, find equilibrium = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------



--------------------------------------------------------------------
key          "epsilon"

summary
[[ The threshold for the |find equilibrium| option.]]

documentation
[[
This key specifies the threshold for the |find equilibrium| option. The lower 
epsilon, the longer the graph drawing algorithm will take, but the closer the 
resulting drawing will be to the true energy minimum. 
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 200, maximum time = 200, maximum step = 10, coarsen = false, epsilon = 2]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 200, maximum time = 200, maximum step = 10, epsilon = 12, coarsen = false]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------



--------------------------------------------------------------------
key          "snap to grid"

summary
[[ This option enables the post-processing step |snap to grid|.]]

documentation
[[
This key is the on/off-switch for the grid forces. The |snap to grid| option 
triggers a form of post-processing were all vertices are pulled to the closest 
point on a virtual grid. Please note that there is no repulsive force between 
the vertices, so it is possible that two vertices are pulled to the same grid 
point. The grid size is determined by the parameters |grid x length| and 
|grid y length|.
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]

example
[[
\tikz{
  \graph[social degree layout, iterations = 100, maximum time = 100, snap to grid =true, grid x length = 5mm, grid y length = 5mm, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------



--------------------------------------------------------------------
key          "grid x length"

summary
[[ This option determines the cell size in $x$ direction for the |snap to grid| 
option.]]

documentation
[[
The size of the cells of the virtual grid can be configured by the user. This 
key allows a configuration of the horizontal cell width. 
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, snap to grid =true, grid x length = 5mm, grid y length = 5mm, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };   
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, snap to grid =true, grid x length = 9mm, grid y length = 5mm, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };   
]]
--------------------------------------------------------------------



--------------------------------------------------------------------
key          "grid y length"

summary
[[ This option determines the cell size in $x$ direction for the |snap to grid| 
option.]]

documentation
[[
Same as |grid x length|, but in vertical direction (height of the cells).
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, snap to grid =true, grid x length = 5mm, grid y length = 5mm, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };  
]]

example
[[
\tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, snap to grid =true, grid x length = 5mm, grid y length = 9mm, maximum step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------


--------------------------------------------------------------------
key "mass"

summary
[[
    The mass of a vertex determines how fast it can move. Vertices 
    with higher mass move slower.
]]

documentation
[[
    The mass of a vertex determines how fast this vertex 
    moves. Mass is directly inverse proportional to the distance the vertex 
    moves. In contrast to the global speed factor, mass usually only affects a 
    single vertex. A vertex with a higher mass will move slower if affected by 
    the same mass than a vertex with a lower mass. By default, each vertex has a 
    mass of $1$. 
]]

example
[[
  \tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, maximum displacement per step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1 -- {b2 -- {b3, b4}, b5}
  };       
]]

example
[[
  \tikz
  \graph[social degree layout, iterations = 100, maximum time = 100, maximum displacement per step = 10]{
    a1 -- {a2, a3, a4, a5},
    b1[mass = 4] -- {b2 -- {b3, b4}, b5}
  }; 
]]
--------------------------------------------------------------------


--------------------------------------------------------------------
key "coarsening weight"

summary
[[
    The coarsening weight of a vertex determines when it will be 
    coarsened.
]]

documentation
[[
    Vertices with higher coarsening weight are considered more important and 
    will be coarsened later, or not at all.
]]
--------------------------------------------------------------------