Created
July 21, 2015 17:19
-
-
Save keithwhor/243d3e9e419aba791ee7 to your computer and use it in GitHub Desktop.
Node class for graphs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node extends Unit { | |
constructor(entity, properties) { | |
super(entity, properties); | |
this.edges = []; | |
this.inputEdges = []; | |
this.outputEdges = []; | |
} | |
unlink() { | |
let edges = this.edges; | |
for (let i = 0, len = edges.length; i < len; i++) { | |
edges[i].unlink(); | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment