antvis/G6

如何监听拖拽批量圈选节点事件? #4773

XiaoRIGE posted onGitHub

Describe the bug

不知道如何监听圈选后的拖拽,文档里边的nodeselectchange只能监听到被圈选的节点的状态改变,没法监听拖拽结束事件。

Your Example Website or App

www.test.com

Steps to Reproduce the Bug or Issue

1.圈选中页面中部分节点 2.拖动被选中节点的位置 3.希望监听拖拽结束事件,获取最新的位置信息

Expected behavior

能够监听

Screenshots or Videos

No response

Platform

  • OS: [Windows]
  • Browser: [Chrome]

Additional context

No response


graph.on('node:dragend', e => {})

posted by Yanyan-Wang over 1 year ago

使用这个方法拿到的只有其中一个节点的数据,如何取到每个节点更新后的位置呢?

posted by XiaoRIGE over 1 year ago

我希望拿到的是被拖拽的所有节点的位置信息

posted by XiaoRIGE over 1 year ago

我希望拿到的是被拖拽的所有节点的位置信息

1、监听nodeselectchange,获取框选的节点,保存下来。 2、监听node:dragend,遍历框选的节点,重新获取位置信息。

posted by LeaveZzz over 1 year ago

我希望拿到的是被拖拽的所有节点的位置信息

1、监听nodeselectchange,获取框选的节点,保存下来。 2、监听node:dragend,遍历框选的节点,重新获取位置信息。

这个可以解决我目前的问题

posted by XiaoRIGE over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests