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

[Bug report]自定义边里面调用graphModel.getNodeModelById(),lf.changeNodeId()后会报错 #864

Closed
huzhigao opened this issue Nov 10, 2022 · 6 comments
Assignees
Labels
优化 New feature or request

Comments

@huzhigao
Copy link

codesanbox地址:https://codesandbox.io/s/beautiful-benji-lr4cg4?file=/src/index.js:1255-1267

@towersxu
Copy link
Collaborator

目前是不支持这样调用,请问是什么情况需要在这里调用这些api?

@huzhigao
Copy link
Author

想在自定义边的getEdge方法里面通过graphModel.getNodeModelById获取开始节点的x坐标和y坐标,然后跟边的开始和结束坐标来比较判断边是从哪个锚点连出来的

@towersxu towersxu added the 优化 New feature or request label Jan 13, 2023
@DymoneLewis
Copy link
Collaborator

可以从model.sourceAnchorId属性获取到边的起始锚点,辛苦看下是否满足诉求呢

@huzhigao
Copy link
Author

huzhigao commented May 9, 2024

getEdge() {
const { model } = this.props
const { targetNode } = model
}
现在getEdge方法里面可以取到targetNode,但在用lf.changeNodeId改变targetNode的id后,targetNode会变成undefined,麻烦看下

@DymoneLewis
Copy link
Collaborator

确实有这个问题,这边排查下原因

@boyongjiong
Copy link
Collaborator

已发版 2.0.1,请升级后使用,如有问题再新建 issue 关联此 issue,先关闭本 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
优化 New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants