MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / constructor

Method constructor

src/LGraph.ts:243–256  ·  view source on GitHub ↗

* See LGraph * @param o data from previous serialization [optional]

(o?: ISerialisedGraph | SerialisableGraph)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

clearMethod · 0.95
configureMethod · 0.95
bindAllMethodsMethod · 0.80

Tested by

no test coverage detected