This page shows how to use @foblex/flow-dagre-layout to calculate a manual graph layout with Dagre and then render the result with Foblex Flow.
The important split is:
@foblex/flow-dagre-layout calculates positions@foblex/flow renders nodes, connections, zoom, drag, and viewport behavior[example.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/dagre-layout/example.html [example.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/dagre-layout/example.ts [example.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/dagre-layout/example.scss [apply-layout.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/utils/apply-layout.ts [generate-graph.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/utils/generate-graph.ts [layout-connection-sides.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/utils/layout-connection-sides.ts [layout-controls.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/libs/f-examples/plugins/utils/layout-controls.ts
If your project already includes a custom Flow theme, you can keep schematic installation but skip style injection:
For Nx workspaces:
ng add checks @foblex/flow and the required Foblex companion packages, adds only the missing ones, and wires the default Flow theme into application styles when it is missing.
If you prefer manual installation:
You do not need to install the underlying dagre package separately because the adapter ships it as a runtime dependency.
calculate(...) returns only calculated node positions. In a real app you merge them back into your own node model by id.
IFLayoutNode[] and IFLayoutConnection[].calculate(...) on DagreLayoutEngine.f-flow.direction: graph direction via EFLayoutDirectionalgorithm: Dagre ranker via EDagreLayoutAlgorithmnodeGap: spacing between nodes on the same levellayerGap: spacing between levelsdefaultNodeSize: fallback size when a node does not provide sizeUse Dagre when your diagram has a mostly hierarchical structure and you want a predictable directed layout for org charts, dependency graphs, or workflow trees.