Problem with layout.isOngoing

i have a diagram where i m using forced directed layout.
i m programmatically adding nodes and links into the diagram,
nodes are adeed to model but are not shown visually after i set layout.isOnGoing to false.

this is how i m adding node



var newNodeData = Utils.getNewNodeData(;


this.diagram.raiseDiagramEvent('PartCreated', newNodeData);


this is how i m initializing diagram

var configJson = DefaultConfigJSON.returnDefaultConfigJSon(this.categoryId);

this.diagram = diagramConfigration.diagramConfig(this.diagram, configJson);

var diagramNodeTemplates = this.nodeTemplates.returnNodeTemplatesByDiagramTypeId(this.categoryId);

var diagramLinkTemplates = this.linkTemplates.returnLinkTemplatesByDiagramTypeId(this.categoryId);

this.diagram = Utils.addTemplatesToDiagram(MainConstants.NODE_TEMPLATE_LABEL, diagramNodeTemplates, this.diagram)

this.diagram = Utils.addTemplatesToDiagram(MainConstants.LINK_TEMPLATE_LABEL, diagramLinkTemplates, this.diagram)

// adding layer



this.diagram.layout.isOngoing = false;

this.diagram.model = new go.GraphLinksModel();

if (this.diagram.model instanceof go.GraphLinksModel) {

  this.diagram.model.linkKeyProperty = MainConstants.LINK_KEY_PROPERTY;

  this.diagram.model.nodeDataArray = this.diagramData.nodeDataArray;

  this.diagram.model.linkDataArray = this.diagramData.linkDataArray;



this.diagram.div = this.myDiagramComponent.nativeElement;

If you set Layout.isOngoing to false on your Diagram.layout, then there is no automatic layout that occurs after adding or removing any node or link. So unless you explicitly set any new node’s location or position (perhaps through a binding), it won’t have a real location. How can the library draw a node unless it has a real location?

Hmmmm. oki thanks i will bind the position,
Secondly force directed layout is making browser unresponsive for 12000 nodes with links having avoid nodes to true and max iteration set to 15.

Yes, that’s a fairly large graph, so any layout will take time.