From 675266a469958f9238613ad9e8ce6ae637736923 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 5 May 2019 21:38:50 +0000 Subject: pgf git-svn-id: svn://tug.org/texlive/trunk@51018 c570f23f-e606-0410-a88d-b1316a301751 --- .../pgf/gd/force/jedi/algorithms/SimpleSpring.lua | 51 +++++++++++----------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua') diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua index 20a1be5de0e..4dbae2b1f4c 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua @@ -19,35 +19,34 @@ declare { key = "trivial spring layout", algorithm = SimpleSpringClass, documentation_in = "pgf.gd.doc.jedi.algorithms.SimpleSpringLayout", - preconditions = { connected = true }, + preconditions = { connected = true }, postconditions = {fixed = true}, - summary = "This layout uses only spring forces to draw graphs.", + summary = "This layout uses only spring forces to draw graphs.", - documentation = - [[The simple spring algorithm only uses one force kind: A spring force - that serves as both attracitve and repuslive force. The edges are modeled as - springs and act according to Hoke's law: They have an ideal length and will - expand if they are contracted below this length, pushing the adjacent - vertices away from each other, and contract if it is stretched, pulling the - adjacent vertices towards each other. This ideal length is given by the - parameter |node distance|. There is no force repelling vertices that are not - connected to each other, which can lead to vertices being placed at the same - point. It is not a very powerfull layout and will probably fail with large - graphs, especially if they have few edges. It can however be used to - demonstrate the effect of spring forces. This layout was implemented by using - the Jedi framework. - ]], + documentation = [[ + The simple spring algorithm only uses one force kind: A spring force + that serves as both attractive and repulsive force. The edges are modeled as + springs and act according to Hoke's law: They have an ideal length and will + expand if they are contracted below this length, pushing the adjacent + vertices away from each other, and contract if it is stretched, pulling the + adjacent vertices towards each other. This ideal length is given by the + parameter |node distance|. There is no force repelling vertices that are not + connected to each other, which can lead to vertices being placed at the same + point. It is not a very powerful layout and will probably fail with large + graphs, especially if they have few edges. It can however be used to + demonstrate the effect of spring forces. This layout was implemented by using + the Jedi framework. + ]], - example = - [[ - \tikz - \graph[simple spring layout, node distance = 3cm, speed = 2, nodes={as=,circle, draw, inner sep=3pt,outer sep=0pt}, coarsen = true, maximum step = 1]{ - a -- {b, c, d, e}, - b -- {c, d, e}, - c -- {d, e}, - d --e - }; + example = [[ + \tikz + \graph[simple spring layout, node distance = 3cm, speed = 2, nodes={as=,circle, draw, inner sep=3pt,outer sep=0pt}, coarsen = true, maximum step = 1]{ + a -- {b, c, d, e}, + b -- {c, d, e}, + c -- {d, e}, + d --e + }; ]] } @@ -69,7 +68,7 @@ function SimpleSpringClass:run() } -- run algorithm - simple_spring:run() + simple_spring:run() end return SimpleSpringClass \ No newline at end of file -- cgit v1.2.3