docs: 更新布局文档#7654
Conversation
There was a problem hiding this comment.
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 | | ||
| | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- | --------- | --- | |
There was a problem hiding this comment.
表格分隔行(separator line)的列数(7列)与表头(5列)不匹配,这会导致 Markdown 表格无法正确渲染。建议删除多余的列以保持一致。
| | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- | --------- | --- | | |
| | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- | -------- | |
| | 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 | | |
There was a problem hiding this comment.
sweep 这一行的格式错误,包含了多余的竖线(|),导致表格布局混乱。建议将公式部分合并到描述列中,并修正列数。
| | 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`. |
There was a problem hiding this comment.
这里提到的包名 @antvis/layout 与 overview.en.md 中使用的 @antv/layout 不一致。考虑到 npm 上的正式包名通常是 @antv/layout,建议统一使用 @antv/layout。
| - `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` 统一支持的通用布局字段。 |
|
|
||
| 也可在图实例化之后使用 `graph.setLayout` 来更新布局配置。 | ||
|
|
||
| 5.1 开始,布局文档中的通用字段已与 `@antvis/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width`、`height`、`center`、`enableWorker`、`node`、`edge` 等公共配置。 |
There was a problem hiding this comment.
建议将 @antvis/layout 统一为 @antv/layout,以保持与英文文档及实际包名的一致性。
| 5.1 开始,布局文档中的通用字段已与 `@antvis/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width`、`height`、`center`、`enableWorker`、`node`、`edge` 等公共配置。 | |
| 5.1 开始,布局文档中的通用字段已与 `@antv/layout` 对齐。除了各布局自己的算法参数外,也建议同时关注 `width`、`height`、`center`、`enableWorker`、`node`、`edge` 等公共配置。 |
No description provided.