(x)
| 58 | } |
| 59 | |
| 60 | delNode (x) { |
| 61 | const n = this.nodes[x]; |
| 62 | let result = false; |
| 63 | |
| 64 | if (defined(n)) { |
| 65 | Object.keys(n.edges).forEach(y => { |
| 66 | delete this.nodes[y].edges[x]; |
| 67 | }); |
| 68 | |
| 69 | delete this.nodes[x]; |
| 70 | result = true; |
| 71 | } |
| 72 | |
| 73 | return result; |
| 74 | } |
| 75 | |
| 76 | fromJSON (arg) { |
| 77 | this.nodes = JSON.parse(arg); |