[Bug]: 在使用 antv-degre 时,往 combo 节点上添加边,会抛出异常:Cannot add edge ${edge.id}: source ${edge.source} or target ${edge.target} does not exist
Author: wangpengfeidoCreated May 26, 2026Updated May 27, 2026
Labelswaiting for maintainer
Describe the bug / 问题描述
目测是因为这里的问题 https://github.com/antvis/layout/blob/v5/src/algorithm/antv-dagre/graph.ts#L166
在布局 addEdge 时的检查中,this.nodes 并没有包含 combo 节点。
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
- 使用 antv-dagre 布局创建 graph
- 调用 graph.addData() ,这是第一次添加数据,数据中包含 combo、node、edge,不会报错。
- 调用 graph.addEdgeData(),这一步添加连接在 combo 上的边。
- 调用 graph.render() ,抛出上述异常。
Version / 版本
5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他
Source: antvis/G6