/Connections are SVG paths between measured connector elements. Choose a flowing Bezier curve or an orthogonal SmoothStep path, then configure arrowheads, labels and CSS variables independently from the graph data.
Connection rendering is shared by existing model edges and interactive draft creation. The connector's position input supplies the path direction.
graph-editor.component.ts
provideNgDrawFlowConfigs({
connection: {
type: DfConnectionType.SmoothStep,
curvature: 16,
arrowhead: {
type: DfArrowhead.ArrowClosed,
width: 10,
height: 6,
},
},
});
| Option | Default | Behavior |
|---|---|---|
type | Bezier | Selects Bezier or SmoothStep calculation. |
curvature | 0.25 | Bezier bend coefficient or SmoothStep radius in pixels. |
arrowhead.type | None | Uses Arrow , ArrowClosed or no marker. |
arrowhead.width / height | 8 / 4 | Target marker dimensions in pixels. |
Bezier edges are cubic curves. Their dimensionless curvature coefficient scales with connector distance, so the same value remains useful across short and long edges.
SmoothStep edges use horizontal and vertical segments joined by rounded bends. Their curvature value is the corner radius in pixels, making them suitable for tree and process layouts.
Selecting a node distinguishes both directions: incoming edges use the input highlight palette and outgoing edges use the output palette. Selecting an edge applies the active connection color. Delete or Backspace removes the selected edge when connectionsDeletable is enabled.
Programmatic deletion is available through removeConnection() on NgDrawFlowComponent and NgDrawFlowStoreService . The source and target endpoints identify the matching connection.
Style the visible path, larger selectable hit area, active edge, directional node highlights and labels with CSS variables on ng-draw-flow . The hit area width does not change the visible stroke.
styles.less
ng-draw-flow {
--df-connection-color: #428bf9;
--df-connection-color-hover: #155eef;
--df-connection-color-active: #004eeb;
--df-connection-stroke-width: 0.125rem;
--df-connection-selectable-area-stroke-width: 0.75rem;
--df-connection-selected-node-input-color: #156ed4;
--df-connection-selected-node-output-color: #f97316;
--df-connection-label-background: #fff;
--df-connection-label-border-color: #b1b1b7;
--df-connection-label-border-radius: 0.25rem;
--df-connection-label-padding: 0.25rem 0.375rem;
}