I have some layouts that use “branched links” (i.e., link.Orthogonal = true). A problem I am running into is where the layout of the link choose to move the place where the link branches between nodes. Is there a way to push that further/closer?
I think this is what you want:
More generally, you can override GoLink.GetMidOrthoPosition.
The GraphLink class does this in the OrgCharter sample.
When does GetMidOrthoPosition() get called? Is it something called during layout that happens or is it something I would need to force calling?
Also, what does this mean?
- Whether the mid-position is along the vertical axis or horizontal
Tried that and it didn’t seem to do anything…
Can someone answer the “vertical” question… And explain if I need to force call this, as it does not seem to work.
Check the GraphLink sample in GraphDoc.cs in the OrgCharter sample.
OK So I am going to answer my own questions here for posterities sake…
First off, let me say, some of the object hierarchy in Go needs to be adjusted a bit. I spent a good amount of time not able to get this to work because my “link” was a subclass of GoLabeledLink" which is NOT a GoLink. Duh! So of course my overridden method is not getting called.
Second, vertical means the “link” is running vertical (not horizontal). The entry in the document saying “Whether the mid-position is along the vertical axis or horizontal” is very vague and misleading. Since the whole API in GetMidOrthoPosition() consists of float vals, and not points, what is the “mid position” is unclear. You actually have to go read some of the associated api’s to get a clearer understanding.
I don’t see how you could have tried to override GoLabeledLink.GetMidOrthoPosition without getting a compiler error, since that method is not defined at all on GoLabeledLink.
Usually the way “it doesn’t work” happens is that one subclasses GoLink and overrides the method, but then one doesn’t actually use (and instantiate) the new link class.
Regarding the documentation: thanks for the comment – we can always improve our documentation.