Skip to content

create-edge 在自定义 react-node下边创建方向异常 #7261

@resuscitate

Description

@resuscitate

问题描述

在使用create-edge 行为时,边创建功能在内置 rect 节点类型下正常运行,但在自定义 react-node 类型下失效。具体表现为:

  • 使用 rect 节点:点击一个节点可开始绘制临时边,点击另一个节点完成边创建。
  • 使用 react-node 节点:点击节点,鼠标放置另一个节点上。 生成的边不在另一个节点上而是在相反的方向。

问题似乎与 react-nodecreate-edge 行为的兼容性有关。

截图:

  • 使用 rect 正常工作react-node-failing.png
  • 使用 react-node 失效rect-working.png

复现链接

https://codesandbox.io/p/sandbox/determined-leftpad-7xclcf?file=%2Findex.tsx

期望行为

react自定义节点应与官方节点类型效果相同。

环境信息

  • G6 版本: 5.0.48
  • 操作系统: Windows
  • 浏览器: Chrome(版本 126.0.6478.127)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature 💡A new feature request or an enhancement proposalneed 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