Setting linkTools on a magnet created link

56 views
Skip to first unread message

Neil Kolban

unread,
Oct 24, 2021, 4:07:30 PM10/24/21
to JointJS
Imagine I have elements with ports.  I find that I can draw a link between the elements.  This is great.  My puzzle is how do I modify the linkTools on those links.  What I want to achieve is to have only the ability to remove a link and have no other options.

One thought was to create my own link and I supplied a value for the defaultLink in the Paper properties.  That did create a new style link ... but that link had NO linkTools available to it.  What I think I am looking for is a way to specify a defaultLink which should also have my own custom linkTools upon it.

Roman Bruckner

unread,
Oct 25, 2021, 5:40:53 AM10/25/21
to joi...@googlegroups.com
To maintain backwards compatibility, the default link remains the legacy `joint.dia.Link`. You should change it to `joint.shapes.standard.Link`, which does not have the tools as part of its markup (which makes it much faster). The tool can be added separately via Link Tools (https://resources.jointjs.com/tutorial/link-tools).

On Sun, 24 Oct 2021 at 22:07, 'Neil Kolban' via JointJS <joi...@googlegroups.com> wrote:
Imagine I have elements with ports.  I find that I can draw a link between the elements.  This is great.  My puzzle is how do I modify the linkTools on those links.  What I want to achieve is to have only the ability to remove a link and have no other options.

One thought was to create my own link and I supplied a value for the defaultLink in the Paper properties.  That did create a new style link ... but that link had NO linkTools available to it.  What I think I am looking for is a way to specify a defaultLink which should also have my own custom linkTools upon it.

--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jointjs/8d453032-3963-455f-8705-e2be48752c12n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages