Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

How to make an adornment always shown?

$
0
0

@chzh.austin wrote:

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 https://github.com/NorthwoodsSoftware/GoJS/blob/4f48dfc71869dfc01419ab0b563d49bab56fcd35/samples/hoverButtons.html. 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

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles