How to prevent overflow of group members

resize group,How to prevent overflow of group members

example link

I have seen the example at Swim Lanes (vertical) and tried to modify my code according to the example, but our group layout is different So some functions in the custom resizeTool will not trigger I don’t know how to change it to achieve the effect.
Below is my group template

myDiagram.groupTemplate =
          $(go.Group, 'Auto',
            { selectionObjectName: 'STEP',
              locationObjectName: 'STEP',
              resizable: true,
              resizeObjectName: 'STEP',
              selectionAdornmentTemplate: groupSelectionAdornmentTemplate,
              ungroupable: true,
              computesBoundsAfterDrag: true,
              handlesDragDropForMembers: true
            new go.Binding('location').makeTwoWay(),
            $(go.Panel, 'Vertical',
              { padding: 20 },
                { font: 'bold 10pt Helvetica, Arial, sans-serif' },
                new go.Binding('text').makeTwoWay()),
            $(go.Shape, 'DividedProcess',
              { name: 'STEP', fill: 'transparent' },
              new go.Binding('width'),
              new go.Binding('height'),

There are a lot of choices one could make for how the ResizingTool could behave. Here is one such choice:
Limited Group Resizing

I’ll try it tomorrow. thanks

hello, I used a custom resizingTool, and there are the following problems

  1. When there is no node in the group, when resizing the group, the size of the group will be calculated as NaN, and the group graph will become the default placeholder that is stretched by the content and cannot be resized.

  2. my group uses custom graphics. When adjusting the head of the group, it will be calculated by the outermost border of the group, which will cause the content of the node to overflow.

Yes, the sample at Limited Group Resizing didn’t handle empty groups and wasn’t handling the strokeWidth correctly. I have updated that sample.

@walter thank you for this example. It helps

Thanks walter!