summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua56
1 files changed, 28 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
index 15df9990f8e..dc1e8ab571c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
@@ -23,7 +23,7 @@ local lib = require "pgf.gd.lib"
local Storage = require "pgf.gd.lib.Storage"
local layered = require "pgf.gd.layered"
---
+--
-- This file defines some basic functions to compute and/or set the
-- ideal distances between nodes of any kind of layered drawing of a
-- graph.
@@ -35,7 +35,7 @@ local layered = require "pgf.gd.layered"
--
-- @param layers A |Storage| object assigning layers to vertices.
-- @param paddings A |Storage| object storing the computed distances
--- (paddings).
+-- (paddings).
-- @param graph The graph in which the nodes reside
-- @param snapshots The list of snapshots over which the overlaying evolving
-- graph exists
@@ -56,47 +56,47 @@ function temporallayered.arrange_layers_by_baselines (layers, paddings, graph, s
end
if count_layers > 0 then
-
-
+
+
-- Now compute ideal distances and store
local height = 0
-
+
for _, s in ipairs(snapshots) do
local layer_vertices = snapshots_layers[s]
if #layer_vertices > 0 then -- sanity check
- for _,v in ipairs(layer_vertices[1]) do
- v.pos.y = 0
- end
+ for _,v in ipairs(layer_vertices[1]) do
+ v.pos.y = 0
+ end
end
end
-
+
for i=2, count_layers do
local distance = 0
for _, s in ipairs(snapshots) do
- local layer_vertices = snapshots_layers[s]
- if #layer_vertices >= i then
- distance = math.max(
- distance,
- layered.baseline_distance(
- paddings,
- s,
- layer_vertices[i-1],
- layer_vertices[i]))
- end
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ distance = math.max(
+ distance,
+ layered.baseline_distance(
+ paddings,
+ s,
+ layer_vertices[i-1],
+ layer_vertices[i]))
+ end
end
-
+
height = height + distance
-
+
for _, s in ipairs(snapshots) do
- local layer_vertices = snapshots_layers[s]
- if #layer_vertices >= i then
- for _,v in ipairs(layer_vertices[i]) do
- v.pos.y = height
- end
- end
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ for _,v in ipairs(layer_vertices[i]) do
+ v.pos.y = height
+ end
+ end
end
end
- end
+ end
end