antvis/G2

sample transform 实现问题 #4505

visiky posted onGitHub

问题描述

在这个 case 中,想实现对 point 的抽样,发现 sample 之后,point 和 line 对应不上了

<img width="400" alt="image" src="https://user-images.githubusercontent.com/15646325/208904082-11ac9a5c-4de3-49bb-a6be-1e9810dddd6e.png">

期望

.transform({
    type: 'sample',
    y: 'min',
})

group 之后取 y 值最小的点保留下来,x 坐标应该保持不变,效果如下:

抽样前 抽样后
<img width="688" alt="image" src="https://user-images.githubusercontent.com/15646325/208903073-d5e0e90e-f8a1-4162-bb73-5ec2c7ec3141.png"> <img width="691" alt="image" src="https://user-images.githubusercontent.com/15646325/208903002-a3f950f5-78a5-4e84-b30d-cd57eebbb59b.png">

sample 还是建议放到 data.transform 中。具体见:https://github.com/antvis/G2/discussions/4393#discussioncomment-4500740

下周我来处理这个问题。

posted by hustcc over 2 years ago

Fund this Issue

$0.00
Funded

Pull requests