Hi,
Yes, that is what I was thinking to add a custom layout.
return GO(
go.Group,
'Vertical',
{
isShadowed: true,
isSubGraphExpanded: true,
layerName: DIAGRAM.LAYERS.BACKGROUND,
layout: GO(BlockLayout),
padding: 0,
portSpreading: go.Node.SpreadingEvenly,
selectionObjectName: DIAGRAM.PART.SHAPE,
shadowVisible: false,
fromSpot: go.Spot.RightSide,
toSpot: go.Spot.LeftSide,
subGraphExpandedChanged: function(grp) {
grp.category = 'Collapsed';
},
},
This is a snippet of my group template, as you can see I am using a layout call BlockLayout which is an inherited layout of LayeredDigraphLayout.
function BlockLayout() {
go.LayeredDigraphLayout.call(this);
}
go.Diagram.inherit(BlockLayout, go.LayeredDigraphLayout);
After having a look at your hint I am guessing I need to do something like this
BlockLayout.prototype.commitNodes = function() {
go.LayeredDigraphLayout.prototype.commitNodes.call(this);
const it = this.diagram.nodes;
let entryX = 0;
let entryY = 0;
while (it.next()) {
const node = it.value;
if (node.data.type === 'entry') {
node.move(new go.Point(entryX, entryY));
entryY += node.height;
}
// entryX += offset.width;
}
};
But the node still not position at the edge of the group, it just position at the (0,0) within the group.
So my questions are
- How can I evenly align the circle nodes on the left/right edge of group if there is multiple circles?
- There are group inside groups, how do I make sure the location of nodes only position at its direct parent group’s edge only.
I am guessing I need to get the group’s position at the group and calculate the position of circles based on its direct group position and width and height, but I am not sure how to get the position of the group.
Thanks for help.
Kakit