antvis/G6

有两个node节点,手动组合一起。组合出现在0.0点 #5857

zhangsai521314 posted onGitHub

Describe the bug / 问题描述

步骤1:先addComboData了一个组合,设置了id和type 步骤2:设置两个node的combo为新组合的id 步骤3:通过updateNodeData更新node 步骤4:调用draw 现象:新生成的组合的位置会在0,0点,鼠标点击组合的node时新的组合框会渲染至正确的位置

https://stackblitz.com/edit/react-sbmb98?file=index.js

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

步骤1:先addComboData了一个组合,设置了id和type 步骤2:设置两个node的combo为新组合的id 步骤3:通过updateNodeData更新node 步骤4:调用draw 现象:新生成的组合的位置会在0,0点,鼠标点击组合的node时新的组合框会渲染至正确的位置


基于 immutable 原则 ,使用下面的方法更新数据

<img width="346" alt="image" src="https://github.com/antvis/G6/assets/25787943/0471f607-52d0-4e14-8729-91f1d429b344">

posted by Aarebecca 11 months ago

好的,这样更新确实可以

posted by zhangsai521314 11 months ago

Fund this Issue

$0.00
Funded

Pull requests