I need to display a button near the node based on data property like this:
I used a regular panel with visibility binding, but I noticed that this panel affects AvoidsNodes routing as my node ports are inside node bounds in that case:
I tried to move this comment button to an adornment, but to do that I ended up creating an adornment inside an unused binding:
content.bind('hasComments', 'hasComments', (hasComments: boolean, obj: go.Panel) => {
if (isNotNil(obj.part) && hasComments) {
const adornment = $(
go.Adornment,
'Spot',
$(go.Panel, 'Horizontal', $(go.Placeholder), getCommentCursorButton(params)),
);
adornment.adornedObject = obj.part;
obj.part.addAdornment('COMMENT_BUTTON_ADORNMENT', adornment);
}
return hasComments;
});
It works but I wonder if there is a better way to achieve that. My main goal is to show this comment button without it affecting AvoidsNodes routing calculations.

