antvis/G6


The issue has been closed
Combo收缩时changeData重新加载相同一份数据后Combo内部节点和线条错位 #4751
youbins posted onGitHub
问题描述
Combo收缩时changeData重新加载相同一份数据后Combo内部节点和线条错位(注:拓扑不管Combo还是Node都是指定(x,y)坐标的)
1、首次初始化并加载数据
// 首次加载时装载数据部分代码
let dtreeData = _topo.dtreeData,
g6GrapData = _topo.g6GraphData;
_topo.performance['renderStart'] = new Date().getTime();
_topo.initDtree(dtreeData);
_topo.processParallelEdges(g6GrapData.edges);
_topo.g6Graph.read(g6GrapData);
_topo.performance['initEnd'] = _topo.performance['renderEnd'] = new Date().getTime();
_topo.exFunction(callback);
_topo.printPerformance();
2、Combo收缩时使用changeData重新加载相同的一份数据(异常)
# 使用changeData重新装载数据部分代码
let dtreeData = _topo.dtreeData,
g6GrapData = _topo.g6GraphData;
_topo.performance['renderStart'] = new Date().getTime();
_topo.reloadDtree(dtreeData);
_topo.processParallelEdges(g6GrapData.edges);
__topo.g6Graph.changeData(g6GrapData, false);_
_topo.performance['refreshEnd'] = _topo.performance['renderEnd'] = new Date().getTime();
_topo.refreshNeAlarmInfo(_topo.prevAlarmInfo);
_topo.exFunction(callback);
_topo.printPerformance();
如果刷新前,Combo是收缩状态,此时使用changeData重新装载数据,再展开Combo则发现其内节点和边位置发生错位。
3、Combo展开时使用changeData重新加载相同的一份数据(恢复正常)
如果刷新前,Combo是展开状态,此时使用changeData重新装载数据,再展开Combo则发现其内节点和边位置恢复正常。
重现链接
Combo
重现步骤
1、Combo和Node指定x,y坐标,假设第一步使用数据A初始化拓扑。 2、Combo收缩状态时使用changeData重新装载一次数据A(异常)。 3、Combo展开状态时使用changeData重新装载一次数据A(恢复正常)。
预期行为
正常情况下,相同一份数据,不管Combo在使用changeData前是处于展开亦或收缩状态,其内节点和线条位置应保持一致才对。
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
- G6 版本: [4.5.1 ... ]
屏幕截图或视频(可选)
No response
补充说明(可选)
No response