Add Edge and Node classes to init.lua

This way they can be required separately from the Graph class.
This commit is contained in:
Robert Machmer 2016-01-09 05:03:45 +01:00
parent 4e5e302d32
commit 73b74ca3fe
3 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,5 @@
local current = (...):gsub('%.[^%.]+$', '');
local Edge = {};
function Edge.new( id, origin, target )

View File

@ -1,3 +1,5 @@
local current = (...):gsub('%.[^%.]+$', '');
local Node = {};
local FORCE_SPRING = -0.01;

View File

@ -1 +1,5 @@
return { Graph = require( (...):gsub('%.init$', '') .. '.Graph' ) };
return {
Edge = require( (...):gsub('%.init$', '') .. '.Edge' ),
Graph = require( (...):gsub('%.init$', '') .. '.Graph' ),
Node = require( (...):gsub('%.init$', '') .. '.Node' )
};