summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-12 20:45:15 +0000
committerKarl Berry <karl@freefriends.org>2019-07-12 20:45:15 +0000
commitaebf7cb9eaabd4c0092643c77009a567ede155dc (patch)
treefa4aae570987002e252dd9c3d3b96b7571f03848 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua
parent2d83a76b7d0fa40bf7b1c90280ee3388258a73f3 (diff)
pgf (12jul19)
git-svn-id: svn://tug.org/texlive/trunk@51626 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua33
1 files changed, 0 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
index 51e278b904c..86b65abc83e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
@@ -306,39 +306,6 @@ function SpringHu2006:computeForceLayout(graph, spring_length, step_update_func)
-- update the energy function
energy = energy + math.pow(d:norm(), 2)
- -- vector for the displacement of v
- local d = Vector.new(2)
-
- for _,u in ipairs(graph.nodes) do
- if v ~= u then
- -- compute the distance between u and v
- local delta = u.pos:minus(v.pos)
-
- -- enforce a small virtual distance if the nodes are
- -- located at (almost) the same position
- if delta:norm() < 0.1 then
- delta:update(function (n, value) return 0.1 + lib.random() * 0.1 end)
- end
-
- local graph_distance = (distances[u] and distances[u][v]) and distances[u][v] or #graph.nodes + 1
-
- -- compute the repulsive force vector
- local force = repulsive_force(delta:norm(), graph_distance, v.weight)
- local force = delta:normalized():timesScalar(force)
-
- -- move the node v accordingly
- d = d:plus(force)
- end
- end
-
- -- really move the node now
- -- TODO note how all nodes are moved by the same amount (step_length)
- -- while Walshaw multiplies the normalized force with min(step_length,
- -- d:norm()). could that improve this algorithm even further?
- v.pos = v.pos:plus(d:normalized():timesScalar(step_length))
-
- -- update the energy function
- energy = energy + math.pow(d:norm(), 2)
end
end