Skip to content

Conversation

@q32757468
Copy link
Contributor

@q32757468 q32757468 commented Oct 20, 2025

feature: #4831

Description

实现后画布未开启配置也默认可拖动:
录屏2025-10-20 17 56 11

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

Self Check before Merge

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @q32757468, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在优化 AntV X6 图形库的用户体验,通过将 Graph 组件的画布拖拽(panning)功能默认设置为启用。这意味着用户无需额外配置即可直接拖动画布。为了确保兼容性和避免潜在的交互冲突,特别是与 scroller 插件结合使用时,此更改还包括了对相关文档的更新、示例代码的调整,以及在 scroller 插件中添加了智能警告机制。

Highlights

  • 画布拖拽默认启用: 将 Graph 组件的 panning 选项默认值从 false 修改为 true,使得画布在未显式配置时也能默认拖拽平移。
  • 文档更新: 更新了相关 API 文档和教程,以反映 panning 选项的新默认值,并强调了与 scroller 插件同时使用时的注意事项。
  • 示例调整: 多个示例文件(如 minimapscrollervirtual-render)中,当使用 scroller 插件时,显式地将 panning 设置为 false,以避免交互冲突。
  • 冲突警告: 在 scroller 插件中增加了运行时警告,当 graph.panningscroller 拖拽同时启用时,会输出警告信息。
  • 导入顺序优化: 多个示例文件中的 import 语句顺序进行了调整。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

这个 PR 的目标是将 panning 选项的默认值设置为 true,以提升用户体验,使得画布在默认情况下即可拖动。你已经很好地完成了这个任务:

  1. 核心逻辑修改正确,在 src/graph/options.ts 中将 panning.enabled 的默认值改为了 true
  2. 为了应对这个默认值的变更,你细致地更新了所有受影响的示例文件,在使用了 Scroller 插件的地方显式地设置了 panning: false,避免了功能冲突。
  3. scroller 插件中增加了一个警告,当检测到 graph.panningscroller 的平移功能同时启用时,会向开发者提示潜在的冲突。这是一个非常贴心的改进,有助于开发者排查问题。
  4. 相关文档也得到了同步更新,清晰地说明了新的默认行为。

代码整体质量很高,考虑周全。有一点小建议是,将默认值从 false 改为 true 属于一个破坏性变更(Breaking Change),因为它会改变现有用户的默认行为。在 PR 的 "Types of changes" 部分,可以考虑勾选 "Breaking change" 选项,以便更清晰地传达变更的性质。

除此之外,没有发现其他问题。做得很好!

@q32757468 q32757468 marked this pull request as draft October 20, 2025 10:47
@q32757468 q32757468 force-pushed the feat_enable-panning-default branch from 6142bc8 to fde32b4 Compare October 21, 2025 02:49
@q32757468 q32757468 marked this pull request as ready for review October 21, 2025 02:50
@q32757468
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

本次 PR 将 panning 选项的默认值修改为 true,这是一个很好的功能增强。相关的代码、文档和示例都得到了相应的更新,考虑得非常全面。特别是为 scroller 插件增加了冲突警告,可以有效帮助用户避免潜在问题。我只有一个小建议,旨在优化这个警告的开发者体验。总体来说,这是一次高质量的提交。

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.94%. Comparing base (6be7b27) to head (fde32b4).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4835   +/-   ##
=======================================
  Coverage   81.94%   81.94%           
=======================================
  Files         327      327           
  Lines       37966    37972    +6     
  Branches     7634     7632    -2     
=======================================
+ Hits        31111    31116    +5     
- Misses       6831     6832    +1     
  Partials       24       24           
Flag Coverage Δ
x6 81.94% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/graph/options.ts 94.73% <100.00%> (ø)
src/model/animation.ts 92.75% <100.00%> (ø)
src/plugin/minimap/index.ts 70.69% <100.00%> (+0.10%) ⬆️
src/plugin/scroller/index.ts 86.89% <100.00%> (+0.20%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lxfu1 lxfu1 merged commit 0f0f5f5 into master Oct 21, 2025
2 checks passed
@lxfu1 lxfu1 deleted the feat_enable-panning-default branch October 21, 2025 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants