Hi there,
I draw a image icon using below 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)'
}
},
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]);
```````````````````````````````````````````````````````````````````````````````````````````````
And I saved that image icon history using toJSON() method
``````````````````````````````````````````````````````````````````````````````````````````````
jsonObject = graph.toJSON();
``````````````````````````````````````````````````````````````````````````````````````````````
what I found here, the element id is changing every time when I do toJSON().
This can be a problem when I identify elements based on this id. So, I'm trying to save another id in this object. Is there any space where I can add some text in cells[0]?
May be cells[0]['unique']?
Many thanks