i am using LayeredDigraphLayout with following options
direction: 90,isOngoing: false,isInitial :false,
layerSpacing: 50, columnSpacing: 40,
now i just want to drop a node on link and set some spacing when it get added without effecting any other node position in diagram
right now i am able to add new node between two nodes but i am not be able to add spacing between it and when i use these propertyes
myDiagram.layout.isValidLayout = false;
my whole diagram get arranged but i only want to arrange that newly added node only without effecting whole layout i have also tried layoutConditions on node-template and set Part.isLayoutPositioned to false but then i my newly added node also get effected. Please provide me some solution for this
At the time of the mouse drop did you want to move any nodes that overlap (or come close to overlapping) the dropped node(s)?
You can see what nodes are in an area by calling Diagram.findObjectsIn. If you find any besides the dropped node itself, you can move them. But you’ll need to decide which nodes to move and in which direction and how far.
I am guessing that in your scenario you would expect the “mbt_component_8” node to move down a bit, yes? What would you expect to happen if the user dropped a new node about where “mbt_component_9” is? And then did it again?
My point is that to get reasonable results you might need to move all of the nodes. That’s the responsibility of the layout.
Let’s say that the user inserts a new node just before “mbt_component_2”. So you decide to move “mbt_component_2” down. But now you decide that you also need to move “mbt_component_3” down as well.
Another scenario: the user inserts a new node between “mbt_component” and “mbt_component_3”. Now you need to move “_1” towards the right, and you need to move the three nodes “_5”, “_8”, and “_7” rightwards as well.
Yet another scenario: the user inserts a new node after “Start” but before everything else. Now everything besides “Start” has to be shifted down. Well, maybe not “_6” and “_7”.
Again, how can you know what can be moved? You can’t – only the layout can know. So the only easy solution is to allow the Diagram.layout to operate with Layout.isOngoing true.