Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: workflow edge curvature (#3488)

zxhlyh58cbda29504e
diff --git a/web/app/components/workflow/custom-connection-line.tsx b/web/app/components/workflow/custom-connection-line.tsx
index a411370b05f..c187f16fe18 100644
--- a/web/app/components/workflow/custom-connection-line.tsx
+++ b/web/app/components/workflow/custom-connection-line.tsx
@@ -2,19 +2,20 @@ import { memo } from 'react'
import type { ConnectionLineComponentProps } from 'reactflow'
import {
Position,
- getSimpleBezierPath,
+ getBezierPath,
} from 'reactflow'
const CustomConnectionLine = ({ fromX, fromY, toX, toY }: ConnectionLineComponentProps) => {
const [
edgePath,
- ] = getSimpleBezierPath({
+ ] = getBezierPath({
sourceX: fromX,
sourceY: fromY,
sourcePosition: Position.Right,
targetX: toX,
targetY: toY,
targetPosition: Position.Left,
+ curvature: 0.16,
})
return (
diff --git a/web/app/components/workflow/custom-edge.tsx b/web/app/components/workflow/custom-edge.tsx
index 3575389c8e1..072aad8d542 100644
--- a/web/app/components/workflow/custom-edge.tsx
+++ b/web/app/components/workflow/custom-edge.tsx
@@ -9,7 +9,7 @@ import {
BaseEdge,
EdgeLabelRenderer,
Position,
- getSimpleBezierPath,
+ getBezierPath,
} from 'reactflow'
import {
useNodesExtraData,
@@ -38,13 +38,14 @@ const CustomEdge = ({
edgePath,
labelX,
labelY,
- ] = getSimpleBezierPath({
+ ] = getBezierPath({
sourceX: sourceX - 8,
sourceY,
sourcePosition: Position.Right,
targetX: targetX + 8,
targetY,
targetPosition: Position.Left,
+ curvature: 0.16,
})
const [open, setOpen] = useState(false)
const { handleNodeAdd } = useNodesInteractions()