Hey Walter, thanks for your response
So you gave us a nice clue with your answer :).
In our DefaultGroup template, if we comment out the isSubGraphExpanded:false in the initial properties, then the diagram works perfectly.
Do you have any insights into what could be causing the issue?
Here is the whole template:
export const DefaultGroup = () => {
return GO_DIAGRAM(
go.Group,
"Auto",
{
layout: GO_DIAGRAM(go.TreeLayout, {
angle: 90,
arrangement: go.TreeLayout.ArrangementHorizontal,
setsPortSpot: false,
setsChildPortSpot: false,
arrangementSpacing: new go.Size(60, 60), // horizontal spacing
layerSpacing: 75, // vertical spacing
}),
isAnimated: true,
shadowColor: GROUP_SHADOW_COLOR,
shadowBlur: 0,
// if we comment the next line out, it works
// isSubGraphExpanded: false,
selectionAdorned: false,
// When group is selected move to forground AND its children
...groupEventHandlers(),
},
new go.Binding("visible", "isHidden", (isHidden) => !isHidden),
new go.Binding(
"isShadowed",
"",
(group) => !group.isSubGraphExpanded
).ofObject(),
GO_DIAGRAM(
go.Shape,
// surrounds everything
"RoundedRectangle",
{
parameter1: 5,
name: NODE_BODY_SHAPE,
spot1: go.Spot.TopLeft,
spot2: go.Spot.BottomRight,
strokeWidth: 1,
},
new go.Binding("stroke", "", bindSelectColor).ofObject(),
new go.Binding("strokeWidth", "", bindNodeStrokeWidth).ofObject(),
new go.Binding("fill", "", (node: go.Node) => {
const lvl = node.findSubGraphLevel();
return lvl % 2 ? GROUP_SECONDARY_COLOR : WHITE_COLOR;
}).ofObject()
),
GO_DIAGRAM(
go.Panel,
"Vertical",
GO_DIAGRAM(
go.Panel,
// Position header above the subgraph
"Table",
{
margin: 6,
},
new go.Binding("width", "", (group) =>
group.isSubGraphExpanded ? NaN : 150
).ofObject(),
ExpandButton().set({ column: 0, row: 0, margin: ROW_ITEM_GAP("left") }),
withExpandedProperties(
GO_DIAGRAM(
go.Picture,
{
row: 0,
column: 1,
alignment: go.Spot.Center,
},
new go.Binding("source", "source", convertKeyImage)
),
{
desiredSize: [new go.Size(16, 16), new go.Size(40, 40)],
margin: [
ROW_ITEM_GAP(),
new go.Margin(15, undefined, 15, undefined),
],
}
),
withExpandedProperties(
AssetActionsButton().set({ row: 0, margin: ROW_ITEM_GAP("right") }),
{
alignment: [go.Spot.RightCenter, go.Spot.TopRight],
column: [7, 2],
}
),
withExpandedProperties(GroupTitle(), {
row: [0, 1],
column: [2, 0],
columnSpan: [1, 3],
width: [NaN, TITLE_WIDTH],
margin: [ROW_ITEM_GAP(), new go.Margin(0, 0, 10, 0)],
}),
GO_DIAGRAM(
go.TextBlock,
{
text: "|",
width: 2,
stroke: ASSET_BORDER_COLOR,
row: 0,
font: "24px",
column: 3,
margin: ROW_ITEM_GAP(),
},
new go.Binding("visible", "isSubGraphExpanded").ofObject()
),
withExpandedProperties(AssetSubtitle(), {
row: [0, 2],
column: [4, 0],
columnSpan: [1, 3],
width: [NaN, SUBTITLE_WIDTH],
margin: [ROW_ITEM_GAP(), new go.Margin(0, 0, 10, 0)],
alignment: [go.Spot.LeftCenter, go.Spot.Center],
}),
withExpandedProperties(NetworkTopologyAssetIP(), {
row: [0, 3],
column: [5, 0],
columnSpan: [1, 3],
spacingAbove: [9, 0],
spacingBelow: [8, 0],
width: [NaN, SUBTITLE_WIDTH],
margin: [ROW_ITEM_GAP(), new go.Margin(0, 0, 10, 0)],
alignment: [go.Spot.LeftCenter, go.Spot.Center],
}),
withExpandedProperties(
GO_DIAGRAM(
go.Panel,
"Auto",
GO_DIAGRAM(go.Shape, "Badge", {
fill: BADGE_COLOR,
stroke: null,
height: 24,
parameter1: 12,
minSize: new go.Size(24, 24),
}),
GO_DIAGRAM(
go.TextBlock,
{ stroke: BADGE_STROKE_COLOR, margin: 4 },
new go.Binding("text", "", (node: go.Group) =>
node
.findSubGraphParts()
.filter((a) => a instanceof go.Node && !a.data?.isHidden)
.count.toString()
).ofObject()
)
),
{
row: [0, 4],
column: [6, 0],
columnSpan: [1, 3],
alignment: [go.Spot.LeftCenter, go.Spot.Center],
}
),
withExpandedProperties(
GO_DIAGRAM(
// Represents area for all member parts
go.Placeholder,
{
padding: 12,
row: 6,
column: 0,
}
),
{
columnSpan: [7, 3],
padding: [38, 0],
alignment: [go.Spot.LeftCenter, go.Spot.Center],
}
)
),
withExpandedProperties(
GO_DIAGRAM(
go.Panel,
"Auto",
{
name: GROUP_TOOLBAR,
stretch: go.GraphObject.Fill,
margin: new go.Margin(10, 0, 0, 0),
},
new go.Binding("visible", "", shouldAssetDisplayToolbar),
AssetToolBar(true),
GO_DIAGRAM(
go.Panel,
"Horizontal",
AssetInfoButton(),
VmStatusButton(),
UnscannedDevicesButton(),
AssetIssueButton()
)
),
{
alignment: [go.Spot.Bottom, go.Spot.Bottom],
}
)
)
);
};