I started with the JavaScript library Joint js, I want to dynamically create a link between two node already created by selecting the source node but without using the ports is that it is possible, thanks for your help
Sincerely yours
I started with the JavaScript library Joint js, I want to dynamically create a link between two node already created by selecting the source node but without using the ports is that it is possible, thanks for your help
Sincerely yours
By dynamically, do you mean in Javascript?
If so, then you just need to use the link constructor, specifiying the source element (where the link starts from) and the target element (where it ends):
//say you have already got the source and target elements sourceEl and targetEl
var link = new joint.dia.Link({
source: sourceEl,
target: targetEl
});
graph.addCell(link);
Here is a working JSFiddle.
There is documentation for this on the JointJS website - for example, the hello world sample at http://www.jointjs.com/tutorial
var link = new joint.dia.Link({
source: { id: source.id },
target: { id: target.id },
vertices: [{ x: 400, y: 250 }],
}),