@vishal_prabhu81 wrote:
Hi,
I am trying to have a node which has a image and a text. I want the node to expand when the text is longer. Now it wraps the content and the node takes the width of the image.
Here is the template I am using.
$(go.Panel, "Vertical", { }, $(go.Panel, "Vertical", { name: "InnerPanel", margin: new go.Margin(9, 0, 0, 0) }, $(go.Picture, { margin: new go.Margin(9, 0, 0, 0), alignment: go.Spot.Top, imageStretch: go.GraphObject.Fill }, new go.Binding('source', 'source'))), $(go.TextBlock, { /* textAlign: 'center',*/ font: '400 24px noto_sansregular', stroke: '#ebeff0', editable: false, margin: new go.Margin(0, 0, 0, 0), // visible: true, isMultiline: true, alignment: go.Spot.Bottom, stretch: go.GraphObject.Fill }, new go.Binding('text', 'name').makeTwoWay(), /*new go.Binding('stroke', 'textColor'))), */ new go.Binding('stroke', 'textColor', function(textColor) { if (textColor === null) { return '#ebeff0'; } else { return textColor; } })) )
Posts: 4
Participants: 3