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
Drag to Connect
Drag to Reassign
Create Node on Connection Drop
Remove Connection on Drop
Assign Node to Connection on Drop
Auto Snap
Connection Types (Straight, Segment, Bezier, Adaptive Curve)
Custom Connection Type
Connection Behaviours
Connection Markers
Connection Content
New
Connection Waypoints
New
Custom Connections
Connection Connectable Side
New
Extensions
Add Node from Palette
Selection Area
Help in Positioning (Legacy)
Deprecated
Magnetic Lines
New
Magnetic Rects
New
Grid System
Minimap
Zoom
Updated
Background
Updated
Advanced
Large Scene Performance
Updated
Connection Redraw Performance
Updated
Cut/Copy/Paste
New
Undo/Redo
Undo/Redo V2
New
Dagre Layout (Directed Graph)
ELKJS Layout (Directed Graph)
Drag Start/End Events
Custom Event Triggers
Reference Apps
AI Low-Code Platform
New
DB Management
UML Diagram
Tournament Bracket
Foblex Flow

Dagre Tree

Description

This example demonstrates automatic graph layout using dagre.js together with Foblex Flow and Angular. The component builds a tree from a set of nodes and edges, computes positions using dagre.layout(graph), and renders nodes and connections on the flow canvas.

Example

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

What this example shows

  • Switching layout direction: left-to-right and top-to-bottom.
  • Optional auto layout behavior, where the flow resets before recalculation.
  • Automatic viewport fitting after layout completes.

Technical details

  • The graph is built using dagre.graphlib.Graph.
  • Nodes come from GRAPH_DATA, while edges are derived from parentId.
  • After layout, coordinates are mapped back into your Angular node state.

When to use it

Use Dagre when your diagram has a mostly hierarchical structure and you want a predictable directed layout for org charts, dependency graphs, or workflow trees.

Related docs and examples

Edit this page on GitHub