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
Connections - Editing
Drag to Connect
Click to Connect
New
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
Connection Gradients
Connections - Routing
Connection Waypoints
Connection Connectable Side
Viewport
Minimap
Zoom
Background
Auto Pan
New
Canvas Layer Ordering
New
Editor Helpers
Selection Area
Magnetic Lines
Magnetic Rects
Grid System
Add Node from Palette
Accessibility
New
Help in Positioning (Legacy)
Deprecated
Layout Engines
Dagre Layout
Dagre Auto Layout
ELK.js Layout
ELK.js Auto Layout
Reflow
Reflow on Resize
Editor State
Cut/Copy/Paste
Undo/Redo
Undo/Redo V2
Events
Drag Start/End Events
Custom Event Triggers
Control Schemes
New
Performance
Large Scene Performance
Connection Redraw Performance
Reference Apps
AI Low-Code Platform
Schema Designer
Call Center Flow
UML Diagram
Tournament Bracket
Foblex Flow

Magnetic Lines

Description

Magnetic Lines add snap-to-align guides while you drag nodes in Foblex Flow for Angular.
When a dragged node gets close to another node, the plugin shows alignment lines and can snap the node to:

  • Left / center / right (X axis)
  • Top / center / bottom (Y axis)

This makes it easy to keep diagrams clean and consistent without manual pixel-perfect positioning.

Example

[example.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/extensions/magnetic-lines/example.html [example.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/extensions/magnetic-lines/example.ts [example.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/extensions/magnetic-lines/example.scss

How it works

  1. Add <f-magnetic-lines> inside <f-flow>.
  2. Set a threshold in pixels for when guide rendering and snapping should begin.
  3. Drag nodes until matching edges or centers enter the threshold zone.

Tip: Start with threshold="30–50" for a more Figma-like feel.

Configuration

threshold

threshold controls when magnetic lines appear and when snapping is applied.

  • Smaller value → fewer snaps, more manual control
  • Larger value → stronger snapping, easier alignment

Notes

  • Magnetic Lines are purely UX helpers: they don’t change your data model - they only help users position nodes while dragging.
  • You can style the guide lines via CSS (see the example .f-magnetic-lines .f-line rule).
Edit this page on GitHub