Isn’t A a “Spot” Panel?
function init() {
var $ = go.GraphObject.make;
myDiagram =
$(go.Diagram, "myDiagramDiv");
myDiagram.nodeTemplate =
$(go.Node, "Vertical",
{ defaultAlignment: go.Spot.Left, isOpposite: true },
$(go.Shape, { fill: "green" }),
$(go.Panel, "Spot",
{ margin: new go.Margin(0, 0, -10, 0) },
$(go.Shape, { fill: "red" }),
$(go.Shape, "Circle",
{ alignment: go.Spot.BottomRight, width: 20, height: 20, fill: "yellow" })
)
);
myDiagram.model = new go.GraphLinksModel([ {} ]);
}
produces:
Note that I had to reverse the z-ordering of the elements so that the green panel wouldn’t overlap the red panel. Alternatively, you might be able to do:
myDiagram.nodeTemplate =
$(go.Node, "Spot",
$(go.Panel, "Vertical",
$(go.Shape, { fill: "red" }),
$(go.Shape, { fill: "green" })
),
$(go.Shape, "Circle",
{ alignment: go.Spot.Right, width: 20, height: 20, fill: "yellow" })
);
But that doesn’t generalize so well if you have a variable number of elements in the vertical panel, each with its own optional decoration.