This example demonstrates how to control which input connectors can be connected to a given output connector. The rules work in two ways:
fInputId)fInputCategory)On the output side you define fCanBeConnectedInputs, which may include specific input IDs and/or categories. During a drag operation, the system checks whether the target input ID or category is present in that array and only then allows the connection.
[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connectors/connection-rules/connection-rules.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connectors/connection-rules/connection-rules.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connectors/connection-rules/connection-rules.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss
When a connection starts being dragged:
.f-connections-dragging..f-connector-connectable.This gives the user immediate feedback about which targets are valid before they complete the drag.
Use connection rules when your editor has domain constraints such as: