Skip to content

docs: 修复 DragElementForce 文档中 hideEdge 配置项表格错位#7509

Merged
Aarebecca merged 3 commits intoantvis:v5from
baozjj:docs/DragElementForce-hideEdge-fix
Nov 27, 2025
Merged

docs: 修复 DragElementForce 文档中 hideEdge 配置项表格错位#7509
Aarebecca merged 3 commits intoantvis:v5from
baozjj:docs/DragElementForce-hideEdge-fix

Conversation

@baozjj
Copy link
Copy Markdown
Contributor

@baozjj baozjj commented Nov 24, 2025

描述

修复 DragElementForce 文档中 hideEdge 配置项表格的格式错乱问题。
原文档中 hideEdge 配置项的表格行被分成了两行,导致表格格式混乱,影响文档的可读性。

修改内容

  • 修复中文文档(DragElementForce.zh.md)表格中 hideEdge 行的格式错乱
  • 修复英文文档(DragElementForce.en.md)表格中 hideEdge 行的格式错乱

修复前

image

修复后

image

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @baozjj, 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!

此拉取请求旨在解决 DragElementForce 行为文档中 hideEdge 配置项表格的格式错乱问题。通过将原本被错误分割的表格行合并,确保了中英文文档中该配置项的描述、类型和默认值在表格中正确对齐,从而显著提升了文档的清晰度和用户体验。

Highlights

  • 文档格式修复: 修复了 DragElementForce 文档中 hideEdge 配置项表格的格式错乱问题。
  • 多语言文档同步: 同时修复了英文文档(DragElementForce.en.md)和中文文档(DragElementForce.zh.md)中该表格的显示问题,确保了文档的一致性和可读性。
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
Copy Markdown
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 修复了 DragElementForce 文档中 hideEdge 配置项表格的格式错乱问题,使文档更具可读性。代码变更正确地解决了该问题。此外,我提出了一些关于表格中其他配置项类型格式的改进建议,以确保整个文档样式的一致性。

Comment on lines +46 to +54
| Option | Description | Type | Default | Required |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | -------- |
| type | Behavior type name, set `type: 'drag-element-force'` to enable this behavior | string | `drag-element-force` | ✓ |
| key | Unique identifier for the behavior, used for subsequent operations | string | - | |
| fixed | Whether to keep the node position fixed after dragging ends, boolean values represent: <br/>- true: After dragging ends, the node's position will remain fixed and not be affected by the layout algorithm <br/>- false: After dragging ends, the node's position will continue to be affected by the layout algorithm | boolean | false | |
| enable | Whether to enable the drag function, by default nodes and combos can be dragged | boolean \| ((event: IElementDragEvent) => boolean) | `['node', 'combo'].includes(event.targetType)` | |
| state | Identifier for the selected state of nodes, when multi-selection is enabled, it will find the selected nodes based on this state | string | `selected` | |
| hideEdge | Controls the display state of edges during dragging, optional values are: <br/>- `none`: Do not hide any edges <br/>- `out`: Hide edges with the current node as the source node <br/>- `in`: Hide edges with the current node as the target node <br/>- `both`: Hide all edges related to the current node <br/>- `all`: Hide all edges in the graph <br/>⚠️ Note: When `shadow` (ghost node) is enabled, the `hideEdge` configuration will not take effect. | `none` \| `all` \| `in` \| `out` \| `both` | `none` | |
| cursor | Customize the mouse style during dragging, [example](#cursor) | { default?: Cursor; grab: Cursor; grabbing: Cursor } | - | |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

感谢修复表格格式。我注意到 Type 列中有几个地方的格式可以进一步改进以提高一致性和可读性:

  • enable 的类型应使用反引号包裹:`boolean | ((event: IElementDragEvent) => boolean)`
  • cursor 的类型也应使用反引号包裹:`{ default?: Cursor; grab: Cursor; grabbing: Cursor }`

这将使它们以代码形式呈现,与表格中其他类型(如 hideEdge)的格式保持一致。

Suggested change
| Option | Description | Type | Default | Required |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | -------- |
| type | Behavior type name, set `type: 'drag-element-force'` to enable this behavior | string | `drag-element-force` ||
| key | Unique identifier for the behavior, used for subsequent operations | string | - | |
| fixed | Whether to keep the node position fixed after dragging ends, boolean values represent: <br/>- true: After dragging ends, the node's position will remain fixed and not be affected by the layout algorithm <br/>- false: After dragging ends, the node's position will continue to be affected by the layout algorithm | boolean | false | |
| enable | Whether to enable the drag function, by default nodes and combos can be dragged | boolean \| ((event: IElementDragEvent) => boolean) | `['node', 'combo'].includes(event.targetType)` | |
| state | Identifier for the selected state of nodes, when multi-selection is enabled, it will find the selected nodes based on this state | string | `selected` | |
| hideEdge | Controls the display state of edges during dragging, optional values are: <br/>- `none`: Do not hide any edges <br/>- `out`: Hide edges with the current node as the source node <br/>- `in`: Hide edges with the current node as the target node <br/>- `both`: Hide all edges related to the current node <br/>- `all`: Hide all edges in the graph <br/>⚠️ Note: When `shadow` (ghost node) is enabled, the `hideEdge` configuration will not take effect. | `none` \| `all` \| `in` \| `out` \| `both` | `none` | |
| cursor | Customize the mouse style during dragging, [example](#cursor) | { default?: Cursor; grab: Cursor; grabbing: Cursor } | - | |
| Option | Description | Type | Default | Required |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------- | -------- |
| type | Behavior type name, set `type: 'drag-element-force'` to enable this behavior | string | `drag-element-force` ||
| key | Unique identifier for the behavior, used for subsequent operations | string | - | |
| fixed | Whether to keep the node position fixed after dragging ends, boolean values represent: <br/>- true: After dragging ends, the node's position will remain fixed and not be affected by the layout algorithm <br/>- false: After dragging ends, the node's position will continue to be affected by the layout algorithm | boolean | false | |
| enable | Whether to enable the drag function, by default nodes and combos can be dragged | `boolean | ((event: IElementDragEvent) => boolean)` | `['node', 'combo'].includes(event.targetType)` | |
| state | Identifier for the selected state of nodes, when multi-selection is enabled, it will find the selected nodes based on this state | string | `selected` | |
| hideEdge | Controls the display state of edges during dragging, optional values are: <br/>- `none`: Do not hide any edges <br/>- `out`: Hide edges with the current node as the source node <br/>- `in`: Hide edges with the current node as the target node <br/>- `both`: Hide all edges related to the current node <br/>- `all`: Hide all edges in the graph <br/>⚠️ Note: When `shadow` (ghost node) is enabled, the `hideEdge` configuration will not take effect. | `none` | `all` | `in` | `out` | `both` | `none` | |
| cursor | Customize the mouse style during dragging, [example](#cursor) | `{ default?: Cursor; grab: Cursor; grabbing: Cursor }` | - | |

Comment on lines +46 to +54
| 配置项 | 说明 | 类型 | 默认值 | 必选 |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | ---- |
| type | 交互类型名称,这里设置 `type: 'drag-element-force'` 启用此交互 | string | `drag-element-force` | ✓ |
| key | 交互唯一标识符,用于后续操作交互 | string | - | |
| fixed | 在拖拽结束后,节点是否保持固定位置,布尔值代表:<br/>- true: 在拖拽结束后,节点的位置将保持固定,不受布局算法的影响 <br/>- false: 在拖拽结束后,节点的位置将继续受到布局算法的影响 | boolean | false | |
| enable | 是否启用拖拽功能,默认可以拖拽节点和 Combo | boolean \| ((event: IElementDragEvent) => boolean) | `['node', 'combo'].includes(event.targetType)` | |
| state | 节点选中状态的标识,启用多选时会基于该状态查找选中的节点 | string | `selected` | |
| hideEdge | 控制拖拽过程中边的显示状态,可选值有:<br/>- `none`: 不隐藏任何边 <br/>- `out`: 隐藏以当前节点为源节点的边 <br/>- `in`: 隐藏以当前节点为目标节点的边 <br/>- `both`: 隐藏与当前节点相关的所有边 <br/>- `all`: 隐藏图中所有边 <br/>⚠️ 注意:当启用 `shadow`(幽灵节点)时,`hideEdge` 配置将不生效。 | `none` \| `all` \| `in` \| `out` \| `both` | `none` | |
| cursor | 自定义鼠标样式,[示例](#cursor) | { default?: Cursor; grab: Cursor; grabbing: Cursor } | - | |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

感谢修复表格格式。我注意到 类型 列中有几个地方的格式可以进一步改进以提高一致性和可读性:

  • enable 的类型应使用反引号包裹:`boolean | ((event: IElementDragEvent) => boolean)`
  • cursor 的类型也应使用反引号包裹:`{ default?: Cursor; grab: Cursor; grabbing: Cursor }`

这将使它们以代码形式呈现,与表格中其他类型(如 hideEdge)的格式保持一致。

Suggested change
| 配置项 | 说明 | 类型 | 默认值 | 必选 |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | ---- |
| type | 交互类型名称,这里设置 `type: 'drag-element-force'` 启用此交互 | string | `drag-element-force` ||
| key | 交互唯一标识符,用于后续操作交互 | string | - | |
| fixed | 在拖拽结束后,节点是否保持固定位置,布尔值代表:<br/>- true: 在拖拽结束后,节点的位置将保持固定,不受布局算法的影响 <br/>- false: 在拖拽结束后,节点的位置将继续受到布局算法的影响 | boolean | false | |
| enable | 是否启用拖拽功能,默认可以拖拽节点和 Combo | boolean \| ((event: IElementDragEvent) => boolean) | `['node', 'combo'].includes(event.targetType)` | |
| state | 节点选中状态的标识,启用多选时会基于该状态查找选中的节点 | string | `selected` | |
| hideEdge | 控制拖拽过程中边的显示状态,可选值有:<br/>- `none`: 不隐藏任何边 <br/>- `out`: 隐藏以当前节点为源节点的边 <br/>- `in`: 隐藏以当前节点为目标节点的边 <br/>- `both`: 隐藏与当前节点相关的所有边 <br/>- `all`: 隐藏图中所有边 <br/>⚠️ 注意:当启用 `shadow`(幽灵节点)时,`hideEdge` 配置将不生效。 | `none` \| `all` \| `in` \| `out` \| `both` | `none` | |
| cursor | 自定义鼠标样式,[示例](#cursor) | { default?: Cursor; grab: Cursor; grabbing: Cursor } | - | |
| 配置项 | 说明 | 类型 | 默认值 | 必选 |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- | ---------------------------------------------- | ---- |
| type | 交互类型名称,这里设置 `type: 'drag-element-force'` 启用此交互 | string | `drag-element-force` ||
| key | 交互唯一标识符,用于后续操作交互 | string | - | |
| fixed | 在拖拽结束后,节点是否保持固定位置,布尔值代表:<br/>- true: 在拖拽结束后,节点的位置将保持固定,不受布局算法的影响 <br/>- false: 在拖拽结束后,节点的位置将继续受到布局算法的影响 | boolean | false | |
| enable | 是否启用拖拽功能,默认可以拖拽节点和 Combo | `boolean | ((event: IElementDragEvent) => boolean)` | `['node', 'combo'].includes(event.targetType)` | |
| state | 节点选中状态的标识,启用多选时会基于该状态查找选中的节点 | string | `selected` | |
| hideEdge | 控制拖拽过程中边的显示状态,可选值有:<br/>- `none`: 不隐藏任何边 <br/>- `out`: 隐藏以当前节点为源节点的边 <br/>- `in`: 隐藏以当前节点为目标节点的边 <br/>- `both`: 隐藏与当前节点相关的所有边 <br/>- `all`: 隐藏图中所有边 <br/>⚠️ 注意:当启用 `shadow`(幽灵节点)时,`hideEdge` 配置将不生效。 | `none` | `all` | `in` | `out` | `both` | `none` | |
| cursor | 自定义鼠标样式,[示例](#cursor) | `{ default?: Cursor; grab: Cursor; grabbing: Cursor }` | - | |

@Aarebecca Aarebecca merged commit 379fe3f into antvis:v5 Nov 27, 2025
1 check passed
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.

3 participants