Check if adding a connection would exceed max connections
Node ID to check
Port ID (optional)
Maximum allowed connections (undefined = unlimited)
Current edges in the diagram
Check as 'source' (outgoing) or 'target' (incoming)
Check if adding a connection would exceed max connections