docs: 修复 DragElementForce 文档中 hideEdge 配置项表格错位#7509
Conversation
Summary of ChangesHello @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! 此拉取请求旨在解决 Highlights
Using Gemini Code AssistThe 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
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 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
|
| | 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 } | - | | |
There was a problem hiding this comment.
感谢修复表格格式。我注意到 Type 列中有几个地方的格式可以进一步改进以提高一致性和可读性:
enable的类型应使用反引号包裹:`boolean | ((event: IElementDragEvent) => boolean)`cursor的类型也应使用反引号包裹:`{ default?: Cursor; grab: Cursor; grabbing: Cursor }`
这将使它们以代码形式呈现,与表格中其他类型(如 hideEdge)的格式保持一致。
| | 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 }` | - | | |
| | 配置项 | 说明 | 类型 | 默认值 | 必选 | | ||
| | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | ---- | | ||
| | 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 } | - | | |
There was a problem hiding this comment.
感谢修复表格格式。我注意到 类型 列中有几个地方的格式可以进一步改进以提高一致性和可读性:
enable的类型应使用反引号包裹:`boolean | ((event: IElementDragEvent) => boolean)`cursor的类型也应使用反引号包裹:`{ default?: Cursor; grab: Cursor; grabbing: Cursor }`
这将使它们以代码形式呈现,与表格中其他类型(如 hideEdge)的格式保持一致。
| | 配置项 | 说明 | 类型 | 默认值 | 必选 | | |
| | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------- | ---- | | |
| | 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 }` | - | | |
描述
修复 DragElementForce 文档中 hideEdge 配置项表格的格式错乱问题。
原文档中 hideEdge 配置项的表格行被分成了两行,导致表格格式混乱,影响文档的可读性。
修改内容
修复前
修复后