I am using a Text Node with a Diamond shape and the text node has 4 ports(a conditional)
From the right port of the conditional I have a link to another node and from the bottom port of the conditional I have a link to a third node. Nothing is linked to the left or top ports of the conditional.
I also have a link which goes from the bottom of the node to the right of the conditional to the top port of the node on the bottom of the conditional. (I need to represent an AND condition)
What is happening is that if I call the PerformLayout function a few times in a row, the node on the right moves further right with each call to the PerformLayout function.
Why is that happening.
I tried many different things, I tried calling the ComputeRoute() and CalculateStroke but no result.
I need to be able to call Perform Layout more than one time.
The funny thing is that if I remove the link going form the bottom of the node to the right of the conditional to the top of the node at the bottom of the conditional , everything works well and PerformLayout() renders the same result no matter how many times I call it.
Add reference and using for Northwoods.Go.Layout. And if you want to be fancy replace the “Save All” menu text with “Layout”.
Build a graph in the following format:
A
|
C - B
| |
D - E
Not sure link direction matters, but A->B->C->D->E and B->E
Layout.
Layout again. Notice the graph layout has changed. Slightly, typically one link is moved, but a problem when I am trying to implement a “Restore to default layout” feature.
Perhaps I’m not getting the same behavior as you, but I notice that a subsequent layout just moves the nodes by a very small fraction of a pixel. It’s so small that you cannot see it.
I am definitely getting noticeable movement of the second layout. On the order of several pixels.
Perhaps the initial graph layout makes a difference. I’ve sent the initial layout, after first layout and after second layout graphs from the FlowCharter example to gosales.
Also sent the code change to FlowCharter->MainForm().
Thanks for sending the files. OK, for that particular graph (InitialLayout.dat), I get the behavior I think you are talking about.
If you don’t set the PackOption property, it doesn’t happen. In fact, I wouldn’t bother to set any of the options except for the direction. That doesn’t mean you’ll always get the same results, though.
The real point I think is that none of the layout algorithms are guaranteed to be produce the same results independent of how the initial graph was constructed.