Is there any function for links like for nodes we have where in we can add node dynamically using diagram.model.addNodeData?
I need a function where I can add links dynamicallly between nodes which are in the form
Great Thanks that worked.
Not sure why if my dropped node id on diagram is number:1 and if I use to draw a link from this node
I need to pass fromPortId: -1 not as 1 simply why I need to prefix - in the fromPortId and in toPortId.
I use angular 2 TS
I tried console.log the values of the node data.
the node unique id:came out to be 1 while adding to node data of diagram. But when i do a console.log on link drawn event the from: data came out to be -1 in the link data.
Any clue why?
Did you set id: 1 in that node data? Because by default that would not be a key value that the Model would assign. Whereas -1 does seem like an automatically generated key value.
Does myDiagram.findNodeForKey(1) return the Node that you think you are working with, the Node whose port was the source of the LinkingTool operation?