Hi Team,
Following is our requirement:
- We don’t want to reload/redraw/rearrange our current go graph
- We want to add a new node in our current go graph dynamically
- The newly added node should be added on the left-hand side
- The new node should not overlap the existing node
We have set isOngoing to false to prevent automatic layout every time node data array/link data array is being changed.
When new nodes are currently added, they are overlapping on existing nodes.
Layout being used is TreeLayout.
const processDiagram = (
go.Diagram,
id, // create a Diagram for the DIV HTML element
{ initialContentAlignment: go.Spot.Center,
'undoManager.isEnabled': this.isEditing,
'draggingTool.isEnabled': this.isEditing, // Disables node drag
'panningTool.isEnabled': true, // Disables tree drag
allowHorizontalScroll: true, // Disables horizontal scroll
allowVerticalScroll: true, // Disables vertical scroll
layout: (go.TreeLayout, {
isRealtime: false,
angle: 90,
layerSpacing: this.layerSpacing,
isOngoing: false
}),
initialDocumentSpot: go.Spot.Bottom,
initialViewportSpot: go.Spot.Bottom,
initialAutoScale: go.Diagram.Uniform})
Please let us know what additional information you need.
R,
Akash