the-graph
the-graph copied to clipboard
Autolayout doesn't work after new node was added
the-graph-editor.autolayout = true
I'm adding new node with the-graph-editor->the-graph.addNode(...)
, and I see exception: "cannot read property 'inports' from undefined".
I had a some investigations here and found:
- We adding node in
noflo.js
- Graph.prototype.addNode()
this.nodes.push(node);
this.emit('addNode', node);
this.checkTransactionEnd();
-
Then event 'addNode' was fired, we come to
the-graph.html
, where we getting ports and call klay-noflo:var graph = this.graph; var portInfo = this.graphView ? this.graphView.portInfo : null; // Calls the autolayouter this.autolayouter.layout({//...
So right now portInfo
object doesn't contain ports for new added node, exception thrown.
May be I'm doing something wrong?