feat(editor): dock flow arrows square at any pipe angle

Swap the filled-triangle arrowhead for an open arrow on flow pipes and
information links, and route flow pipes through a custom cubic edge whose
horizontal flatten arm scales with the vertical drop, not just the
horizontal gap. Vue Flow's default arm collapses toward zero when the
valve sits nearly above the stock, so a steep pipe stayed flat only in
its last pixels and the arrowhead detached from the visible line. The
pipe now keeps a real horizontal run into the stock's left edge at any
approach angle.
This commit is contained in:
Julien Calixte
2026-06-20 11:51:34 +02:00
parent df03012c8b
commit 21a459256a
3 changed files with 43 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ export function projectEdges(model: Model): FlowGraphEdge[] {
// Pipe in: source → valve. No arrowhead — the valve is the visual midpoint.
edges.push({
id: `${node.id}::in`,
type: "pipe",
source: node.source,
sourceHandle: HANDLE_OUT,
target: node.id,
@@ -64,13 +65,14 @@ export function projectEdges(model: Model): FlowGraphEdge[] {
// Pipe out: valve → target. Arrowhead carries the flow direction.
edges.push({
id: `${node.id}::out`,
type: "pipe",
source: node.id,
sourceHandle: HANDLE_OUT,
target: node.target,
targetHandle: HANDLE_IN,
data: { kind: "pipe" },
style: { strokeWidth: "2.5px" },
markerEnd: "arrowclosed",
markerEnd: "arrow",
})
}
@@ -86,7 +88,7 @@ export function projectEdges(model: Model): FlowGraphEdge[] {
targetHandle: HANDLE_IN,
data: { kind: "info", polarity: link.polarity },
style: { strokeDasharray: "5 4" },
markerEnd: "arrowclosed",
markerEnd: "arrow",
})
}