Resizing issues within gojs

we are having issues when resizing. if i put the text box at the bottom it goes to below the resized panel.

if i put it on top the bottom port goes off the window.

attached is the image showing the issue.

code sample

      $(go.Node, "Spot",{ locationSpot: go.Spot.Center, rotatable: true ,resizable: true }, nodeStyle(),
          $(go.Picture, { source: "./images/Flowchart-holdrelease.bmp" ,imageStretch: go.GraphObject.Fill  }),
      $(go.TextBlock,  "holdrelease" ,{  alignment: go.Spot.Top, font: "bold 11pt Helvetica, Arial, sans-serif", stroke:"white",
isMultiline: true,background:"#005faa",editable: true,wrap: go.TextBlock.WrapFit,margin: 10,maxLines: 1}, new go.Binding("text").makeTwoWay()),{
        toolTip:  // define a tooltip for each node that displays the color as text
          $(go.Adornment, "Auto",
            $(go.Shape, { fill: "#84ACB3" }),
           $(go.TextBlock, { margin: 2, editable: true},
              new go.Binding("text").makeTwoWay())
          )  // end of Adornment
        makePort("T", go.Spot.Top, true, true),
        makePort("L", go.Spot.Left, true, true),
        makePort("R", go.Spot.Right, true, true),
		makePort("B", go.Spot.Bottom, true, true)

I can’t really read your code, since it isn’t well formatted and indented. But I suspect that the problem is that by only setting Part.resizable to true, the user is trying to resize the whole Node, whereas your node template isn’t designed to be resizable in the manner that you want.

What object is it that you really want users to resize? If you really want them to resize the whole Node, then you have to design the template to accommodate having the ResizingTool set the desiredSize (a.k.a. width and height) on the Node. That means that objects within the node have to respond to the external constraints in the manner that you would like.

Alternatively you could set Part.resizeObjectName to have the user resize a particular object within your node. Then everything else within the node could be laid out properly relative to that object.

Note the second and following examples at GoJS Tools -- Northwoods Software.