Skip to content

Instantly share code, notes, and snippets.

View keithwhor's full-sized avatar
🍁

Keith Horwood keithwhor

🍁
View GitHub Profile
@keithwhor
keithwhor / graph_unit.js
Created July 21, 2015 16:55
Basic Unit class for graphs
class Unit {
// Entity is used as node or edge type, for different classifications
// i.e. 'person', 'game', 'road', etc.
constructor(entity, properties) {
this.entity = entity + '';
this.load(properties || {});
@keithwhor
keithwhor / graph_jlm_example.js
Last active May 1, 2016 23:31
Joe likes Minecraft example
let joe = {type: 'node', properties: {name: 'joe'}, input: [], output: []};
let likes = {type: 'edge', properties: {name: 'likes'}, input: null, output: null};
let minecraft = {type: 'node', properties: {name: 'minecraft'}, input: [], output: []};
joe.output.push(likes);
likes.input = joe;
likes.output = minecraft;
minecraft.input.push(likes);