Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) connecting two container node with elbow connector line while moving node changing the location (Read 7735 times)
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
connecting two container node with elbow connector line while moving node changing the location
Jun 2nd, 2020 at 11:00am
Print Post  
Hi,
connecting two container node with elbow connector line while moving node changing the location of line showing it is not connected to any node.

I want this line is always connected to that node

Please check below image,
  

node_disconnected_from_line.png ( 7 KB | 118 Downloads )
node_disconnected_from_line.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #1 - Jun 2nd, 2020 at 11:44am
Print Post  
Hi,

So it could be an unconnected link. E.g. if you call diagram.setAllowUnconnectedLinks(true) users will be able to draw links without connecting them to nodes. If you are creating links from code, e.g. by parsing some data files, make sure you have set both Origin and Destination link's nodes.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #2 - Jun 3rd, 2020 at 10:35am
Print Post  
actually the problem is link is connect and i also have origin and destination node but when i move to node then this link disconnected automatically from that node
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #3 - Jun 3rd, 2020 at 11:03am
Print Post  
I can't see that happening when I add this to Containers.js example -

Code
Select All
var link = diagram.getFactory().createDiagramLink(ctr[0], ctr[1]);
link.setSegmentCount(3);
link.setShape(MindFusion.Diagramming.LinkShape.Cascading); 



Let me know what I should change there to reproduce.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #4 - Jun 3rd, 2020 at 12:00pm
Print Post  
i am using below property for line,
link.setStrokeDashStyle(MindFusion.Drawing.DashStyle.Solid);
link.setLineAlignment(MindFusion.Diagramming.Alignment.Far);
link.setStrokeThickness(1);
let style = new MindFusion.Diagramming.Style();
style.setBrush(StringHelper.blackColor);
link.setStroke(StringHelper.blackColor);
link.setBrush(StringHelper.blackColor);
link.setHeadStrokeThickness(1);
link.setHeadShapeSize(2);
link.setHeadBrush(StringHelper.blackColor);
link.setHeadStroke(StringHelper.blackColor);


and one more thing i am using elbow connector lines may that's why this happen.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #5 - Jun 3rd, 2020 at 12:13pm
Print Post  
Code
Select All
var link = diagram.getFactory().createDiagramLink(ctr[0], ctr[1]);
link.setSegmentCount(3);
link.setShape(MindFusion.Diagramming.LinkShape.Cascading);
link.setStrokeDashStyle(MindFusion.Drawing.DashStyle.Solid);
link.setLineAlignment(MindFusion.Diagramming.Alignment.Far);
link.setStrokeThickness(1);
let style = new MindFusion.Diagramming.Style();
style.setBrush(StringHelper.blackColor);
link.setStroke(StringHelper.blackColor);
link.setBrush(StringHelper.blackColor);
link.setHeadStrokeThickness(1);
link.setHeadShapeSize(2);
link.setHeadBrush(StringHelper.blackColor);
link.setHeadStroke(StringHelper.blackColor);
 



in Containers.js still does not reproduce, and these properties only affect rendering code anyway. If your app's not setting any other link -related properties, maybe check event handlers like nodeModified / nodeModifying.
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #6 - Jun 8th, 2020 at 9:32am
Print Post  
I checked in nodemodify event on that nothing is code

i observerd that there is origin and destination for link as well as on node outgoing link avaliable.

when i move that node automatically this link is also moved but showing pointing location different,it is  disconnected.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #7 - Jun 8th, 2020 at 10:49am
Print Post  
If the link moves with the node, check if there aren't anchor point coordinates larger than 100 assigned to the node (they are specified as percentage). If using any custom drawing code or custom template, make sure your graphics do fill all of node's Bounds.
« Last Edit: Jun 8th, 2020 at 1:03pm by Slavcho »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #8 - Jun 8th, 2020 at 1:05pm
Print Post  
If you are programmatically assigning new coordinates to the link's ControlPoints list, you should also call link.updateFromPoints in the end. That updates an internal relative-position field, which is used to determine end point positions later when nodes move or resize.
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #9 - Jun 8th, 2020 at 1:22pm
Print Post  
I have attached two attachment
1)Node_Link_Control_Points:This contain selected node link control points
2)Selected_Link_control_points:This contain selected link control points

In above node and link disconnected but showing incoming link and origini data

While comparing i observed only this difference .
Please suggest me what i can do?
  

Node_Link_Control_Points.png ( 24 KB | 134 Downloads )
Node_Link_Control_Points.png
Selected_Link_control_points.png ( 42 KB | 106 Downloads )
Selected_Link_control_points.png
Diagram.png ( 44 KB | 121 Downloads )
Diagram.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #10 - Jun 9th, 2020 at 6:07am
Print Post  
I'm not sure what these screenshots are supposed to show. If they were taken without moving anything but only selecting objects and checking coordinates in debugger, I guess it could mean the node's link is an invisible one, and the clicked link is different that what you expect.

Does that link appear as disconnected only after you move a node, or when you see it initially? If it appears disconnected from the beginning, please post the code that creates it. If disconnecting only when moving, it's probably this -
Quote:
If you are programmatically assigning new coordinates to the link's ControlPoints list, you should also call link.updateFromPoints in the end
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #11 - Jun 9th, 2020 at 11:43am
Print Post  
yes i have used the same updatecontrolpoints but still not fixed this issue.
when i play with node for eg. i am moving node continuously both node origin as well as destination then this issue is reproduced

link only disconnected when i am moving node that is only scenario
« Last Edit: Jun 9th, 2020 at 1:49pm by reshma »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #12 - Jun 9th, 2020 at 2:30pm
Print Post  
Moving the link along with both its origin and destination selected works in my test. Please try editing attached code with your settings until it starts reproducing and send us the result.

Regards,
Slavcho
  

Containers.zip ( 683 KB | 242 Downloads )
containers_001.png ( 181 KB | 129 Downloads )
containers_001.png
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #13 - Jun 10th, 2020 at 7:06am
Print Post  
Can you please try with this scenario just move node with cursor do not put node on modified just moving to node and at last just put that node on one place and change position of another connected node and check link is disconnected
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #14 - Jun 10th, 2020 at 7:25am
Print Post  
something like this?

- click container 1
- move container 1 down
- click container 2
- move container 2 up
- click container 1
- move container 1 up
- click container 2
- move container 2 down

works in my test attached to post above. Have you tried that in the container.js sample or only in your project? If containers.js not working on your end, what browser are you using and does it show any errors in console? Are you using latest version of the diagram in your project?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint