antvis / antvis/F2

初始化时,给定宽高,导致绑定的点击事件获取位置有偏差

Open
#1,201 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

- [x] I have searched the [issues](https://github.com/antvis/f2/issues) of this repository and believe that this is not a duplicate.

### Reproduction link
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/beautiful-mcnulty-ffhq4?file=/src/App.vue&resolutionWidth=375&resolutionHeight=667)

### Steps to reproduce
点击第一个折线图,发现要左偏移一点才能点到对应的位置;
点击第二个折线图,发现获取的点位置是超出范围的,导致拿不到data;
https://drive.google.com/file/d/1m6BEcdYbLGVkDxcjGlOrKzeLI02SlHJ9/view?usp=sharing

| Environment | Info |
|---|---|
| f2 | 3.8.8 |
| System | - |
| Browser | - |

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction, especially src/App.vue, using F2 3.8.8 and the stated viewport sizes. Compare click handling on the two line charts when width and height are supplied at initialization; done means both charts map clicks to the correct data point without an offset or out-of-range position.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.