Namiskuukkwl
Namiskuukkwl

Reputation: 195

Joint.js: Prevent a specific element to be linked

I have a use case where I would like to create a diagram with joint.js, where some elements could be linked normally, but some shouldn't accept to or from links at all.

Is there some certain function or property that would allow this?

Upvotes: 1

Views: 596

Answers (1)

vt.
vt.

Reputation: 1428

use the magnet:false attribute e.g:

new joint.shapes.basic.Rect({
    position: { x: 50, y: 50 },
    size: { width: 300, height: 200 },
    attrs: {
        '.': { magnet: false }
    }
});

Upvotes: 4

Related Questions