in src/components/graph-view.js [1248:1277]
dragEdge(draggedEdge?: IEdge, mouse: typeof d3.mouse) {
const { nodeSize, nodeKey } = this.props;
draggedEdge = draggedEdge || this.state.draggedEdge;
if (!draggedEdge) {
return;
}
const mouseCoordinates = this.getMouseCoordinates(mouse);
const targetPosition = {
x: mouseCoordinates[0],
y: mouseCoordinates[1],
};
const off = calculateOffset(
nodeSize,
(this.getNodeById(draggedEdge.source): any).node,
targetPosition,
nodeKey
);
targetPosition.x += off.xOff;
targetPosition.y += off.yOff;
this.syncRenderEdge({ source: draggedEdge.source, targetPosition });
this.setState({
draggedEdge,
draggingEdge: true,
});
}