Hi there,
Here I have two elements. The image one is 'joint.dia.Element.define' and text box is 'joint.shapes.standard.Rectangle'
I put the port for Image element but I didn't add any code for text box but it is connectable. Is there any way I can make element not connectable?
So, If I drag link to text box element, it shouldn't hover it.
Here is text box code
````````````````````````````````````````````````````````````````````````````````````````````````````
let inputText = document.getElementById('hmiTextBox').value;
var rect = new joint.shapes.standard.Rectangle();
rect.position(100, 30);
rect.resize(70, 25);
rect.attr({
label: {
text: inputText
}
});
rect.addTo(graph);
````````````````````````````````````````````````````````````````````````````````````````````````````
And image code
````````````````````````````````````````````````````````````````````````````````````````````````````
const r5 = joint.dia.Element.define('example.Sensor', {
size: {
width: 120,
height: 48
},
attrs: {
image: {
xlinkHref: src,
width: 'calc(w - 6)',
height: 'calc(h - 6)'
}
},
label: {
text: deviceid,
x: 'calc(0.7*w)',
y: 'calc(0.5*h)'
},
ports: {
items: [ port ] // add a port in constructor
}
}, {
markup: [{
tagName: 'image',
selector: 'image'
}, {
tagName: 'items',
selector: 'ports'
}]
});
// draw elements
const e1 = new r5();
e1.position(100, 100);
graph.addCells([e1]);
````````````````````````````````````````````````````````````````````````````````````````````````````
Many thanks!