import React from 'react'; import { getSmoothStepPath, EdgeText } from 'reactflow'; // Custom animated edge component with contextual styling const CustomEdge = (props) => { const { id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style = {}, markerEnd, data, label, labelStyle, labelShowBg = true } = props; // Get edge path based on the edge type (default to smoothstep) const [edgePath, labelX, labelY] = getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius: 20, // Add rounded corners to the paths }); // Determine edge style based on source node type const sourceType = data?.sourceType || 'default'; // Default style if nothing specific is provided const edgeStyle = { strokeWidth: 3, // Increase stroke width from default ...style, }; return ( <> {/* Main path */} {/* Glow effect for the path */} {/* Edge label */} {label && ( )} ); }; // Define edge types for ReactFlow export const customEdgeTypes = { custom: CustomEdge, }; export default CustomEdge;