Skip to content

docs: 更新布局文档#7654

Open
yvonneyx wants to merge 10 commits into
v5from
5.2-layout-docs
Open

docs: 更新布局文档#7654
yvonneyx wants to merge 10 commits into
v5from
5.2-layout-docs

Conversation

@yvonneyx

Copy link
Copy Markdown
Contributor

No description provided.

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

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.

Code Review

This pull request updates the G6 layout documentation for version 5.1 to align with the @antv/layout package, introducing common configuration fields across various layout types and adding migration guides for upgrading from version 5.0. Notable changes include the simplification of ComboCombined layout options and the addition of shortcut fields for D3Force. Feedback points out Markdown formatting issues in the ConcentricLayout property table and recommends consistent use of the @antv/layout package name throughout the documentation.

| startAngle | The angle (in radians) to start laying out nodes | number | 3 / 2 \* Math.PI | |
| sweep | The angle difference between the first and last node in the same layer. If undefined, set to 2 _Math.PI_ (1 - 1 / level.nodes ) | number | undefined | |
| Property | Description | Type | Default | Required |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- | --------- | --- |

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

表格分隔行(separator line)的列数(7列)与表头(5列)不匹配,这会导致 Markdown 表格无法正确渲染。建议删除多余的列以保持一致。

Suggested change
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- | --------- | --- |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- |

| nodeSpacing | Minimum spacing between rings, used to adjust the radius | number \| number[] \| ((node?: Node) => number) | 10 | |
| preventOverlap | Whether to prevent overlap. Must be used with nodeSize or data.size. Only works if node size is set in data or in this layout config. | boolean | false | |
| startAngle | The angle (in radians) to start laying out nodes | number | 3 / 2 \* Math.PI | |
| sweep | The angle difference between the first and last node in the same layer. If undefined, it is set to `2 _ Math.PI _ (1 - 1 / | level.nodes | )`, where `level.nodes` is the set of nodes in that layer | number | undefined | |

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

sweep 这一行的格式错误,包含了多余的竖线(|),导致表格布局混乱。建议将公式部分合并到描述列中,并修正列数。

Suggested change
| sweep | The angle difference between the first and last node in the same layer. If undefined, it is set to `2 _ Math.PI _ (1 - 1 / | level.nodes | )`, where `level.nodes` is the set of nodes in that layer | number | undefined | |
| sweep | The angle difference between the first and last node in the same layer. If undefined, it is set to `2 * Math.PI * (1 - 1 / level.nodes)`, where `level.nodes` is the set of nodes in that layer | number | undefined | |


Additional notes:

- `width` / `height` / `center` are common layout fields uniformly supported by `@antvis/layout`.

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

这里提到的包名 @antvis/layoutoverview.en.md 中使用的 @antv/layout 不一致。考虑到 npm 上的正式包名通常是 @antv/layout,建议统一使用 @antv/layout

Suggested change
- `width` / `height` / `center` are common layout fields uniformly supported by `@antvis/layout`.
- `width` / `height` / `center` are common layout fields uniformly supported by `@antv/layout`.


补充说明:

- `width` / `height` / `center` 是 `@antvis/layout` 统一支持的通用布局字段。

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

这里提到的包名 @antvis/layoutoverview.zh.md 中使用的 @antv/layout 不一致。建议统一使用 @antv/layout

Suggested change
- `width` / `height` / `center``@antvis/layout` 统一支持的通用布局字段。
- `width` / `height` / `center``@antv/layout` 统一支持的通用布局字段。


也可在图实例化之后使用 `graph.setLayout` 来更新布局配置。

5.1 开始,布局文档中的通用字段已与 `@antvis/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width`、`height`、`center`、`enableWorker`、`node`、`edge` 等公共配置。

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

建议将 @antvis/layout 统一为 @antv/layout,以保持与英文文档及实际包名的一致性。

Suggested change
5.1 开始,布局文档中的通用字段已与 `@antvis/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width``height``center``enableWorker``node``edge` 等公共配置。
5.1 开始,布局文档中的通用字段已与 `@antv/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width``height``center``enableWorker``node``edge` 等公共配置。

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