| 282 | }) |
| 283 | |
| 284 | const makeRight = () => |
| 285 | Graph.directed<{ readonly id: string; readonly label: string }, string>((mutable) => { |
| 286 | const b = Graph.addNode(mutable, { id: "b", label: "B2" }) |
| 287 | const c = Graph.addNode(mutable, { id: "c", label: "C2" }) |
| 288 | const d = Graph.addNode(mutable, { id: "d", label: "D2" }) |
| 289 | Graph.addEdge(mutable, b, c, "shared-bc") |
| 290 | Graph.addEdge(mutable, c, d, "right-cd") |
| 291 | }) |
| 292 | |
| 293 | it("compose merges nodes and edges by identity", () => { |
| 294 | const graph = Graph.compose(makeLeft(), makeRight(), { nodeIdentity: (node) => node.id }) |