antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

【V5 Bug】Y轴离散时,框选结果与视觉不符合 #6106

Xiatian-leo posted onGitHub

问题描述

如题

感觉框选运算时未考虑上下翻转

代码如下

/**
 * A recreation of this demo: https://observablehq.com/@d3/scatterplot-with-shapes
 */
import { Chart } from '@antv/g2';

const data = [
  {
  x: 0.8,
  y: 'A'
},{
  x: 1,
  y: 'A'
},
{
  x: 2,
  y: 'B'
},
{
  x: 3,
  y: 'C'
}]

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart
  .point()
  .data(data)
  .encode('x', 'x')
  .encode('y', 'y')
  .interaction('brushHighlight', {})
  .scale({
    x: {
      domain: [0.5, 5]
    },
    y: {
      range: [1, 0]
    }
  })

chart.on('brush:end', e => {
  console.log(e.data.selection)
})

chart.render();

操作及效果如下

image

重现链接

No response

重现步骤

No response

预期行为

结果:框选不对应; 期望:框选区域和实际轴对应;

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests