* See LGraph * @param o data from previous serialization [optional]
(o?: ISerialisedGraph | SerialisableGraph)
| 241 | * @param o data from previous serialization [optional] |
| 242 | */ |
| 243 | constructor(o?: ISerialisedGraph | SerialisableGraph) { |
| 244 | if (LiteGraph.debug) console.log("Graph created") |
| 245 | |
| 246 | /** @see MapProxyHandler */ |
| 247 | const links = this._links |
| 248 | MapProxyHandler.bindAllMethods(links) |
| 249 | const handler = new MapProxyHandler<LLink>() |
| 250 | this.links = new Proxy(links, handler) as Map<LinkId, LLink> & Record<LinkId, LLink> |
| 251 | |
| 252 | this.list_of_graphcanvas = null |
| 253 | this.clear() |
| 254 | |
| 255 | if (o) this.configure(o) |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Removes all nodes from this graph |
nothing calls this directly
no test coverage detected