I am a bit new to GoDiagram, so this might be (and hopefully is) a question with a simple answer. I have a GoSubGraph with a rather large font. Whenever I collapse the sub graph, it shifts to make the small yellow collapsing node in the middle of the collapsed graph and label.
Is there a way to keep the top left corner of the graph always on the little yellow square, with both not shifting at all?
That did change the location of the yellow square; however, it is now somewhere near the bottom left corner of the node. It is “better”, but the graphs still shift whenever I expand/collapse them.
It did, however, make my layout a bit wonky (though, it was never perfect to begin with). Perhaps you could help with that too?
I have GoIconicNodes within SubGraphs within SubGraphs within... . I don't particularly care how they are layed out, as long as none are overlapping, both if they expanded or if they are collapsed.
This is what I'm doing now:
[code]
public void LayoutGraph(IGoCollection col1, GoDocument doc) {
foreach (GoObject obj in col1)
{
GoSubGraph sg = obj as GoSubGraph;
if (sg != null) { bool expanded = sg.IsExpanded;
if (!expanded) sg.Expand();
LayoutGraph(sg, doc);
if (!expanded)
sg.Collapse(); }
}
GoLayoutForceDirected layout = new GoLayoutForceDirected();
Logically this seems like it should work -- I actually believe this code is directly from another solution where sombody had a similar problem. My nodes still overlap one another, though. What am I doing wrong?
In this example, the two inner graphs (which are currently collapsed) overlap one another. This overlapping happens inside all of my graphs. Of course I can move the inner graphs so that there is no overlap, but I was wondering if there was a way to make sure they do not overlap at start-up (i.e. without the user having to move them or me having to manually code positions).
Also, two outer graphs can even overlap (though, this only happens after they have been expanded, and only when there are many graphs added to the GoView):