| 1 | var Graph = class Graph { |
| 2 | #nodes = []; |
| 3 | |
| 4 | get size() { |
| 5 | return this.#nodes.length; |
| 6 | } |
| 7 | |
| 8 | addNode() { |
| 9 | let id = this.#nodes.length; |
| 10 | this.#nodes.push(new Set()); |
| 11 | return id; |
| 12 | } |
| 13 | |
| 14 | addEdge(nodeA, nodeB) { |
| 15 | this.#nodes[nodeA].add(nodeB); |
| 16 | this.#nodes[nodeB].add(nodeA); |
| 17 | } |
| 18 | |
| 19 | neighbors(node) { |
| 20 | return this.#nodes[node]; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | function randomLayout(graph) { |
| 25 | let layout = []; |
nothing calls this directly
no outgoing calls
no test coverage detected