Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用连接桩时 没有目标节点的情况下 能否自动创建一个节点 然后生成线呢 #3831

Closed
History-1024 opened this issue Aug 8, 2023 · 2 comments

Comments

@History-1024
Copy link

问题描述

0071b376fc9cd99604c8c50bc4bc129

如图 在示例中 我在连接桩中拖拽出一条线 但是没有目标节点 此时能否自动创建一个节点,并生成线

重现链接

暂无

重现步骤

请看问题描述

预期行为

我期望看到 可以在拖拽连接线结束后有能生成节点的方法 能解决我的问题

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox ...]
  • X6 版本: [2.11.1 ...]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@History-1024
Copy link
Author

没有相关的连接桩事件但是我用了其他的方法
通过连接线的事件来完成该功能

 this.graph.on('edge:mouseup', ({ edge, e }) => {
        const zoom = this.graph.zoom()
        if (edge.getTargetCell() == null) {
          //未连接目标节点时在鼠标释放位置创建新节点
          let { clientX, clientY } = e
          const point = this.graph.clientToLocal(clientX, clientY)
          const targetNode = this.createNode('JOIN', { x: point.x, y: point.y })
          //将连接线的目标端接到新的节点
          this.createEdge(edge.source.cell, targetNode.id)
        }
      })

@x6-bot
Copy link
Contributor

x6-bot bot commented Aug 9, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant