feat(edgeUpdater): add edgeUpdaterRadius prop

This commit is contained in:
Eugene Samonenko
2021-03-03 13:10:33 +02:00
parent b71c9eb891
commit d89be58e54
6 changed files with 15 additions and 4 deletions
+3
View File
@@ -110,6 +110,7 @@ export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
zoomOnDoubleClick?: boolean;
onEdgeUpdate?: OnEdgeUpdateFunc;
onEdgeContextMenu?: (event: MouseEvent, nodes: Edge) => void;
edgeUpdaterRadius?: number
}
const ReactFlow = ({
@@ -175,6 +176,7 @@ const ReactFlow = ({
children,
onEdgeUpdate,
onEdgeContextMenu,
edgeUpdaterRadius = 10,
...rest
}: ReactFlowProps) => {
const nodeTypesParsed = useMemo(() => createNodeTypes(nodeTypes), []);
@@ -243,6 +245,7 @@ const ReactFlow = ({
onSelectionContextMenu={onSelectionContextMenu}
onEdgeUpdate={onEdgeUpdate}
onEdgeContextMenu={onEdgeContextMenu}
edgeUpdaterRadius={edgeUpdaterRadius}
/>
<ElementUpdater elements={elements} />
{onSelectionChange && <SelectionListener onSelectionChange={onSelectionChange} />}