antvis/G2

“autoFit:true”导致brushXFilter错误,同时brushXFilter可能存在内存泄露 #5555

kikashine posted onGitHub

brush:filter机制下应把框选部分放大显示,但此时focus为空白 bug002

focus未指定容器的css高度,图像上下颠倒 屏幕截图 2023-09-16 234147

问题总结: 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 // -->此处增加设置项? });

除此之外维持原有代码样貌。


  1. 第一个问题,如果设置 autoFit 为 true,必须具有 css 高度和宽度
  2. 绘制不全是指?
  3. 第三个需要排查一下
posted by pearmini over 1 year ago
  1. 第一个问题,如果设置 autoFit 为 true,必须具有 css 高度
  2. 绘制不去是指?
  3. 第三个需要排查一下

抱歉,之前可能描述不清,重新调整了一下表达。

posted by kikashine over 1 year ago

这个问题应该被这个 PR https://github.com/antvis/G2/pull/5632 修复了

posted by pearmini over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests