Foblex Flow
Introduction
Getting Started
Containers
Flow Canvas
Node
Node Drag Handle
Connectors
Output Input Outlet
Connection
Connection Create Connection Connection Marker
Extends
Drag and Drop Zoom Background Line Alignment Minimap
Layouts & Behaviors
Dagre Tree ELKJS Tree
Pro Examples
Visual Programming Flow DB Management Flow Call Center Flow Scheme Editor
Foblex Flow
v12.6.4

Connection

Selector: f-connection

The FConnectionComponent is a component that represents a connection between nodes in a flow. It allows customization of the connection's appearance and behaviour, including color, type, and interactivity.

Inputs

  • id: string; The unique identifier for the component instance. Automatically generated. Default: f-connection-${uniqueId++}

  • fReassignDisabled: boolean; Indicates whether the connection cannot be reassigned. Default: false.

  • fSelectionDisabled: boolean; Indicates whether the connection cannot be selected. Default: false.

  • fStartColor: string; The color at the start of the connection. Default: black.

  • fEndColor: string; The color at the end of the connection. Default: black.

  • fOutputId: string; The identifier of the FNodeOutputDirective where the connection starts.

  • fInputId: string; The identifier of the FNodeInputDirective where the connection ends.

  • fBehavior: EFConnectionBehavior; The behaviour of the connection, affecting its positioning and flexibility. Accepts a value from EFConnectionBehavior enum. Default: EFConnectionBehavior.FIXED

  • fType: EFConnectionType | string; The visual type of the connection, such as straight, bezier and etc. Accepts a value from EFConnectionType enum or string for custom connection. Default: EFConnectionType.STRAIGHT

  • fText: string; The text displayed on the connection. Default: null

Styles

  • .f-component A general class applied to all F components for shared styling.

  • .f-connection Class specific to the connection component, providing styles for connection representation.

  • .f-connection-selection-disabled Class applied to the connection when fSelectionDisabled is true.

  • .f-connection-reassign-disabled Class applied to the connection when fReassignDisabled is `true.

  • .f-selected Class applied to the connection when it is selected.

Usage

Add the f-connection component to the f-canvas. Provide the fOutputId and fInputId inputs to specify the start and end points of the connection.

<f-flow>
  <f-canvas>
    |:|<f-connection [fOutputId]="id1" [fInputId]="id2"></f-connection>|:|
  </f-canvas>
</f-flow>

Examples

Different Connection Types

Examples of different connection types. The connection type can be set using the fType input. Valid values are straight, bezier and `segment from EFConnectionType enum.

Straight Bezier
Segment
drag me
drag me
drag me
drag me
drag me
drag me

[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-type/connection-type.component.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-type/connection-type.component.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-type/connection-type.component.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss

Different Connection Behaviours

Examples of different connection behaviours. The connection behaviour can be set using the fBehavior input. Valid values are: fixed, fixed_center and floating from EFConnectionBehaviour enum.

fixed fixed_center floating
drag me
drag me
drag me
drag me
drag me
drag me

[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-behaviour/connection-behaviour.component.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-behaviour/connection-behaviour.component.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connection-behaviour/connection-behaviour.component.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss

Custom Connection Type

Examples of providing custom connection types. The connection type can be set using an array of providers.

offset_straight circle
drag me
drag me
drag me
drag me

[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/custom-connection-type/custom-connection-type.component.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/custom-connection-type/custom-connection-type.component.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/custom-connection-type/custom-connection-type.component.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss

Reassign Connection

Each connection can be reassigned to another fNodeInput. The fReassignDisabled property can be used to disable this feature. Each connection has a DragHandle at the end, drag it to reassign the connection to another fNodeInput.

Output
Input
Input

[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/drag-to-reassign/drag-to-reassign.component.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/drag-to-reassign/drag-to-reassign.component.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/drag-to-reassign/drag-to-reassign.component.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss