Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Links not connecting correctly (Read 1424 times)
Andrew Ducker
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jan 27th, 2012
Links not connecting correctly
Jan 30th, 2012 at 10:48am
Print Post  
Using a FlowchartLayout, I'm getting an odd situation where one of the links isn't connecting to the end node correctly.

If you look at the attached image you can see that there's an arrow going nowhere in the top right, which should be attached to the node at the far right.

The links are definitely connected correctly - I've looked at the outgoinglinks, etc. and it's all right.

If anyone has suggestions I'd really appreciate it.

Thanks!
  

Workflow.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Links not connecting correctly
Reply #1 - Jan 31st, 2012 at 9:15am
Print Post  
Hi,

This happens because the layout class decides the node before that hanging link is an end node in the flowchart. FlowchartLayout expects that nodes are paired - start node with end node, "start if" with "end if", "start loop" with "end loop" etc. The Arrange method does some recursive decomposition looking for such pairs, and it could skip links when the pairs don't match. You can get some idea for the expected flowchart structure from the WorkflowDesigner and JavaScript sample projects. In this particular case, FlowchartLayout will work correctly if you insert a new node before the upper two nodes to denote the start of an if/switch control block.

If you can't ensure such structure for your diagrams, you could either use LayeredLayout, or do some additional processing for links if FlowchartLayout has omitted them, for example:

Code
Select All
layout.Arrange();

foreach (DiagramLink link in diagram.Links)
{
	PointF p = link.ControlPoints[link.ControlPoints.Count - 1];
	RectangleF r = link.Destination.Bounds;
	r.Inflate(1, 1);
	if (!r.Contains(p))
	{
		link.ReassignAnchorPoints();
		link.Route();
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint