Selector: [fNode]
Class: FNodeDirective
FNodeDirective turns any element into a node inside a Foblex Flow diagram: it can be positioned on the canvas, selected, dragged (with fDraggable), and used as a host for connectors.
Nodes must be placed inside f-canvas (which itself must be inside f-flow).
To drag nodes, enable fDraggable on the flow and provide a drag handle inside the node:
Place connector directives inside the node and connect them using f-connection.
fNodePositionChange after a drag ends), keeping your data model as the source of truth.fNodeId: InputSignal<string>; Node identifier. Default: f-node-${uniqueId++}. Use a stable id if you want selection/state to survive rerenders.
fNodeParentId: InputSignal<string | null | undefined>; Parent node/group id (logical hierarchy). Default: null. Enables container behaviors such as bounds restrictions and auto-size rules (when used).
fNodePosition: ModelSignal<IPoint>; Node position in flow coordinates. This is the primary property that defines where the node is rendered.
fNodeSize: InputSignal<ISize | undefined>; Optional fixed size. If omitted, the size is measured from content (content changes can affect connection routing).
fNodeRotate: ModelSignal<number>; Default: 0. Rotation (degrees). Affects node geometry and connector placement.
fConnectOnNode: InputSignal<boolean>; Default: true. Allows dropping a connection onto the node body (not directly on an input). The library will choose the first available connectable input.
fMinimapClass: InputSignal<string | string[]>; Extra CSS class(es) applied in the minimap only.
fNodeDraggingDisabled: InputSignal<boolean>; Default: false. Locks dragging for this node (useful for read-only/locked nodes).
fNodeSelectionDisabled: InputSignal<boolean>; Default: false. Prevents selecting this node.
fIncludePadding: InputSignal<boolean>; Default: true. When the node has a child, this controls whether the parent’s CSS padding is considered when restricting child movement.
fAutoExpandOnChildHit: InputSignal<boolean>; Default: false. Container UX: auto-expand a collapsed parent when a child is dragged into it.
fAutoSizeToFitChildren: InputSignal<boolean>; Default: false. Container UX: resize the parent node so all children fit inside it.
Important: outputs are designed for state persistence.
In typical drag flows, you react to the final result (not per-mousemove streaming).
fNodePositionChange: OutputEmitterRef<IPoint>;
Emits when the final node position is committed by an interaction (for example, after drag ends).
fNodeRotateChange: OutputEmitterRef<number>;
Emits when rotation is committed (after rotate interaction ends).
fNodeSizeChange: OutputEmitterRef<IRect>;
Emits when resize is committed (after resize ends). Payload is the resulting rect.
refresh(): void; Forces a node refresh for cases where geometry/connector placement must be recalculated (for example, after significant DOM/content changes that affect size/anchors)..f-component Base class for flow primitives..f-node Node host class..f-node-dragging-disabled Applied when fNodeDraggingDisabled = true..f-node-selection-disabled Applied when fNodeSelectionDisabled = true..f-selected Applied when the node is selected.fNodeSize), dynamic content changes can cause re-measuring and affect connection routes — this is expected.fNodeParentId, make sure the referenced parent id exists; otherwise hierarchy-based behaviors won’t apply.[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/nodes/custom-nodes/custom-nodes.component.html [component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/nodes/custom-nodes/custom-nodes.component.ts [component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/nodes/custom-nodes/custom-nodes.component.scss [common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.scss