Preventing overlapping of elements

Hi,

I have a GoView on which customized GoNode/GoSubgraph objects are dragged and dropped. As user is allowed to drag and drop anywhere on the view area, there are possibilities that overlapping of elements occur. We need to prevent this overlapping and spread the already dropped objects so that overlapping will not occur on drop of new element on top of another already dropped object . Is there a layout algorithm available in GoDiagram which takes care of this situation.
Please provide information on this.
Thanks and Best Regards,
Nagaraj.

You want to move the existing nodes out of the way so the dropped node can settle into the spot where it was dropped? You could use force directed layout to do that. I’d recommend you animate the move (see LayoutDemo’s “ForceDirectedProgress”) so that the user “sees” the movement happening. You probably also want to “fix” nodes that are more than some distance away from the drop so the whole diagram doesn’t change.