@@ -25,11 +25,13 @@ export type EdgeDefaultV12DataProps = Record<string, unknown> & {
2525 * Size of the "glow" effect when the edge is hovered.
2626 */
2727 pathGlowWidth ?: number ;
28- /*
29- * Direction of the SVG path is inversed.
30- * This is important for the placement of the markers and the animation movement.
28+ /**
29+ * Controls where arrow heads appear on the edge.
30+ * - `normal`: arrow at the end (target)
31+ * - `inversed`: arrow at the start (source)
32+ * - `bidirectional`: arrows at both start and end
3133 */
32- inversePath ?: boolean ;
34+ arrowDirection ?: "normal" | "inversed" | "bidirectional" ;
3335 /**
3436 * Callback handler that returns a React element used as edge title.
3537 */
@@ -64,7 +66,15 @@ export const EdgeDefaultV12 = memo(
6466 data = { } ,
6567 ...edgeOriginalProperties
6668 } : EdgeProps < Edge < EdgeDefaultV12DataProps > > ) => {
67- const { pathGlowWidth = 10 , highlightColor, renderLabel, edgeSvgProps, intent, inversePath, strokeType } = data ;
69+ const {
70+ pathGlowWidth = 10 ,
71+ highlightColor,
72+ renderLabel,
73+ edgeSvgProps,
74+ intent,
75+ strokeType,
76+ arrowDirection = "normal" ,
77+ } = data ;
6878
6979 const [ edgePath , labelX , labelY ] = getBezierPath ( {
7080 sourceX,
@@ -103,6 +113,13 @@ export const EdgeDefaultV12 = memo(
103113 />
104114 ) : null ) ;
105115
116+ const markerStart =
117+ arrowDirection === "inversed" || arrowDirection === "bidirectional"
118+ ? "url(#arrow-closed-reverse)"
119+ : undefined ;
120+ const markerEnd =
121+ arrowDirection === "normal" || arrowDirection === "bidirectional" ? "url(#arrow-closed)" : undefined ;
122+
106123 return (
107124 < g
108125 className = {
@@ -136,8 +153,8 @@ export const EdgeDefaultV12 = memo(
136153 < BaseEdge
137154 id = { id }
138155 path = { edgePath }
139- markerStart = { inversePath ? "url(#arrow-closed-reverse)" : undefined }
140- markerEnd = { ! inversePath ? "url(#arrow-closed)" : undefined }
156+ markerStart = { markerStart }
157+ markerEnd = { markerEnd }
141158 className = { edgeDefaultUtils . createEdgeDefaultClassName ( { strokeType } ) }
142159 interactionWidth = { pathGlowWidth }
143160 style = { {
0 commit comments