Fix the node position

I have write a click event that will create a new node. The problem is I can’t able to place the node in a particular position. It always ended up in the last of the tree as an orphanage. Is there a way to add an orphanage node inside an tree structure.

(however what i need to do is create a sticky note when i click a node. To do that i need to create an separate node when i click an actual node, the thing is since it is an orphan it goes down the tree and place as an separate one )

What is happening is that you have a Diagram.layout (probably a TreeLayout) that is automatically laying out all of the nodes each time a node or a link is added or removed. Please read https://gojs.net/latest/intro/layouts.html#LayoutInvalidation

I’m not sure what you want. It would help if you showed a screenshot or sketch of what you want the result to be after the user creates a new node. How is the layout supposed to know what to do with this new node, if it isn’t a regular node in the tree or forest?

If you set or bind Part.isLayoutPositioned to false, remember that you will have to set or bind its Part.location or Part.position. If you don’t provide a real Point value, GoJS won’t know where to draw the node, because the automatic layout will not have assigned a location.

those yellow nodes are created when i clicked the map node. the thing is i want it to be positioned near below the map node (i.e which ever node i click)
instead of being forced to last

What is the logical relationship of each of those yellow nodes with the clicked “Map” node? What should happen when the user moves the “Map” node? Or when that “Map” node is deleted?

the issue been resolved, anyway thank you for the response. i just needed to set { isOngoing : false } on the tree layout