Page Index Toggle Pages: 1 ... 11 12 [13] 14 15 ... 21 Send TopicPrint
Locked Topic Link between two nodes (Read 176104 times)
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #180 - Jul 11th, 2014 at 4:27am
 
shrinivas wrote on Jul 10th, 2014 at 6:05am:
Actually I got this code from your team but its not working i mean compiler time errors,
Adding this code to C#.


var diagram = $find("diagram");

var AnchorPattern = MindFusion.Diagramming.AnchorPattern;
var ioPattern = new AnchorPattern(
[
new AnchorPoint(0, 50, true, true, MarkStyle.None),
new AnchorPoint(100, 50, true, true, MarkStyle.None)
]);
for (var n = 0; n < diagram.nodes.length; n++)
{
var node = diagram.nodes[n];
node.setAnchorPattern(ioPattern);
}

var layeredLayout = MindFusion.Graphs.LayeredLayout;
layout = new layeredLayout();
layout.direction = MindFusion.Graphs.LayoutDirection.LeftToRight;
layout.nodeDistance = 8;
layout.layerDistance = 20;
layout.anchoring = MindFusion.Graphs.Anchoring.Reassign;
diagram.arrange(layout);

This should avoid crossings, but if you still want to bend the links, call
their route() method after arrange -

for (var l = 0; l < diagram.links.length; l++)
{
var link = diagram.links[l];
link.route();
}


Can you tell me how to implement same in C# ?.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #181 - Jul 11th, 2014 at 4:44am
 
shrinivas wrote on Jul 11th, 2014 at 4:14am:
I have attached XML, VISIO and PDF.

There is problem in VISIO files again here smooth bends are not present and crossing of links.


Can you please reply ASAP.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #182 - Jul 11th, 2014 at 8:18am
 
Quote:
There is problem in VISIO files again here smooth bends are not present and crossing of links.


Recent versions of Visio re-route connectors when opening a file and won't preserve what you see in the diagram control. You can disable that by setting VisioExporter.DynamicsOff = true, which adds a corresponding <DynamicsOff> element to the VDX file and should make Visio use link control point coordinates as set by the layout class.

The exporter creates high-level connector and shape Visio objects, and not graphic primitives like arcs and line segments as in PDF, so you still won't see rounded bends and bridges. Our developer will check if there's some option to enable them from Visio XML.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #183 - Jul 11th, 2014 at 8:22am
 
It seems Visio supports a LineJumpStyle element for drawing arcs at link crossing points, so you might try adding that to the Visio XML as shown here:
http://msdn.microsoft.com/en-us/library/aa722124(v=office.12).aspx

We'll try to add built-in support for next release.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #184 - Jul 11th, 2014 at 8:46am
 
Stoyo wrote on Jul 11th, 2014 at 8:18am:
Quote:
There is problem in VISIO files again here smooth bends are not present and crossing of links.


Recent versions of Visio re-route connectors when opening a file and won't preserve what you see in the diagram control. You can disable that by setting VisioExporter.DynamicsOff = true, which adds a corresponding <DynamicsOff> element to the VDX file and should make Visio use link control point coordinates as set by the layout class.

The exporter creates high-level connector and shape Visio objects, and not graphic primitives like arcs and line segments as in PDF, so you still won't see rounded bends and bridges. Our developer will check if there's some option to enable them from Visio XML.


Thanks,
It works but rounded bends are not coming as per your comment.
please let me know if your developers got any solution.
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #185 - Jul 11th, 2014 at 8:47am
 
Stoyo wrote on Jul 11th, 2014 at 8:22am:
It seems Visio supports a LineJumpStyle element for drawing arcs at link crossing points, so you might try adding that to the Visio XML as shown here:
http://msdn.microsoft.com/en-us/library/aa722124(v=office.12).aspx

We'll try to add built-in support for next release.


Actually I am not using VISIO XML, Is there any other way to implement Jumps.

