When user drag and drop triangle node any where on circular group node from pallet, I want to position that triangle node to the top left of that circular group node, in bellow example you can see triangle node is placed on top left/ on that particular spot of the circular node.
So, you do not want the user to position the node manually – you want the layout to do so automatically? It sounds like you want to customize the layout to treat such dropped nodes specially. Is that correct? Do you know how to identify such nodes?
Yes, I don’t want to allow users to position node manually.
That triangle is a group node and only one triangle per circular group is allowed to drop, so when user drop triangle node from pallet, on drop I have handling method which also identify such node and with current implementation it creates new node at dropped position. So instead of creating node at dropped location I want to create that node on top left of circular group node.
Maybe one way is to have the layout ignore that triangle node if your code is positioning it where you want. Is your code in an “ExternalObjectsDropped” listener? Have it set Part.isLayoutPositioned to false on that triangle node.
No, it is not “ExternalObjectsDropped” listener. On drag and drop we add node into diagram using either “addNodeData()” OR by setting dropped node data using “diagram.model.setDataProperty()”.
Unless your node template has a Binding on Part.isLayoutPositioned, then that new node will be laid out automatically. Since it appears that the new node will be a member of a group, it will be the Group.layout that performs that layout.
But if you set { isLayoutPositioned: false } on your “TriangleGroup” node template,
then those nodes will not be laid out by the layout but will retain whatever location/position that you have assigned via a binding.