Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Link in JointJs

I have a JointJs model that includes many elements and links. Most of the links I wish to display as lines between elements, but for certain types of links I want them to be invisible and undiscoverable to the user. I've tried a few different things that have gotten me close, but I was wondering if someone had a better or more complete solutions.

Things I've tried:

link.attr({'.connection': {opacity: 0.0}});

This does indeed make the link invisible to the user, but still shows up and is editable when the user's mouse moves over it.

link.attr({'.connection': {display: non}});

This doesn't even place the link on the palette, which does succeed in hiding it from the user, but is problematic because it is no longer tracked by the model.

For a little more background information, these links can exist but cannot be created or utilized by the user, so I don't want them to be presented to the user. However, when I query the palette for all of the links, I still want these to be present.

Thanks for any help or ideas you can provide.

like image 871
jayemar Avatar asked Dec 01 '25 16:12

jayemar


1 Answers

You can use

this.attr("./display", "none");

(see also Hiding elements in a diagram )

like image 198
kolobok Avatar answered Dec 03 '25 06:12

kolobok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!