Hi Team,
I’m working on a BPMN tool using GoJs in an Angular 6 application.
I’ve many nodes (Shape - Circle) created in my canvas and they have their own properties popup (created with contextMenu). That properties popup is a separate component and has simple form. I want to draw links (dynamically) from a node depending upon some variable value (variable value = number of links) on form submit of that popup.
So, I’m just starting a trxn and add one link that has static points array.
this.diagram.startTransaction("Add Links");
this.diagram.model.addLinkData({
from: 'START',
points: [-243,-120,-233,-120,-205,-120,-205,-200,-177,-200,-167,-200]
});
this.diagram.commitTransaction("Add Links");
But the problem is - there will be multiple links depending upon that variable and I’ve to create the points array by computing the x, y coordinates of that node. I’m able to get the location of the node (this.diagram.findNodeForKey(‘START’).data.location).
But how to determine x,y coordinates and generate points array?
Kindly help me to solve this problem.
Thanks in advance!