Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CreateDiagramLink for TableNode with option LeftInRightOut (Read 2239 times)
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
CreateDiagramLink for TableNode with option LeftInRightOut
Apr 26th, 2022 at 9:34am
Print Post  
Hi,

Thanks to Diagramming for JavaScript, V4.1, it is possible to
create diagram links between table node rows (by the createDiagramLink method).

How can we create links between table node rows with the extra specification that:
- all incoming links should connect with the table node at the left side,
- and all outgoing links should connect with the table node at the right side?

I know that by AnchorPattern a property LeftInRightOut exists, but this does not apply on the createDiagramLink method..

Thanks in advance.

MF.

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: CreateDiagramLink for TableNode with option LeftInRightOut
Reply #1 - Apr 26th, 2022 at 12:27pm
Print Post  
Hi,

On some platforms we have row.anchorPattern property that would be applied in this situation, but it's not available in JS diagram yet. You could adjust start/end points after creating a link:

Code
Select All
DiagramLink.prototype.rightToLeft = function()
{
	var start = this.startPoint;
	start.x = this.origin.bounds.right();
	this.startPoint = start;

	var end = this.endPoint;
	end.x = this.destination.bounds.left();
	this.endPoint = end;

	this.updateFromPoints();
}

var l = diagram.factory.createDiagramLink(table1, 1, table2, 3);
l.rightToLeft(); 



and e.g. call the method also from linkCreated event handler for links drawn by users.

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


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Re: CreateDiagramLink for TableNode with option LeftInRightOut
Reply #2 - May 23rd, 2022 at 12:40pm
Print Post  
Yes, it works!
Thank you so much for your fast reply!

Kind regards
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint