the-graph icon indicating copy to clipboard operation
the-graph copied to clipboard

Autolayout doesn't work after new node was added

Open kelegorm opened this issue 9 years ago • 0 comments

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:

  1. We adding node in noflo.js - Graph.prototype.addNode()
this.nodes.push(node);
this.emit('addNode', node);
this.checkTransactionEnd();
  1. 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?

kelegorm avatar Mar 14 '15 21:03 kelegorm