Is it ok to do this :
$(go.Panel, 'Auto',
{ cursor: 'move', visible: false }, // visual hint that the user can do something with this link label
new go.Binding('visible', 'label', checkErrorOrLabel),
new go.Binding('visible', 'error', checkErrorOrLabel),
export const checkErrorOrLabel = (c: string, shape: go.Shape): boolean => {
const data = shape.part.data;
return data.label.length > 0 || data.error.length > 0;
};
It’s the only I could find to make sure the visibility is updated whenever any of the two properties change (label or error).
Is there a neater way to achieve this ?