Foblex Flow
Introduction
Overview
Nodes
Custom Nodes
Drag Handle
Node Selection
Resize Handle
Rotate Handle
Grouping
Drag to Group
Connectors
Node as Connector
Connector Inside Node
Connector Outlet
Limiting Connections
Connection Rules
Connectable Side
Updated
Connections - Editing
Drag to Connect
Drag to Reassign
Create Node on Connection Drop
Remove Connection on Drop
Assign Node to Connection on Drop
Auto Snap
Connections - Appearance
Connection Types (Straight, Segment, Bezier, Adaptive Curve)
Custom Connection Type
Connection Behaviours
Connection Markers
Connection Content
Updated
Connection Gradients
Updated
Connections - Routing
Connection Waypoints
New
Connection Connectable Side
New
Viewport
Minimap
Zoom
Background
Auto Pan
New
Canvas Layer Ordering
New
Editor Helpers
Selection Area
Magnetic Lines
New
Magnetic Rects
New
Grid System
Add Node from Palette
Help in Positioning (Legacy)
Deprecated
Layout Engines
Dagre Layout
New
Dagre Auto Layout
New
ELK.js Layout
New
ELK.js Auto Layout
New
Reflow
Reflow on Resize
New
Editor State
Cut/Copy/Paste
Undo/Redo
Undo/Redo V2
Events
Drag Start/End Events
Custom Event Triggers
Performance
Large Scene Performance
Connection Redraw Performance
Updated
Reference Apps
AI Low-Code Platform
Updated
Schema Designer
Updated
Call Center Flow
Updated
UML Diagram
Updated
Tournament Bracket
Updated
Foblex Flow

Connection Rules

Description

This example demonstrates how to control which input connectors can be connected to a given output connector. The rules work in two ways:

  • By input ID (fInputId)
  • By input category (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.

Example

[example.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/connectors/connection-rules/example.html [example.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/connectors/connection-rules/example.ts [example.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/connectors/connection-rules/example.scss

Visual feedback

When a connection starts being dragged:

  • The container receives the CSS class .f-connections-dragging.
  • Every input connector that can accept the connection gets the class .f-connector-connectable.
  • Inputs without this class are treated as invalid targets and can be dimmed or styled differently.

This gives the user immediate feedback about which targets are valid before they complete the drag.

When to use it

Use connection rules when your editor has domain constraints such as:

  • one node type can connect only to a specific target,
  • only certain categories of inputs are valid,
  • the UI should show allowed targets before the user commits the connection,
  • your application needs both better UX and cleaner graph data.

Related docs

Edit this page on GitHub