Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FlowchartLayout and crossed-over anchored links (Read 3627 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
FlowchartLayout and crossed-over anchored links
Jul 31st, 2014 at 1:54pm
Print Post  
Hi,

I have a graph with three ShapeNodes (OR gates, with two inputs and one output), say A, B & C, each with defined anchor points. A and B are connected to C through links on different anchor points of C. When I run the FlowchartLayout algorithm, A & B get arranged in a column, and C in another, and that is good for my purposes. However, the links are crossed over. Is there something that I can do to avoid this? One solution would be for the algorithm to swap the locations of A & B, to reduce crossings.

Thanks in advance,
-Mihai

PS: I never get notified by email when there are replies to my topics, even though I have checked the corresponding topic option. Thoughts?
« Last Edit: Jul 31st, 2014 at 3:53pm by mihai »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowchartLayout and crossed-over achnored links
Reply #1 - Jul 31st, 2014 at 3:20pm
Print Post  
Hi,

Could you attach the diagram xml file? Check if your email software's spam filter isn't blocking the messages.

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



Posts: 86
Joined: Jul 29th, 2009
Re: FlowchartLayout and crossed-over achnored links
Reply #2 - Jul 31st, 2014 at 3:51pm
Print Post  
Hi Stoyan,

I'll have to first simplify the diagram to be allowed to share it. No thoughts otherwise?
On the emails, it's the span filter... it might be something on the server side (sender).

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowchartLayout and crossed-over anchored links
Reply #3 - Aug 1st, 2014 at 6:06am
Print Post  
Hi Mihai,

I think branches under a node in FlowchartLayout are arranged in the order of the node's OutgoingLinks collection. The actual location of their anchor points is not considered at this time even if you run with Anchoring.Keep option. So if the problem is that branches are placed under incorrect anchor points, you might try sorting the links for all nodes. E.g. if OriginAnchor values correspond to left-to-right positions, you could sort like this:

Code
Select All
node.OutgoingLinks.Sort((l1, l2) => l1.OriginAnchor.CompareTo(l2.OriginAnchor)); 



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



Posts: 86
Joined: Jul 29th, 2009
Re: FlowchartLayout and crossed-over anchored links
Reply #4 - Aug 1st, 2014 at 6:13am
Print Post  
Hi Stoyan,

Understood on the implementation of FlowchartLayout.

I do use the Keep option, because I need the links to stay in their original anchor points. So I can't re-order the links like that, unfortunately.

Is there any hope, given this?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowchartLayout and crossed-over anchored links
Reply #5 - Aug 1st, 2014 at 6:22am
Print Post  
Hi Mihai,

The Sort code won't move links away from their anchor points, but will only change their position in the collection to correspond to anchor points' order. That should lead to FlowchartLayout placing the branches relative to anchor positions.

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



Posts: 86
Joined: Jul 29th, 2009
Re: FlowchartLayout and crossed-over anchored links
Reply #6 - Aug 1st, 2014 at 7:09am
Print Post  
Yes, but am I really sorting, since in my example I only have one item in each A & B's OutgoingLinks?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowchartLayout and crossed-over anchored links
Reply #7 - Aug 1st, 2014 at 7:28am
Print Post  
No, it would only help if the two links were pointing from C to A/B. Perhaps you could run LayeredLayout and then swap positions of nodes in layers according to LayeredLayout.Statistics if you detect their order does not match anchor points. We'll see if we can add built-in support for next release.
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: FlowchartLayout and crossed-over anchored links
Reply #8 - Aug 1st, 2014 at 10:00am
Print Post  
Quote:
Perhaps you could run LayeredLayout and then swap positions of nodes in layers according to LayeredLayout.Statistics if you detect their order does not match anchor points.

Yes, I will try that.

Quote:
We'll see if we can add built-in support for next release.

That would be great! And indeed, the node-layout-algorithms should not ignore the anchor points.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint