antvis/G6



The issue has been closed
layout为radial时,通过addItem添加节点不符合radial布局 #5281
zhang759740844 posted onGitHub
G6 Version
4.x
Describe the bug
业务诉求是:通过 radial 布局展示数据,并且希望双击加载更多数据。
我的做法:
- 尝试通过 addItem 添加 node 和 edge,但是添加之后因为 node 没有 x,y所以渲染在默认的位置上。不符合 radial 布局
- 尝试通过 render 或者 updateLayout 重绘,node 和 edge 布局变化,没有再原来位置
- 尝试将第一次渲染的node的 x,y保存起来,下次重绘时设置上去,实际测试无效果,被 radial 布局覆盖了
Your Example Website or App
Steps to Reproduce the Bug or Issue
- 双击 “node_23456 双击此节点添加节点” 节点,新增节点在默认位置,不符合 radial 布局
Expected behavior
添加的新节点也符合 radial 布局
Screenshots or Videos
https://img.alicdn.com/imgextra/i4/O1CN01h68ctP1TGBFVgr3Ln_!!6000000002354-0-tps-508-458.jpg
Platform
- OS: macOS
- Browser: Chrome
- Version: 119.0.6045.199
Additional context
No response