chore(examples): use new api

This commit is contained in:
moklick
2021-12-25 13:30:13 +01:00
parent 7a85bb9666
commit a969c63400
29 changed files with 398 additions and 523 deletions
+28
View File
@@ -0,0 +1,28 @@
import { FC } from 'react';
import { EdgeProps, getBezierPath } from 'react-flow-renderer';
const CustomEdge: FC<EdgeProps> = ({
id,
sourceX,
sourceY,
targetX,
targetY,
sourcePosition,
targetPosition,
data,
}) => {
const edgePath = getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition });
return (
<>
<path id={id} className="react-flow__edge-path" d={edgePath} />
<text>
<textPath href={`#${id}`} style={{ fontSize: '12px' }} startOffset="50%" textAnchor="middle">
{data.text}
</textPath>
</text>
</>
);
};
export default CustomEdge;