Hi,
I have run in to a little problem that I would like to ask some people about to see if they have any experience. I am using Go Diagram 2.2.1 Web, and GoLayout 2.2.1.
The problem is with GoLayout, we are using a subclassed instance of Force Directed Algorithm. We overload the Spring Length and Spring Stiffness depending on the node type. Generally the output is acceptable, we have a lot of link crossings (but that is not a problem because of the way the data is structured). There is one slight issue, more often than not the “minmum energy” of the system tends to produce a square (i.e the data fits perfectly in to a square go diagram view). Our GoView is not square in shape it is more of a horiztonal A4 size, (much like a wide screen tv).
If the layout fits into a square, it won’t resize to fit optimally in our “widescreen view”. i.e our goview has alot of space on the righthand side after layout.
I though a solution would be to alter:
protected override float ElectricalFieldX(PointF xy) {<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
float border = 50;
float min = 0;
float max = Document.Size.Width;
if (xy.X <= 0)
return 300;
if (xy.X < min + border) {
return (300 / ((min - xy.X) * (min - xy.X)));
}
return 0;
}
I have also have tried,
protected override float ElectricalFieldX(PointF xy) {
float min = 0;
return (1/ ((min - xy.X) * (min - xy.X)));
}
which I thought would set electrical fields proportional to the center of the document however it doesn't have any effect. :(
Does any one have any ideas on how to solve this problem.
Thanks,
Paul