Answered by:
Graph Bounding Box

Hi Lev,
I modified the sample project DrawingFromGeometryGraphSample such that it only has 1 node (i.e. the ellipse) and no edges. After calling graph.CalculateLayout, I noticed the bounding box for the graph have UpperLeft and LowerRight coordinates of (20.5, 530.5) and (20.5 499.5) respectively. How can I make the layout system:
1. Utilize positive coordinates only.
2. Optimize space usage (instead of laying out the ellipse all the way out at Y = 530.5, have it layed out somewhere closer to Y = 0)
Thank you
 Edited by exx Wednesday, December 28, 2011 10:57 PM
Question
Answers

Please use the method GeometryGraph.Translate to move the graph into the positive quadrant.
It would be graph.Translate(graph.BoundingBox.LeftBottom). If you want only positive coordinates then you need to shift a bit more.
You are right; Node.Padding is not used!
Thanks,
Lev
Lev Nachmanson Marked as answer by Lev NachmansonOwner Thursday, December 29, 2011 7:01 PM
All replies

On a related note, how does one use the Node.Padding property? In the same DrawingFromGeometryGraphSample, setting the Padding property on the ellipse:
Node a = new Node("a", new Ellipse(w, h, new P()));
a.Padding = 100;does not seem to do anything.
Thanks

Please use the method GeometryGraph.Translate to move the graph into the positive quadrant.
It would be graph.Translate(graph.BoundingBox.LeftBottom). If you want only positive coordinates then you need to shift a bit more.
You are right; Node.Padding is not used!
Thanks,
Lev
Lev Nachmanson Marked as answer by Lev NachmansonOwner Thursday, December 29, 2011 7:01 PM
