Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: coarse pointer tolerance #17102

Merged
merged 10 commits into from
Aug 22, 2022
Merged

Feature: coarse pointer tolerance #17102

merged 10 commits into from
Aug 22, 2022

Conversation

Ovilia
Copy link
Contributor

@Ovilia Ovilia commented May 25, 2022

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

This PR is intended to increase elements' responsive size on mobile devices so that elements can be touched more easily.

The idea is inspired by Understanding Success Criterion 2.5.5: Target Size.

Fixed issues

Details

Before: What was the problem?

Small elements are hard to touch precisely on mobile devices in cases like scatter charts with small bubbles.

After: How is it fixed in this PR?

Touch position in increased by "pointer size" (default value is 44px) so that elements are easier to be touched.

Misc

Related test cases or examples to use the new APIs

  • test/coarse-pointer.html

I added an option to set useCoarsePointer to be true in the visual test framework, which forces increasing clicking area even for PC charts. The full visual test result is at Google Drive. I checked the failed cases, they are because we increased clicking area.

API Changes

By default, only mobile devices will use this new feature. But if a developer decide to enable this for all platforms, one can set useCoarsePointer to be true when initializing ECharts.

echarts.init(dom, null, {
  useCoarsePointer: true,
  pointerSize: 44,
  ...
});
  • useCoarsePointer ('auto' | true | false): whether to enable thie feature. If set to be 'auto', it's turned on only for mobile devices.
  • pointerSize (number): touch position is increased by this pointer size in diameter. Default value is 44.

Charts that with large scale enabled will disable this feature.

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot
Copy link

echarts-bot bot commented May 25, 2022

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

This PR depends on ZRender changes. Please update the ZRender dependency to the latest nightly version including this change, which takes place everyday at 8:00 UTC (16:00 Beijing Time).
You can use npm i zrender@npm:zrender-nightly@dev to update package.json.
If you have any question about this, please leave a comment and we will give you extra help on this.

@echarts-bot echarts-bot bot added PR: author is committer PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels May 25, 2022
@Ovilia Ovilia changed the base branch from master to next May 25, 2022 03:19
@pull-request-size pull-request-size bot added size/S and removed size/L labels May 25, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jul 14, 2022

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

src/core/echarts.ts Outdated Show resolved Hide resolved
src/core/echarts.ts Outdated Show resolved Hide resolved
test/runTest/store.js Show resolved Hide resolved
test/runTest/server.js Outdated Show resolved Hide resolved
test/lib/config.js Outdated Show resolved Hide resolved
test/line-visual-polar.html Outdated Show resolved Hide resolved
Copy link
Member

@plainheart plainheart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me for now.

@Ovilia Ovilia merged commit d897fa2 into next Aug 22, 2022
@echarts-bot
Copy link

echarts-bot bot commented Aug 22, 2022

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@Ovilia Ovilia deleted the feat-coarse-pointer branch August 22, 2022 04:28
@Ovilia Ovilia added this to the 5.4.0 milestone Sep 8, 2022
Ovilia added a commit to apache/echarts-doc that referenced this pull request Sep 16, 2022
Ovilia added a commit to apache/echarts-doc that referenced this pull request Sep 16, 2022
@Ovilia Ovilia added PR: doc ready and removed PR: awaiting doc Document changes is required for this PR. labels Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants