How to make an adornment always shown?

I need to add an associated shape on the side of each node. However, I still would like to make the selection box surrounding only node itself so that I don’t want to this associated part be within my selection box. So I think adornment should be the right choice? But how should I make adornment showing at all time? I only see examples when hovering over show a customized adornment by using addAdornment from this example GoJS/hoverButtons.html at 4f48dfc71869dfc01419ab0b563d49bab56fcd35 · NorthwoodsSoftware/GoJS · GitHub. I would like to make it showing all the time as long as the node is displayed. Any idea? Thanks.

I tried to put it in the nodeTemplateMap while creating diagram, but it seems not work.

    let telemetryAdornment: go.Adornment =
        this.$(go.Adornment, "Auto",
            this.$(go.Shape, "RoundedRectangle",
                {
                    fill: "lightgreen",
                    desiredSize: new go.Size(50, 50)
                }
            ),
            this.$(go.Placeholder));
    telemetryAdornment.adornedObject = newDiagram.nodeTemplateMap.get(NodeCategories.START);
    newDiagram.nodeTemplateMap.get(NodeCategories.START).addAdornment("telemetryAdornment", telemetryAdornment);

-Chuan

Adornments are supposed to be “extra” or “optional” Parts that are associated with a Part. They are not supposed to always be visible.

If you always want something to be shown for a Node, include it in the template. Maybe you want your Node to be either a “Horizontal” or a “Table” Panel.

Thanks for quick reply, walter.

However, if I put the associate shape into the template, my selectionAdornment will cover entire area like below

Set Part.selectionObjectName to the name of the element that you want to get that blue rectangular Adornment.

That makes the trick. Thanks!