Following is code that I am using o export VISIO file.
MindFusion.Diagramming.Export.VisioExporter VISI = new         MindFusion.Diagramming.Export.VisioExporter();
VISI.TemplatePath = Server.MapPath(@"~\VisioExport.vxt");
VISI.DynamicsOff = true;
String path1 = Server.MapPath(@"~\VISIO\") + System.IO.Path.GetFileNameWithoutExtension(sFileName) + ".VDX";
VISI.Export(DiagramView1.Diagram, path1);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #186 - Jul 11th, 2014 at 11:24am
 
Visio VDX files contain plain text XML, you can insert that element there using the .NET XmlDocument class. We'll try to add built-in support next week.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #187 - Jul 11th, 2014 at 4:54pm
 
Quote:
Can you tell me how to implement same in C# ?.


It should look like this in C#:

Code
Select All
var ioPattern = new AnchorPattern(new [] {
	new AnchorPoint(0, 50, true, true, MarkStyle.None),
	new AnchorPoint(100, 50, true, true, MarkStyle.None)
});
foreach (var node in diagram.Nodes)
   node.AnchorPattern = ioPattern;

var layout = new LayeredLayout();
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal;
layout.NodeDistance = 8;
layout.LayerDistance = 20;
layout.Anchoring = Anchoring.Reassign;
layout.Arrange(diagram);

foreach (var l in diagram.Links)
	l.Route(); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #188 - Jul 14th, 2014 at 8:47am
 
This version adds build-in support for handling double links to OrthogonalLayout:
https://mindfusion.eu/_beta/orthlt_doubles.zip

You can remove the code that detects doubles and copies their points now. You still need to keep the code that sets self-loop links' paths. By default the layout preserves their initial shape (e.g. a loop above the node), but it looks strange with the random points you are adding to generated XML files, so:

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

foreach (var li in diagram.Links)
{
    if (li.Origin == li.Destination)
    {
        var p = li.Origin.Bounds.Location;
        li.ControlPoints.Clear();
        li.ControlPoints.Add(new PointF(p.X, p.Y + 2));
        li.ControlPoints.Add(new PointF(p.X - 5, p.Y + 2));
        li.ControlPoints.Add(new PointF(p.X - 5, p.Y - 5));
        li.ControlPoints.Add(new PointF(p.X + 5, p.Y - 5));
        li.ControlPoints.Add(new PointF(p.X + 5, p.Y));
        li.UpdateFromPoints(false, true);
    }
} 





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 #189 - Jul 15th, 2014 at 4:31am
 
I got error in while rendering, I have attached image file please check.
  

Exception_001.jpg (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 #190 - Jul 15th, 2014 at 4:37am
 
Stoyo wrote on Jul 14th, 2014 at 8:47am:
This version adds build-in support for handling double links to OrthogonalLayout:
https://mindfusion.eu/_beta/orthlt_doubles.zip

You can remove the code that detects doubles and copies their points now. You still need to keep the code that sets self-loop links' paths. By default the layout preserves their initial shape (e.g. a loop above the node), but it looks strange with the random points you are adding to generated XML files, so:

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

foreach (var li in diagram.Links)
{
    if (li.Origin == li.Destination)
    {
        var p = li.Origin.Bounds.Location;
        li.ControlPoints.Clear();
        li.ControlPoints.Add(new PointF(p.X, p.Y + 2));
        li.ControlPoints.Add(new PointF(p.X - 5, p.Y + 2));
        li.ControlPoints.Add(new PointF(p.X - 5, p.Y - 5));
        li.ControlPoints.Add(new PointF(p.X + 5, p.Y - 5));
        li.ControlPoints.Add(new PointF(p.X + 5, p.Y));
        li.UpdateFromPoints(false, true);
    }
} 



http://mindfusion.eu/_samples/orthogonal_doubles.png

I hope that helps,
Stoyan


Thanks, Its working can u please keep some more distance between two parallel lines, so that It looks better.
and another one issue is there one line is not bend as well as 2 arrows are not proper see the attached diagram, which is proper previously but not with latest version
« Last Edit: Jul 15th, 2014 at 5:59am by shrinivas »  

XMLwithPDF_002.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 #191 - Jul 15th, 2014 at 7:31am
 
Quote:
I got error in while rendering, I have attached image file please check.


Diagramming.js requires MicrosoftAjax.js to be loaded first, that's where Type is defined. Either load it explicitly from <script> tag before the <DiagramView> element, or add a <ScriptManager> to the page, which will load it automatically.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #192 - Jul 15th, 2014 at 7:39am
 
Quote:
Thanks, Its working can u please keep some more distance between two parallel lines, so that It looks better.


Set a larger OrthogonalLayout.RepeatingLinksPadding value.

Quote:
and another one issue is there one line is not bend as well as 2 arrows are not proper see the attached diagram, which is proper previously but not with latest version


These are self-loop links with same origin and destination nodes. Read again my post above about keeping the code that sets their 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 #193 - Jul 15th, 2014 at 1:45pm
 
Still your latest version missing of Jumps and smooth bends in VISIO.

Can you tell me when you are going to release your next version which includes our requirement.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #194 - Jul 16th, 2014 at 10:33am
 
This build adds some support for both LinkCrossings and RoundedLinks:
https://mindfusion.eu/_beta/netdiag53.zip

Unfortunately Visio does not display the crossing jumps when DynamicsOff is enabled, so you will have to disable it and lose the paths set by OrthogonalLayout if you want to see the arcs in Visio. RoundedLinks appears to work fine even with DynamicsOff enabled.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 ... 11 12 [13] 14 15 ... 21
Send TopicPrint