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

G6节点x,y坐标读取错误 #5492

Closed
zuimenggucheng opened this issue Mar 5, 2024 · 3 comments
Closed

G6节点x,y坐标读取错误 #5492

zuimenggucheng opened this issue Mar 5, 2024 · 3 comments

Comments

@zuimenggucheng
Copy link

问题描述

image ![image](https://github.com/antvis/G6/assets/43475070/ab2bc5a3-47dc-4a42-a8f1-6fb4c48baf0e) 如截图所示,使用G6绘制自定义节点且为树状图展示时,为了方便拖拽父元素子元素随之更新位置进行移动,此处使用方法获取子元素model和父元素model。但是遇到问题打印出来的model里面的x,y值和model.x,model.y输出值不一致。 后续在生成graph.data(data)中的data数据的nodes数据时增加x,y默认值此现象消失

重现链接

https://g6.antv.vision/zh/examples/net/dagreFlow/#basicDagre

重现步骤

1.绘制流程图
https://g6.antv.vision/zh/examples/net/dagreFlow/#basicDagre
2.采用自定义节点
3.graph.data(data)其中data的nodes数据设置时不设置x,y
4.graph.findById获取对应节点
5.获取上述节点的model。 nodes.getModel() 同时打印
6.打印nodesModel.x,nodesModel.y数据不一致

预期行为

未设置x,y时数据读取展示也能一至

平台

  • 操作系统: [ Windows11]
  • 网页浏览器: [ Chrome,]
  • G6 版本: [4.8.7]

屏幕截图或视频(可选)

image ![image](https://github.com/antvis/G6/assets/43475070/ab2bc5a3-47dc-4a42-a8f1-6fb4c48baf0e)

补充说明(可选)

业务需求,树形显示组织架构并且支持拖拽进行更新组织架构

@zuimenggucheng
Copy link
Author

image

@AFufuaa
Copy link

AFufuaa commented Mar 20, 2024

请问解决了嘛?我也获取不到正确的坐标,这个获取到的看起来像中间变化的坐标
image

@zuimenggucheng
Copy link
Author

zuimenggucheng commented Mar 20, 2024 via email

@hustcc hustcc closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants