wardley.love/0063-load_graph_from_disk

11 lines
273 B
Plaintext

load_graph_from_disk = function()
local f = App.open_for_reading(Filename)
if not f then return end
local contents = f:read()
f:close()
if contents == '' then return end
local data = json.decode(contents)
Nodes = data.nodes or {}
First_available_id = data.next
end