Programmatically adding a node with a position to Gridalayout is increasing the group size

41 views Asked by At

I am trying to add a node programmatically into a group by a click event. What i need is to be able to set the position of the node while adding it. so i am adding all required attributes like location, group name etc. Problem is initial load works fine but when i try to add the node data like this on click e.diagram.model.addNodeData({ key: 'oneAA', group: 'Lane1', loc: '0 40' },) the entire group is getting distorted. Issue Image However if i remove the location attribute then there is no distortion. but location is important for my use case

The issue can be reproducible here in Stackblitz Gridlayout

Tried with giving a fixed width, removing placeholder, changing the layout properties. But none seems to work

0

There are 0 answers