Yes, that highlight box is a selected adornment as I wrote here for node templates code:
selectionAdornmentTemplate:
$$(go.Adornment, "Auto",
{ layerName: "Background" },
$$(go.Shape, "RoundedRectangle",
{ fill: null, stroke: "rgb(204, 0, 0)", strokeWidth: 2, strokeDashArray: [12, 8], fill: "rgba(255,255,255,0.7)"}),
$$(go.Placeholder)
), // end Adornment
Addornment add/remove on mouseEnter/mouseLeave on link template definition are only for adding/removing control points.
funnelDiagram = $$(go.Diagram, "edit-div",
{
// have mouse wheel events zoom in and out
"toolManager.mouseWheelBehavior": go.ToolManager.WheelZoom,
"toolManager.hoverDelay": 100,
"toolManager.holdDelay": 300,
"undoManager.isEnabled": true, // enable undo & redo
initialContentAlignment: go.Spot.TopLeft,
hasHorizontalScrollbar: false,
hasVerticalScrollbar: false,
minScale: 0.25, // so that the contents cannot appear too small
maxScale: 3, // so that the contents cannot appear too big
initialScale: 0.7,
padding: new go.Margin(40, 0, 0, 170),
layout: $$(go.CircularLayout, { isOngoing: false, isInitial: false, isViewportSized: false }),
commandHandler: $$(DrawCommandHandler),
'commandHandler.pasteOffset': new go.Point(20,20),
"linkReshapingTool.handleArchetype":
$$(go.Shape, "Circle",
{ // change the default reshape handle to be a large circle
width: 16, height: 16,
fill: "lightblue", stroke: "dodgerblue",
mouseEnter: function(e, shape) { // show the delete button
deletePointButton.adornedObject = shape;
e.diagram.add(deletePointButton);
},
mouseLeave: function(e, shape, next) { // show the delete button
var tool = e.diagram.toolManager.linkReshapingTool;
if(tool.adornedLink)tool.adornedLink.removeAdornment(tool.name);
},
}),
And I have one more removeAdorment part in diagram definition like above. But I think that’s for only link.
So no Part.addAdorment or Part.removeAdornment I used in script.