Skip to content

graph.removeNodeData([node.id]) 删除节点是会报错uncaught Error: Node not found for id: 3s1W-xAqQQ #7457

@woderlili

Description

@woderlili

Describe the bug / 问题描述

  deleteNode = async (event) => {
    console.log(event, 'deleteNode')
    const { graph, element } = this.context
    const node = graph.getNodeData(event.id)
    await graph.removeNodeData([node.id])
    await graph.render()
  }

我是用graph.removeNodeData删除节点的时候,就会报错

Image 当我将graph.render()改成graph.draw(),也会报错 Image

Reproduction link / 复现链接

No response

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

No response

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

    duplicateThis issue or PR already exists and may be closed with a reference to the originalneed improvementLack of information or incorrect format

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions