I am trying to create a board where the user can dynamically add blocks and associate blocks with links. (Something like this , but dynamic) I use the JointJs framework, and so far everything is working as expected, but I need to show some information when the user connects to two blocks. My problem is that I cannot find an event to handle when blocks are connected .
I looked through this question , but in my example I don't have an instance of a link to attach an event.
Here you can see my example.
And this is how the block is added to the board. magnet : truth in the text property is what makes the text pluggable. I really need help finding an event to handle when the link is connected.
var rect = new joint.shapes.basic.newRect({ position: { x: position, y: position }, size: { width: 100, height: 40 }, attrs: { rect: { 'stroke-width': '1', stroke: 'black', rx: 3, ry: 3, fill: 'blue'}, text: { text: 'Block', magnet: true, } } }); graph.addCell(rect);
I also looked at the mouseUp event and coordinates, but nothing came of it .. I really appreciate some help
javascript jointjs
Bfigueiredo
source share