Thanks for the example.
I assume the purpose for the following test is to determine whether the element is a node:
if(args.element.shape)
Since connectors do not have a shape property, based on the current API this test would accurately distinguish between the two types that raise the click event -- nodes and connectors.
However, this approach is error-prone, because you as a vendor could do one of the following that would break my code:
Add a connector.shape property
Deprecate and remove the node.shape property
Add another type of element that also has a shape property. The sourceDecorator and targetDecorator are good examples.
I very much prefer the approach in MVC Classic, where there were separate NodeClick and ConnectorClick events.
If that is not possible, I suggest you add a property to args, indicating the element type. As a customer, I want a guarantee that your event is handing me the type I expect.