I need to add a label to one of my custom element, I tried everything but got nothing. Anyone can give me some hints, thanks.
index.js
const customElement =
{
type: "custom:triangle",
id: "CustomTriangle_1",
x: 30,
y: 100,
width: 30,
height: 30,
name:'x',
}
const bpmnModeler = new CustomModeler({...});
bpmnModeler.addCustomShape(customElement);
customModeler.js
CustomModeler.prototype.addCustomShape = function(customElement) {
this.customElements.push(customElement);
const canvas = this.get('canvas');
const elementFactory = this.get('elementFactory');
const customAttrs = assign({businessObject: customElement}, customElement);
const customShape = elementFactory.create('shape', customAttrs);
//how to add label here
return canvas.addShape(customShape);
};