(subgraph: Subgraph)
| 1634 | } |
| 1635 | |
| 1636 | openSubgraph(subgraph: Subgraph): void { |
| 1637 | const { graph } = this |
| 1638 | if (!graph) throw new NullGraphError() |
| 1639 | |
| 1640 | const options = { bubbles: true, detail: { subgraph, closingGraph: graph }, cancelable: true } |
| 1641 | const mayContinue = this.canvas.dispatchEvent(new CustomEvent("subgraph-opening", options)) |
| 1642 | if (!mayContinue) return |
| 1643 | |
| 1644 | this.clear() |
| 1645 | this.subgraph = subgraph |
| 1646 | this.setGraph(subgraph) |
| 1647 | |
| 1648 | this.canvas.dispatchEvent(new CustomEvent("subgraph-opened", options)) |
| 1649 | } |
| 1650 | |
| 1651 | /** |
| 1652 | * @returns the visually active graph (in case there are more in the stack) |
no test coverage detected