Hi there,
Here I have code that drawing img. And I want to update or change img (src) now.
`````````````````````````````````````````````````````````````````````````````````````````
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)'
}
},
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]);
`````````````````````````````````````````````````````````````````````````````````````````
I tried following line but not working
e1.attrs('image/xlinkHref', src1);
How can I update of chnage 'xlinkHref'?
Many thanks always!