clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs
https://jointjs.com
Mozilla Public License 2.0
4.65k stars 850 forks source link

Link as magnet? #1299

Open charleskessler opened 4 years ago

charleskessler commented 4 years ago

Is it possible to have a link or a link label be a magnet?

I'd like to be able to do something similar to the mix bus demo, set the intersection circle (link end/start point) as a magnet to draw new connections

image

kumilingus commented 4 years ago

The magnets on links are passive only right now (an existing link can be connected to the magnet - you can not add a new link by dragging the magnet). We need to move the magnets logic from the ElementView to CellView.

For now, you need to listen to the paper event link:pointerdown or a custom event (https://resources.jointjs.com/docs/jointjs/v3.1/joint.html#dia.attributes.event) and create a link yourself and change the link's target on link:pointermove/link:pointerup.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Please remove stale label or comment or this will be closed in 14 days.