antvis/G6

拖动节点出现掉线的情况 #4733

jiechuan1221 posted onGitHub

https://codesandbox.io/s/unruffled-bardeen-wcm4wk?file=/index.js <img width="302" alt="image" src="https://github.com/antvis/G6/assets/71835600/9bd9ee9f-b493-48b6-b1eb-28106a1ec074">

<img width="384" alt="image" src="https://github.com/antvis/G6/assets/71835600/307188aa-8a34-46d0-b5b0-9563ae325203"> 这个是我复现的一个demo,大大可以帮忙看一下掉线的原因吗



function refreshDragedNodePosition(e) {
    const model = e.item.get('model');
    model.fx = e.x;
    model.fy = e.y;
}
graph.on('node:dragstart', (e) => {
    graph.layout();
    refreshDragedNodePosition(e);
});
graph.on('node:drag', (e) => {
    refreshDragedNodePosition(e);
});
posted by GemT27 almost 2 years ago

节点和边的每一条数据都必须给唯一的 string 作为 id,你的 demo 中所有边的 id 都是 ''

posted by Yanyan-Wang almost 2 years ago

嗷嗷,谢谢大大!不掉了!

posted by jiechuan1221 almost 2 years ago

谢谢啦

posted by jiechuan1221 almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests