From 21a459256a82ec1ae3b2bfcf28d323fb02307cbd Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 20 Jun 2026 11:51:34 +0200 Subject: [PATCH] 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. --- src/components/Editor.vue | 4 ++++ src/components/edges/PipeEdge.vue | 35 +++++++++++++++++++++++++++++++ src/model/projection.ts | 6 ++++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/components/edges/PipeEdge.vue diff --git a/src/components/Editor.vue b/src/components/Editor.vue index e612a7f..4943fa9 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -36,6 +36,7 @@ import GlossPanel from "./GlossPanel.vue" import LoopOverlay from "./LoopOverlay.vue" import Palette from "./Palette.vue" import InfoLinkEdge from "./edges/InfoLinkEdge.vue" +import PipeEdge from "./edges/PipeEdge.vue" import CloudNode from "./nodes/CloudNode.vue" import ConverterNode from "./nodes/ConverterNode.vue" import FlowNode from "./nodes/FlowNode.vue" @@ -405,6 +406,9 @@ onBeforeUnmount(() => { + diff --git a/src/components/edges/PipeEdge.vue b/src/components/edges/PipeEdge.vue new file mode 100644 index 0000000..93d1942 --- /dev/null +++ b/src/components/edges/PipeEdge.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/model/projection.ts b/src/model/projection.ts index d39ec1d..0bc10cb 100644 --- a/src/model/projection.ts +++ b/src/model/projection.ts @@ -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", }) }