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

x6获取节点和边连接 #3700

Closed
liyu-2502189494 opened this issue Jun 20, 2023 · 6 comments
Closed

x6获取节点和边连接 #3700

liyu-2502189494 opened this issue Jun 20, 2023 · 6 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@liyu-2502189494
Copy link

问题描述

如何获取节点和边的连接位置,那个点的x,y值是多少

重现链接

重现步骤

任意一个节点和一条连接边,关于它的连接点位置获取

预期行为

我希望获取任意一个节点和一条连接边,关于它的连接点位置获取,它的x,y值是多少

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Jun 20, 2023

👋 @liyu-2502189494

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@NewByVector
Copy link
Contributor

可以使用以下方式获取:

view.getTerminalConnectionPoint('source')

不过需要等待连线完成渲染后才能获取到正确的位置。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Jun 23, 2023
@liyu-2502189494
Copy link
Author

您好,这个方法使用时报错,view.getTerminalConnectionPoint('source') is not function,在文档中也没有找到这个函数方法,

@liyu-2502189494
Copy link
Author

this.graph = new Graph({
container: document.getElementById("container"),
width: 800,
height: 600
});
this.graph.fromJSON(this.data)
this.graph.on('node:click',({e,x,y,node,view})=>{
// console.log(view.getTerminalConnectionPoint('source'));
console.log(node.getTerminalConnectionPoint('source'));
})
我是在这里看到报错

@NewByVector
Copy link
Contributor

@liyu-2502189494 这个是 edgeView 上的方法,而不是 nodeVIew。

@x6-bot
Copy link
Contributor

x6-bot bot commented Jun 29, 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 Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

2 participants