Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic The links in my graph are crossing nodes borders (Read 2371 times)
LGK
YaBB Newbies
*
Offline



Posts: 30
Location: Boston, MA
Joined: Mar 29th, 2012
The links in my graph are crossing nodes borders
Jun 11th, 2012 at 3:14pm
Print Post  
I have the following requirement - the orientation of the links in my graph must always render horizontally and vertically (up/down and left/right). I can easily achieve this with the "Flowchart" layout. Unfortunately, in certain situations, some links end up crossing the nodes' borders (please see the attached screenshot).

Here's some useful information and details:
  • I'm currently running an unofficial release of the NetDiagram package (MindFusion.Diagramming.dll v5.8.0.36989) that you built for me that exposes ClientSideMode support for "SvgImage". The graph below is rendered in "SvgImage" client-side mode.
  • The nodes in the below graph are TableNode's and this is the code that sets up each node:

Code
Select All
TableNode node = PFVDiagram.Diagram.Factory.CreateTableNode(0, 0, 0, 0, 2, 6);
node.Id = some_id;
node.Caption = String.Empty;
node.CaptionHeight = 0f;
node.CellFrameStyle = CellFrameStyle.None;
node.ConnectionStyle = TableConnectionStyle.Table;
 



  • And this is how I set up the "Flowchart" layout:

Code
Select All
FlowchartLayout l3 = new FlowchartLayout();
l3.Anchoring = Anchoring.Reassign;
l3.Arrange(PFVDiagram.Diagram);
 



I would really appreciate it if you could either suggest improvements to my code, or perhaps suggest another layout algorithm that would satisfy my requirements and result in a nicely rendered graph.

Let me know if there's anything else that I need to share with you regarding my implementation.

Thanks in advance!
  

Flowchart_in_SVG_mode.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: The links in my graph are crossing nodes borders
Reply #1 - Jun 11th, 2012 at 5:30pm
Print Post  
This version should fix that:
https://mindfusion.eu/_temp/netdiag_fcl.zip

However FlowchartLayout is designed to work only with a special kind of graphs where start loop/switch nodes have matching end nodes; for an example see the JavaScript sample project from the Windows Forms version (https://www.mindfusion.eu/FCNetDemo.zip). If you need to arrange any kind of graph, better use LayeredLayout, or if your graphs are trees, use TreeLayout.

I hope that helps,
Stoyan
« Last Edit: Jun 12th, 2012 at 8:08am by Stoyo »  
Back to top
 
IP Logged
 
LGK
YaBB Newbies
*
Offline



Posts: 30
Location: Boston, MA
Joined: Mar 29th, 2012
Re: The links in my graph are crossing nodes borders
Reply #2 - Jun 11th, 2012 at 6:05pm
Print Post  
Thank you very much!
« Last Edit: Jun 11th, 2012 at 8:51pm by LGK »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint