Bind visibility to multiple properties

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 =;
    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 ?

One error is that the second argument will be that Panel, not a Shape. But otherwise it looks good.

An alternative is just one Binding that gets evaluated all the time: new go.Binding("visible", "", data => data.label.length > 0 || data.error.length > 0)

ah i didn’t know go.Binding could take an empty string as the second parameter. Ok I’ll do that then.

Just remember to use it only when needed, because it does slow down binding for that kind of part by being evaluated whenever any property changes.