Here’s a stand-alone sample that might be doing what you want:
<!DOCTYPE html>
<html>
<head>
<title>Minimal GoJS Sample</title>
<!-- Copyright 1998-2022 by Northwoods Software Corporation. -->
</head>
<body>
<div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:600px"></div>
<script src="https://unpkg.com/gojs"></script>
<script id="code">
const $ = go.GraphObject.make;
const myDiagram =
$(go.Diagram, "myDiagramDiv",
{
layout: $(go.GridLayout),
"undoManager.isEnabled": true
});
const SmallHeight = 60;
const BigHeight = 300;
myDiagram.nodeTemplate =
$(go.Node, "Auto",
$(go.Shape, { fill: "white" }),
$(go.Panel,
{ name: "OUTER", margin: 4, alignment: go.Spot.Top, height: SmallHeight },
new go.Binding("height").makeTwoWay(),
$(go.Panel, "Vertical",
{ name: "LIST" },
new go.Binding("itemArray", "items"))
),
$("Button",
{
margin: 4,
alignment: go.Spot.Bottom,
click: (e, button) => {
e.diagram.commit(d => {
const list = button.part.findObject("OUTER");
list.height = (list.height > SmallHeight) ? SmallHeight : BigHeight;
});
}
},
$(go.TextBlock, "More", { name: "LABEL"},
new go.Binding("text", "height", h => (h > SmallHeight) ? "Less" : "More")),
new go.Binding("visible", "", panel => {
panel.part.ensureBounds(); // this is a hack to make sure it has its expected height at binding time
return panel.naturalBounds.height > SmallHeight;
}).ofObject("LIST")
)
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: 1, text: "Alpha", items: ["abc"] },
{ key: 2, text: "Beta", items: ["abc", "def", "uvw", "xyz"] },
{ key: 3, text: "Gamma", items: ["abc", "def", "ghi", "jkl", "mno", "pqr", "stu", "vwx", "yz"] },
]);
</script>
</body>
</html>