Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) ContainerNode layout constraints? (Read 8798 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
ContainerNode layout constraints?
Aug 17th, 2009 at 10:13am
Print Post  
Hi,

I have a graph with far more links than nodes and with more than one link between two nodes. I got successful to nicely layout it using the FlowchartLayout (w/ LinkPadding) followed by OrthogonalRouter - congrats there!

However, as soon as I (programatically) add all my nodes to a ContainerNode, the links start "joining" (as in having common control points) and the graph becomes unreadable. BTW, I use Arrange() on a node-collection that does not contain the container node.

Is the ContainerNode imposing a layout constraint? What can I do to make the layout algorithm work the same as when I had no container-node?

As a side note, ContainerNode.UpdateBounds() seems to ignore the links and I end up with links getting out and back into the container node. Any pointers here?

Thanks in advance,
-Mihai

PS: A trick is to detach the inner-nodes from the container-node right before running the layout algorithm and attaching them back afterwards. Still, there must be a better way.
« Last Edit: Aug 17th, 2009 at 11:16am by mihai »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNode layout constraints?
Reply #1 - Aug 17th, 2009 at 12:00pm
Print Post  
Hi Mihai,

Have you also added the links to the item collection passed to Arrange?

We'll add a boolean argument to UpdateBounds to let you include the links too. At this time you might loop over the links and create a union of their bounding rectangle with the container's Bounds.

Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #2 - Aug 17th, 2009 at 12:14pm
Print Post  
Hi Stoyo,

Thanks for the fast reply!

> Have you also added the links to the item collection passed to Arrange?
Yes I did. Thoughts?

> We'll add a boolean argument to UpdateBounds to let you include the links too. At this time you might loop over the links and create a union of their bounding rectangle with the container's Bounds.
Cool, thanks! I think I'll try that workaround in the meantime.

Sincerely,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNode layout constraints?
Reply #3 - Aug 17th, 2009 at 3:07pm
Print Post  
Hi Mihai,

Could you email us a sample diagram saved as xml along with your layout code?

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #4 - Aug 18th, 2009 at 6:59am
Print Post  

Hi Stoyan,

Let me strip down the code and get back to you.

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #5 - Aug 18th, 2009 at 10:51am
Print Post  
Hi Stoyan,

Email sent.

Thanks in advance,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNode layout constraints?
Reply #6 - Aug 19th, 2009 at 11:43am
Print Post  
Hi Mihai,

This version should fix the problem:
https://mindfusion.eu/_beta/fcnet_orthrouter.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #7 - Aug 19th, 2009 at 12:09pm
Print Post  
Hi Stoyan,

Perfect - it works!

Thanks much,
-Mihai
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #8 - Aug 20th, 2009 at 11:22am
Print Post  
Hi Stoyan,

I have bumped into a somewhat related problem: if I move/resize the ContainerNode (e.g. to contain all the links as well), the links start joining again - and the OrthogonalRouter's job is lost.

Is there any way to perhaps freeze the layout of the inner elements of the ContainerNode, while being moved/resized?

BTW, the ContainerNode.UpdateBounds() method does not exhibit this problem.

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNode layout constraints?
Reply #9 - Aug 20th, 2009 at 1:27pm
Print Post  
Hi,

Disable the Dynamic and AutoRoute link properties to prevent that.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #10 - Aug 21st, 2009 at 5:26am
Print Post  
Hi Stoyan,

> Disable the Dynamic and AutoRoute link properties to prevent that.
That certainly helps. However,

> We'll add a boolean argument to UpdateBounds to let you include the links too. At this time you might loop over the links and create a union of their bounding rectangle with the container's Bounds.
if for that I have to extend the container to the left/top, how do I go about that? Simply setting the bounds won't do, as that'll move the contained items as well, so in effect I won't be extending the container (to the left/top).

Of course, it would definitely be more straightforward & portable if UpdateBounds() would have that option to include the links as well. Wink

Thanks in advance,
-Mihai
« Last Edit: Aug 24th, 2009 at 9:09am by mihai »  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #11 - Aug 27th, 2009 at 7:21am
Print Post  
Hi Stoyan,

Do you have any further thoughts on this one?

Thanks in advance,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ContainerNode layout constraints?
Reply #12 - Aug 27th, 2009 at 10:41am
Print Post  
Hi Mihai,

This version adds an UpdateBounds(bool includeLinks) method to ContainerNode:

https://mindfusion.eu/_beta/fcnet532.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #13 - Aug 27th, 2009 at 11:09am
Print Post  
Hey guys, you rock! Grin
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: ContainerNode layout constraints?
Reply #14 - Sep 9th, 2009 at 8:14am
Print Post  
Hi Stoyan,

Are the attached items to the ContainerNode's items considered by the UpdateBounds algorithm?
I mean, as an example:
  • "A" is ContainerNode;
  • "B" is a DiagramNode inside "A";
  • "C" is a DiagramNode attached to "B".
UpdateBounds seems to leave "C" outside of "A".

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint