fix: workflow auto layout nodes offset & delete node shortcuts (#3484)

This commit is contained in:
zxhlyh 2024-04-15 14:05:20 +08:00 committed by GitHub
parent 459bed9243
commit d965b91b08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ const Workflow: FC<WorkflowProps> = memo(({
}) })
useKeyPress(['delete'], handleEdgeDelete) useKeyPress(['delete'], handleEdgeDelete)
useKeyPress(['delete'], handleNodeDeleteSelected) useKeyPress(['delete', 'backspace'], handleNodeDeleteSelected)
useKeyPress(['ctrl.c', 'meta.c'], handleNodeCopySelected) useKeyPress(['ctrl.c', 'meta.c'], handleNodeCopySelected)
useKeyPress(['ctrl.x', 'meta.x'], handleNodeCut) useKeyPress(['ctrl.x', 'meta.x'], handleNodeCut)
useKeyPress(['ctrl.v', 'meta.v'], handleNodePaste) useKeyPress(['ctrl.v', 'meta.v'], handleNodePaste)

View File

@ -175,8 +175,8 @@ export const getLayoutByDagre = (originNodes: Node[], originEdges: Edge[]) => {
dagreGraph.setGraph({ dagreGraph.setGraph({
rankdir: 'LR', rankdir: 'LR',
align: 'UL', align: 'UL',
nodesep: 64, nodesep: 40,
ranksep: 40, ranksep: 60,
}) })
nodes.forEach((node) => { nodes.forEach((node) => {
dagreGraph.setNode(node.id, { width: node.width, height: node.height }) dagreGraph.setNode(node.id, { width: node.width, height: node.height })