Hi ,
I am trying to add icon to custom element, but it is not working , any help appreciated.
custom element markup: : '<g class="rotatable"><g class="scalable"><rect/></g><text class="image-glyph-icon"/><text/></g>'
function getEl(options){
return new joint.shapes.custom.RectImage({
size: { width: 5, height: 3 },
attrs : {
rect : {
fill : 'none',
stroke : 'none',
width: 50, height: 30
},
".image-glyph-icon" : {
text: options.content,
ref : 'rect',
'font-size': 14,
'ref-x' : .5,
'ref-y' : .7,
'y-alignment' : 'middle',
'x-alignment' : 'middle',
fill : '#1a1a1a'
},
text : {
text : options.label,
fill : '#1a1a1a',
ref : 'rect',
'ref-y' : .9,
}
}
})
}
getEl({ label: "Input", content: ""});