antvis/G6



The issue has been closed
antv-dagre error "Edge not found for id:", the edge and id exist on the graph, and it is no problem to replace it with dagre #6477
xiaoxiaofu1 posted onGitHub
Describe the bug / 问题描述
const layouts = [ { type: 'antv-dagre', // type: 'dagre', label: '层次布局', rankdir: 'LR', nodeSep: 30, ranksep: 700, icon: <ApartmentOutlined />, } ]; const handleLayout = () => { const selectedNodesIds = graph.getElementDataByState('node', 'selected').map((item) => item.id); const nodeFilter = (item) => selectedNodesIds.includes(item.id); const begin = graph.getViewportCenter(); const config = mode === 'global' ? layout : { ...layout, nodeFilter, begin }; graph.setLayout(config); graph.layout() }; 如图是部分代码,如果把antv-dagre改成dagre就没有这个错误
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
No response
G6 Version / G6 版本
🆕 5.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
No response