* Delete a vertex from the graph. * @param id The id of the vertex to delete, or the vertex itself.
(id: ElementId | Vertex<TSchema, any>)
| 554 | * @param id The id of the vertex to delete, or the vertex itself. |
| 555 | */ |
| 556 | public deleteVertex(id: ElementId | Vertex<TSchema, any>): void { |
| 557 | if (typeof id === "object") { |
| 558 | id = id.id; |
| 559 | } |
| 560 | const vertex = this.#config.storage.getVertexById(id); |
| 561 | if (vertex) { |
| 562 | this.#indexManager.onElementRemove(vertex); |
| 563 | } |
| 564 | this.#config.storage.deleteVertex(id); |
| 565 | } |
| 566 | |
| 567 | /** |
| 568 | * Add an edge to the graph. |
nothing calls this directly
no test coverage detected