My requirement is to have text inside a node, and the size of the node should automatically adjust to the length of the text inside it. How do I achieve the dynamic size of the node. The text label is editable but it reflects in the diagram only on refresh(which is not the problem).
Any pointers are greatly appreciated.
Thanks
If you look at the Minimal sample, Minimal GoJS Sample, you will see that each Node has a different width, depending on the text.
If you look at the Basic sample, Basic GoJS Sample, the user can edit the text, after which you can see the node change its size based on the new text.
Just use an “Auto” Panel, which is how you wrap a border (or border-like element) around something.
Using the Auto panel works, but I want to limit the max size of the textblock. I am showing some buttons just beside the node( somethiing like a port) so I need to adjust the button’s position accordingly.
How do I have a max size cap on the textblock
Set or bind its maxSize property. If you only want to limit its width but not its height, use NaN for the height: { maxSize: new go.Size(150, NaN) }