@tiepna wrote:
Hi,
In my diagram, When expand or collapse group then that group is moved a little bit to the left side.
Please see the image below to clearly this question:
Before collapse:
After collapse:Please also see the group template:
$(go.Group, "Auto", { fromSpot: go.Spot.AllSides, toSpot: go.Spot.AllSides, isSubGraphExpanded:true }, new go.Binding("location", "", toLocation).makeTwoWay(go.Point.stringify), $(go.Shape, "Rectangle", { fill: "white", stroke: "#4472C4", strokeWidth: 2 }), $(go.Panel, go.Panel.Vertical, // title above Placeholder $(go.Panel, go.Panel.Horizontal, // button next to // TextBlock { stretch: go.GraphObject.Horizontal, margin: 1 }, $("SubGraphExpanderButton", { alignment: go.Spot.Right, margin: 5, click: function(e, button) { var group = button.part; if (group instanceof go.Adornment) group = group.adornedPart; if (!(group instanceof go.Group)) return; var diagram = group.diagram; if (diagram === null) return; var cmd = diagram.commandHandler; if (group.isSubGraphExpanded) { if (!cmd.canCollapseSubGraph(group)) return; } else { if (!cmd.canExpandSubGraph(group)) return; } e.handled = true; var linksToGroupOnly = group.findLinksConnected(); var externalLinksConnected = group.findExternalLinksConnected(); var externalNodesConnected = group.findExternalNodesConnected(); diagram.startTransaction("expand-collapse"); if (group.isSubGraphExpanded) { cmd.collapseSubGraph(group); showGroupLinkGroup(externalLinksConnected,linksToGroupOnly); } else { cmd.expandSubGraph(group); //hide Groups link, show Nodes link hideGroupLinkGroup(group,externalNodesConnected,externalLinksConnected,linksToGroupOnly) } diagram.commitTransaction("expand-collapse"); } }), $(go.TextBlock, { alignment: go.Spot.Left, margin: 5, font: "bold 18px 'Open Sans'", stroke: "#4472C4" }, new go.Binding("text", "label")) ), // end Horizontal Panel $(go.Panel, $(go.Placeholder,{padding:5}) ) ) ); // end GroupDo you guys have any idea for this?
Posts: 4
Participants: 2

