Skip to content

[Bug]: 在使用 antv-degre 时,往 combo 节点上添加边,会抛出异常:Cannot add edge ${edge.id}: source ${edge.source} or target ${edge.target} does not exist #7661

Description

@wangpengfeido

Describe the bug / 问题描述

目测是因为这里的问题 https://github.com/antvis/layout/blob/v5/src/algorithm/antv-dagre/graph.ts#L166

在布局 addEdge 时的检查中,this.nodes 并没有包含 combo 节点。
Image

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

  1. 使用 antv-dagre 布局创建 graph
  2. 调用 graph.addData() ,这是第一次添加数据,数据中包含 combo、node、edge,不会报错。
  3. 调用 graph.addEdgeData(),这一步添加连接在 combo 上的边。
  4. 调用 graph.render() ,抛出上述异常。

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for maintainerTriage or intervention needed from a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions