I’m trying to create a diagram programmatically from xml file which contains the hiberarchy information. Then I do a automatic layout to the diagram. A few questions:
(1) I’d like to prevents users from creating links on the diagram by drag and drop after the link is created programmatically. Relationships between objects are static and should not be modified.
(2) I use a GoLayoutLayeredDigraph to do an automatic layout. It’s almost OK while some links still run across big objects. How can I avoid this?
(3) I use GoBalloon to display comment. It seems that automatic layout can not place the balloons correctly. It is placed far away from the source object.
(4) I use CustomSubGraph in the diagram. After the layout, some of its ports are not correctly positioned. For example, the link is connected to the left of the bound although obviously it should connect to the bottom.
Can anybody give me some hints? Thanks a lot!
(1) set GoView.AllowLink to false
(3) yes, the layout doesn’t understand about any semantic relationships between GoBalloon and its Anchor object. I suppose you could create a GoLayoutNetwork explicitly from your document and then customize it by creating a GoLayoutNetworkLink between each balloon and its anchor. For each balloon and anchor, call GoLayoutNetwork.FindNode for both objects and then call GoLayoutNetwork.LinkNodes.
(4) there is often a conflict between what the layout thinks is the right path for a link and what the link itself thinks is right If you want the link’s natural path to be used, call GoLink.CalculateStroke() after the layout on each such link.