A = function(preserve_screen_top_of_cursor_node) print('A') -- translate Nodes to Surface while #Surface > 0 do table.remove(Surface) end for key,node in pairs(Nodes) do node.id = key compute_layout(node, node.x,node.y, Surface, preserve_screen_top_of_cursor_node) end -- draw edges after all nodes have been initialized for key,node in pairs(Nodes) do for _,d in ipairs(node.outgoing_edges) do compute_layout_for_edge(key, d) end end -- continue the pipeline B(preserve_screen_top_of_cursor_node) -- TODO: ugly that we're manipulating editor objects twice end