refactor(floating-edges-example): comments and cleanup

This commit is contained in:
moklick
2021-10-14 12:29:05 +02:00
parent ab2391fd51
commit ceb96201de
5 changed files with 74 additions and 55 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { FC, useMemo, CSSProperties } from 'react';
import { EdgeProps, getMarkerEnd, useStoreState, getBezierPath } from 'react-flow-renderer';
import { getArrow } from './utils';
import { getEdgeParams } from './utils';
const FloatingEdge: FC<EdgeProps> = ({ id, source, target, arrowHeadType, markerEndId, style }) => {
const nodes = useStoreState((state) => state.nodes);
@@ -14,7 +14,7 @@ const FloatingEdge: FC<EdgeProps> = ({ id, source, target, arrowHeadType, marker
return null;
}
const { sx, sy, tx, ty, sourcePos, targetPos } = getArrow(sourceNode, targetNode);
const { sx, sy, tx, ty, sourcePos, targetPos } = getEdgeParams(sourceNode, targetNode);
const d = getBezierPath({
sourceX: sx,