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

[Bug]: When the mouse is placed on a custom node, the action wheel cannot zoom in and out of the canvas #6664

Open
2 of 10 tasks
irelib opened this issue Dec 25, 2024 · 1 comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@irelib
Copy link

irelib commented Dec 25, 2024

Describe the bug / 问题描述

鼠标放在自定义节点上,操作滚轮无法对画布进行缩放

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@irelib irelib added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Dec 25, 2024
Copy link

感谢您提供详细的信息。您提到的问题是当鼠标放在自定义节点上时,无法通过滚轮对画布进行缩放。这可能是由于事件处理或配置的问题。

在G6中,缩放功能通常是通过 mousewheel 事件来实现的。如果自定义节点阻止了该事件的传播,可能会导致无法缩放。

以下是一些可能的解决方案:

  1. 检查事件传播:确保自定义节点没有阻止 mousewheel 事件的传播。可以在自定义节点的事件处理函数中调用 event.stopPropagation() 来防止事件传播。

  2. 配置缩放行为:确保在初始化G6图表时,正确配置了缩放行为。可以通过 graph.get('canvas').set('zoomable', true) 来启用缩放功能。

  3. 调试事件:使用浏览器的开发者工具来调试事件,确保 mousewheel 事件在自定义节点上被正确触发。

如果这些建议没有解决您的问题,您可以提供更多的代码片段或详细信息,以便我能更好地帮助您。

如果您需要进一步的帮助,请随时告诉我。

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@github-actions github-actions bot changed the title [Bug]: 鼠标放在自定义节点上,操作滚轮无法对画布进行缩放 [Bug]: When the mouse is placed on a custom node, the action wheel cannot zoom in and out of the canvas Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant