Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic setDestination for link to link connection (Read 1910 times)
Jessenberg
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 27
Joined: Dec 20th, 2021
setDestination for link to link connection
Jan 17th, 2022 at 6:48am
Print Post  
Hi there, so i'm working on a diagram translation website and i was wondering can you set the destination of a link to another link?

this is the snipet of my code:
Code (Javascript)
Select All
 links.forEach((link) => {
          const origin = link.getOrigin(); //get the origin
          const destination = link.getDestination(); //get the destination

          const originIndex = nodes.findIndex((node) => node === origin); // get the index of the origin node
          const destinationIndex = nodes.findIndex(
            (node) => node === destination //get the index of destination node
          );
          link.setOrigin(newNodes[originIndex]);
          link.setDestination(newNodes[destinationIndex]); 



as you can see the link will point to the translated node after the translation process, and when i read the documentation it is said that the link can only be set to another node, so is it possible for the link to be set to another link?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: setDestination for link to link connection
Reply #1 - Jan 17th, 2022 at 7:18am
Print Post  
Hi,

You can't connect link to another link. As we discussed in your 'branching link' topic, you could insert a small helper node and new links to represent the three-way connection -

https://mindfusion.eu/Forum/YaBB.pl?num=1641012412/3#3

Alternatively, you could keep two links with two segments each pointing to target node, and move their middle and last control points to shared positions to make the last segments overlap, representing a merge or branch.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Jessenberg
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 27
Joined: Dec 20th, 2021
Re: setDestination for link to link connection
Reply #2 - Jan 17th, 2022 at 10:14am
Print Post  
ahh yes, i thought it was the shape of the link branch that cannot be achieved not the actual link to link connection, i've allow the link to be created without any connection to another node for now, thank you for your answer
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint