antvis/G2



The issue has been closed
“autoFit:true”导致brushXFilter错误,同时brushXFilter可能存在内存泄露 #5555
kikashine posted onGitHub
- G2 Version:5.1.2
- Platform:vue3
- Mini Showcase(like screenshots):
官方示例https://g2.antv.antgroup.com/examples/interaction/multi-view/#focus-context
上面的area是focus,下面是content
为focus在new时增加“autoFit:true” ,在上面focus中鼠标拉选一部分数据
brush:filter机制下应把框选部分放大显示,但此时focus为空白
focus未指定容器的css高度,图像上下颠倒
问题总结: 1、为focus增加“autoFit:true”,会导致brush:filter机制下鼠标拉选的数据绘制为空白。此时在content用鼠标拉选,focus的绘制也出现同样情况。
2、 为focus增加“autoFit:true”,若未指定容器的css高度,将绘制出一个上下颠倒的图像。
3、增加"clip:true"导致鼠标画出的mask不显示。 附:我不太确定“clip:true”是否存在及其作用。又查看了一遍文档似乎不存在?
4、当一切绘制正常时,鼠标拖拽mask使局部数据绘制更新,反复拖拽似乎导致内存占用快速飙升,且内存泄露。
官方示例代码略作调整可呈现问题:
/*-- 为容器增加高度设置 --*/
document.getElementById('container').innerHTML = `
<div id="focus" style="height:200px;"></div>
<div id="context" style="height:80px;"></div>
`;
/*-- 未设置高度时,图像上下颠倒 --*/
document.getElementById('container').innerHTML = `
<div id="focus" ></div>
<div id="context"></div>
`;
``` // Render focus View. const focus = new Chart({ container: 'focus', height: 360, paddingLeft: 60, autoFit: true, // -->此处增加设置项 clip: true // -->此处增加设置项? });
除此之外维持原有代码样貌。