Not able to minimize group

this is my group template add lane code

this.myDiagram.groupTemplateMap.add(“Lane”,
$(go.Group, “Horizontal”, groupStyle(),
{

      selectionObjectName: "SHAPE",  // selecting a lane causes the body of the lane to be highlit, not the label
      resizable: true, resizeObjectName: "SHAPE",  // the custom resizeAdornmentTemplate only permits two kinds of resizing
      layout: $(go.LayeredDigraphLayout,  // automatically lay out the lane's subgraph
        {
          isInitial: false,  // don't even do initial layout
          isOngoing: false,  // don't invalidate layout when nodes or links are added or removed
          direction: 0,
          columnSpacing: 10,
          layeringOption: go.LayeredDigraphLayout.LayerLongestPathSource,
          alignOption: go.LayeredDigraphLayout.AlignAll
        }),

      computesBoundsAfterDrag: true,  // needed to prevent recomputing Group.placeholder bounds too soon
      computesBoundsIncludingLinks: false,  // to reduce occurrences of links going briefly outside the lane
      computesBoundsIncludingLocation: true,  // to support empty space at top-left corner of lane
      handlesDragDropForMembers: true,  // don't need to define handlers on member Nodes and Links

      mouseDrop: (e, grp: any) => {
        var ok = grp.addMembers(grp.diagram.selection, true);
        if (!ok) grp.diagram.currentTool.doCancel();
      },

      subGraphExpandedChanged: grp => {
        const shp = grp.resizeObject;
        if (grp.diagram.undoManager.isUndoingRedoing) return;
        if (grp.isSubGraphExpanded) {
          shp.height = grp.data.savedBreadth;
        } else {
          if (!isNaN(shp.height)) grp.diagram.model.set(grp.data, "savedBreadth", shp.height);
          shp.height = NaN;
        }
        updateCrossLaneLinks(grp);
      }

    },


    new go.Binding("isSubGraphExpanded", "expanded").makeTwoWay(),


    // the lane header consisting of a Shape and a TextBlock
    $(go.Panel, "Horizontal",
      {
        name: "HEADER",
        angle: 270,  // maybe rotate the header to read sideways going up
        alignment: go.Spot.Center
      },
      $(go.Panel, "Horizontal",  // this is hidden when the swimlane is collapsed
        new go.Binding("visible", "isSubGraphExpanded").ofObject(),
        $(go.Shape, "Diamond",
          { width: 8, height: 8, fill: "white", stroke: "" },
          new go.Binding("fill", "color")),
        $(go.TextBlock,  // the lane label
          { font: "bold 13pt sans-serif", editable: true, margin: new go.Margin(2, 0, 0, 0) },
          new go.Binding("text", "name").makeTwoWay())
      ),
      $("SubGraphExpanderButton", { margin: 5 })  // but this remains always visible!
    ),  // end Horizontal Panel
    $(go.Panel, "Auto",  // the lane consisting of a background Shape and a Placeholder representing the subgraph
      $(go.Shape, "Rectangle",  // this is the resized object

        { name: "SHAPE", fill: "white", minSize: new go.Size(1460, 300), stroke: "black", strokeWidth: 2 },
        // new go.Binding("fill", "color"),
        new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify)),
      $(go.Placeholder,
        { padding: 12, alignment: go.Spot.TopLeft }),
      $(go.TextBlock,  // this TextBlock is only seen when the swimlane is collapsed
        {
          name: "LABEL",
          font: "bold 13pt sans-serif", editable: true,
          angle: 0, alignment: go.Spot.TopLeft, margin: new go.Margin(2, 0, 0, 4)
        },
        new go.Binding("visible", "isSubGraphExpanded", e => !e).ofObject(),
        new go.Binding("text", "name").makeTwoWay())
    )  // end Auto Panel
  )); 

this is my group template get lane code

this.myDiagram.groupTemplateMap.get(“Lane”).resizeAdornmentTemplate =
$(go.Adornment, “Spot”,
$(go.Placeholder),
$(go.Shape, // for changing the length of a lane
{
alignment: go.Spot.Right,
desiredSize: new go.Size(7, 50),
fill: “lightblue”, stroke: “dodgerblue”,
cursor: “col-resize”
},
new go.Binding(“visible”, “”, ad => {
if (ad.adornedPart === null) return false;
return ad.adornedPart.isSubGraphExpanded;
}).ofObject()
),
$(go.Shape, // for changing the breadth of a lane
{
alignment: go.Spot.Bottom,
desiredSize: new go.Size(50, 7),
fill: “lightblue”, stroke: “dodgerblue”,
cursor: “row-resize”
},
new go.Binding(“visible”, “”, ad => {
if (ad.adornedPart === null) return false;
return ad.adornedPart.isSubGraphExpanded;
}).ofObject()
),
$(go.Panel, “Vertical”,
{ cursor: ‘pointer’, alignment: go.Spot.BottomLeft },
$(“Button”,
{ alignment: go.Spot.Bottom, click: (event, obj) => this.addGroup(event, obj), cursor: ‘pointer’ },
$(go.Shape, “PlusLine”, { cursor: ‘pointer’, width: 8, height: 8, fill: “white”, stroke: “black” })
)
)
);

in group template
{ name: “SHAPE”, fill: “white”, minSize: new go.Size(1460, 300), stroke: “black”, strokeWidth: 2 },

when I am provide minSize then complete group is not minimize only inside node minimize , Pls provide some solution

without minimize

after minimize in my code

but after minimize I want like that

You’ve set a minSize on the 'SHAPE' object, which is the object that’s height gets reset in subGraphExpandedChanged. If you remove that, it should work as you expect. Or maybe you need to set/reset minSize in subGraphExpandedChanged.

If minsize not provided then size of group is not as expected tahts why minsize is given now due to that minimize is not working Provide me the solution of that I want both size as given and minimize also

So then use my second suggestion. Set minSize to new go.Size(NaN, NaN) on collapse and back to the default value on expand.