Page Index Toggle Pages: 1 ... 8 9 [10] 11 12 ... 21 Send TopicPrint
Locked Topic Link between two nodes (Read 157293 times)
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #135 - Jul 3rd, 2014 at 5:14am
 
I am using following code as well as I have cleared browser cache and added latest dll still there are no smooth bends.

sFileName = Request.QueryString[0];
DiagramView1.Diagram = new Diagram();
DiagramView1.LoadFromXml(Server.MapPath(sFileName));
MindFusion.Diagramming.Layout.LayeredLayout dl = new MindFusion.Diagramming.Layout.LayeredLayout();
dl.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical;
dl.EnforceLinkFlow = true;
dl.LayerDistance = 20;
dl.NodeDistance = 140;
DiagramView1.Diagram.RoundedLinks = true;
DiagramView1.Diagram.RoundedLinksRadius = 5;
DiagramView1.Diagram.LinkCrossings = LinkCrossings.Arcs;
var n = DiagramView1.Diagram.Nodes;
for (int i = 0; i < 10; i++)
{
DiagramView1.Diagram.Factory.CreateShapeNode(0, 0, 10, 10);
for (int j = 0; j < i; j++)
DiagramView1.Diagram.Factory.CreateDiagramLink(n[j], n[i]);
}
new MindFusion.Diagramming.Layout.LayeredLayout().Arrange(DiagramView1.Diagram);
DiagramView1.CanvasVirtualScroll = true;
//dl.Arrange(DiagramView1.Diagram);
DiagramView1.Diagram.ResizeToFitItems(10);
  

DFD.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #136 - Jul 3rd, 2014 at 5:35am
 
Quote:
I am applying white color to diagram background using backbrush property still its nt white when exported to PDF format.


The default value set in ASPX will be lost when you call LoadFromXml. Either add a Diagram/Properties/BackBrush element to the XML files you generate, or set BackBrush = White before you export to PDF.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #137 - Jul 3rd, 2014 at 5:47am
 
Quote:
I am using following code  as well as I have cleared browser cache and added latest dll still there are no smooth bends


RoundedLinks works from what I can see in your screenshot. For LinkCrossings try also setting the CrossingRadius property in code. It might be reset to 0 when it's missing in your XML files, and that would disable the crossing arcs.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #138 - Jul 3rd, 2014 at 5:54am
 
Stoyo wrote on Jul 3rd, 2014 at 5:47am:
Quote:
I am using following code as well as I have cleared browser cache and added latest dll still there are no smooth bends


RoundedLinks works from what I can see in your screenshot. For LinkCrossings try also setting the CrossingRadius property in code. It might be reset to 0 when it's missing in your XML files, and that would disable the crossing arcs.



I am loading XML file first and then applying CrossingRadius property, so there is no concern of XML file.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #139 - Jul 3rd, 2014 at 5:58am
 
Stoyo wrote on Jul 3rd, 2014 at 5:35am:
Quote:
I am applying white color to diagram background using backbrush property still its nt white when exported to PDF format.


The default value set in ASPX will be lost when you call LoadFromXml. Either add a Diagram/Properties/BackBrush element to the XML files you generate, or set BackBrush = White before you export to PDF.


Please mention the code to apply white background before exporting to PDF.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #140 - Jul 3rd, 2014 at 6:12am
 
Quote:
I am loading XML file first and then applying CrossingRadius property, so there is no concern of XML file.


Your code above does not show CrossingRadius being set, only RoundedLinksRadius.

Quote:
Please mention the code to apply white background before exporting to PDF.


diagram.BackBrush = new MindFusion.Drawing.SolidBrush(Color.White);
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #141 - Jul 3rd, 2014 at 6:49am
 
Stoyo wrote on Jul 1st, 2014 at 10:21am:
Quote:
but still there is no change in diagram


You will see a change only if the links contained any bends with the old code. With LayeredLayout links between adjacent layers are always straight lines and do not contain any bends; in that case you will see rounded bends only for links that are at least three-layers long, where their segments meet in intermediate layers.

Quote:
How did you decide link between 2 nodes is from center of 2 nodes or at left side or at bottom side, what data you need for that.


You could control that via node.AnchorPattern property. Set it to TopInBottomOut for example to center all in/out links at respective node side.


Can you tell me how to implement AnchorPattern.i.e how to set its value.
MindFusion.Diagramming.AnchorPattern = ?
« Last Edit: Jul 3rd, 2014 at 8:19am by shrinivas »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #142 - Jul 3rd, 2014 at 8:27am
 
In code:
Code
Select All
node.AnchorPattern = AnchorPattern.TopInBottomOut; 



or add this to XML:
Code
Select All
<Node...>
    <AnchorPattern Id="TopInBottomOut" /> 



Set the layout's Anchoring property to use the specified points.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #143 - Jul 3rd, 2014 at 8:52am
 
Hi,

I have added
<Node...>
<AnchorPattern Id="TopInBottomOut" />

still its not coming as I want, attached XML as well as screen shot.

I want lines like in red color instead of lines those in black color, so that it points to proper center of node.
« Last Edit: Jul 3rd, 2014 at 12:12pm by shrinivas »  

DFD.jpg (Attachment deleted)
s2tadmin_DataFlowDiagram_30Jun2014_100212AM.txt (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #144 - Jul 3rd, 2014 at 5:46pm
 
For orthogonal links better use OrthogonalLayout, it will place the nodes at more suitable positions to support the link distribution with less bends:

Code
Select All
var ol = new OrthogonalLayout();
ol.Padding = 20;
ol.Arrange(diagram);
 





If you prefer LayeredLayout, setting AnchorPatterns won't help you much when you want connection positions to depend on the number of links. You can get something close to the red links in your image with this code instead:

Code
Select All
var dl = new LayeredLayout();
dl.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical;
dl.EnforceLinkFlow = true;
dl.LayerDistance = 20;
dl.NodeDistance = 140;
dl.Arrange(diagram);

foreach (var n in diagram.Nodes)
{
	n.AnchorPattern = null;
	n.ReassignUnanchoredLinks();
}
diagram.RouteAllLinks(); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #145 - Jul 4th, 2014 at 4:27am
 
Thanks,

Its working properly for almost all diagrams but still there is overlapping in some diagrams, tell me some properties so that i can solve this easily from OrthogonalLayout .
  

BRLD.jpg (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #146 - Jul 4th, 2014 at 5:03am
 
Please attach the diagram XML file.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #147 - Jul 4th, 2014 at 6:29am
 
Stoyo wrote on Jul 4th, 2014 at 5:03am:
Please attach the diagram XML file.

  

s2tadmin_BRLinkageDiagram_ActivityReportBEF_04Jul2014_115729AM.txt (Attachment deleted)
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #148 - Jul 4th, 2014 at 6:51am
 
shrinivas wrote on Jul 4th, 2014 at 6:29am:
Stoyo wrote on Jul 4th, 2014 at 5:03am:
Please attach the diagram XML file.




also I have attached some other diagrams please check, here also same problem.
  

TreeHouse.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #149 - Jul 4th, 2014 at 8:25am
 
Right, OrthogonalLayout handles two-node subgraphs separately and it did not consider nodes' size, only Padding value. This version should fix that:

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

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 ... 8 9 [10] 11 12 ... 21
Send TopicPrint