Merge branch 'v10' into refactor/nodes-edges-state
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { EdgeProps, getBezierPath, getMarkerEnd } from 'react-flow-renderer';
|
||||
import { EdgeProps, getBezierPath } from 'react-flow-renderer';
|
||||
|
||||
const CustomEdge: FC<EdgeProps> = ({
|
||||
id,
|
||||
@@ -10,15 +10,12 @@ const CustomEdge: FC<EdgeProps> = ({
|
||||
sourcePosition,
|
||||
targetPosition,
|
||||
data,
|
||||
arrowHeadType,
|
||||
markerEndId,
|
||||
}) => {
|
||||
const edgePath = getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition });
|
||||
const markerEnd = getMarkerEnd(arrowHeadType, markerEndId);
|
||||
|
||||
return (
|
||||
<>
|
||||
<path id={id} className="react-flow__edge-path" d={edgePath} markerEnd={markerEnd} />
|
||||
<path id={id} className="react-flow__edge-path" d={edgePath} />
|
||||
<text>
|
||||
<textPath href={`#${id}`} style={{ fontSize: '12px' }} startOffset="50%" textAnchor="middle">
|
||||
{data.text}
|
||||
|
||||
Reference in New Issue
Block a user