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

feat(dataZoom): Add 'no-function-keys' option to RoamController and InsideZoomModel #20660

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

BSPR0002
Copy link

@BSPR0002 BSPR0002 commented Jan 8, 2025

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Add 'no-function-keys' option to RoamController and InsideZoomModel, which are used for the 'dataZoom-inside' component.

Fixed issues

Fix #20646

Details

Before: What was the problem?

moveOnMouseWheel, moveOnMouseMove, zoomOnMouseWheel of 'dataZoom-inside' items will ever be trigger while they are set to true even there are function keys pressed down. This causing conflicts with other mouse operations configured with specific function key.

After: How does it behave after the fixing?

moveOnMouseWheel, moveOnMouseMove, zoomOnMouseWheel of 'dataZoom-inside' items will never be trigger while they are set to 'no-function-keys' when there are function keys pressed.

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8" />
	<title>title</title>
	<script type="module">
		import { init } from "/dist/echarts.esm.mjs";

		const cc = init(document.getElementById("test"));
		cc.setOption({
			xAxis: { type: 'value', min: "dataMin", max: "dataMax" },
			yAxis: { type: 'value', minInterval: 1 },
			grid: { left: 60, top: 10, right: 60, bottom: 70 },
			tooltip: { show: true, trigger: "axis" },
			dataZoom: [
				{ type: "slider", filterMode: "none", },
				{ type: "inside", filterMode: "none", zoomOnMouseWheel: "no-function-keys", moveOnMouseWheel: "shift" },
				{ type: "slider", filterMode: "none", orient: "vertical" },
				{ type: "inside", filterMode: "none", orient: "vertical", zoomOnMouseWheel: false }
			],
			series: [
				{ data: [[0, 0], [50, 50], [100, 100]], type: 'line', showSymbol: false }
			]
		});
		window.cc = cc;
	</script>
</head>

<body>
	<div id="test" style="height: 512px;width: 512px;"></div>
</body>

</html>

Others

Merging options

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

Other information

This reverts commit 0939bb0.

Revert "dev config"

This reverts commit 73814d0.
@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. PR: first-time contributor labels Jan 8, 2025
Copy link

echarts-bot bot commented Jan 8, 2025

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.

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.

@BSPR0002 BSPR0002 marked this pull request as ready for review January 8, 2025 02:05
@BSPR0002 BSPR0002 changed the title Add 'no-function-keys' option to RoamController and InsideZoomModel feat(dataZoom): Add 'no-function-keys' option to RoamController and InsideZoomModel Jan 8, 2025
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.

[Feature] 为 dataZoom-inside 配置项添加仅在未按下功能键时触发的选项
1 participant