freegroup / draw2d

Create Visio like drawings, diagrams or workflows with JavaScript and HTML5
https://freegroup.github.io/draw2d/#/examples
MIT License
738 stars 227 forks source link

Problem with label update via javascript #150

Closed BalaDhinesh closed 3 years ago

BalaDhinesh commented 3 years ago

Hello, I made my custom figure with two hybrid ports and a label using draw2d.SVGFigure.extend function. When I tried to update that label in console, it doesn't reflect changes automatically in canvas. It only works if I manually drag and drop/doubleClick that figure. The command I used in Chrome console: canvas.figures.data[0].label.text = 2

But if I add a node using draw2d.shape.node.Start() in console, it automatically reflects back in the canvas.

Thanks in advance

freegroup commented 3 years ago

draw2d has an API to change labels of shapes. https://codepen.io/freegroup/pen/gOwLbNQ