Skip to content

Commit cf5e1b3

Browse files
z-pangolinDymoneLewis
authored andcommitted
fix: 完善layout文档说明、新增customTargetAnchor方法的使用说明
1 parent 4480ceb commit cf5e1b3

17 files changed

Lines changed: 320 additions & 93 deletions

File tree

sites/docs/docs/api/detail/constructor.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ table td:first-of-type {
3939
| height | number | - | - | Specify the height of the canvas in 'px', the default is to use the container height |
4040
| background | false \| [BackgroundConfig](#BackgroundConfig) | - | false | Canvas background, no background by default |
4141
| grid | number \| boolean \| [GridOptions](#GridOptions) | - | false | Grid, if set to `false` without grid on, it is 1px moving units, no grid background is drawn; if set to `true` on, it is 20px dotted grid by default |
42-
| snapToGrid<Badge>Added in 2.0.10</Badge> | boolean | - | false | Whether to enable grid snapping, when enabled, dragging nodes will move in grid size increments |
42+
| snapGrid<Badge>Added in 2.0.10</Badge> | boolean | - | false | Whether to enable grid snapping, when enabled, dragging nodes will move in grid size increments |
4343
| partial | boolean | - | false | Whether to enable localized rendering |
4444
| keyboard | [KeyboardDef](#KeyboardDef) | - | - | Custom keyboard-related configuration |
4545
| [style](#style) | [Theme](../../api/type/Theme.en.md) | - | - | Style |
@@ -70,6 +70,7 @@ table td:first-of-type {
7070
| edgeTextDraggable | boolean | - | false | Allow edge text to be draggable |
7171
| multipleSelectKey | string | - | - | Multi-select key, can choose meta(cmd), shift, alt. Support combination key clicks to achieve multi-selection |
7272
| idGenerator | function | - | - | Custom rules for generating ids when creating nodes and edges |
73+
| customTargetAnchor | `customTargetAnchorType` | - | - | Customize anchor connection rules。 |
7374
| edgeGenerator | `EdgeGeneratorType` | - | - | Rules for generating edges when connecting nodes and moving edges |
7475
| plugins | `ExtensionConstructor[]` | - | - | Plugins loaded by the current LogicFlow instance, uses global plugins if not passed |
7576
| autoExpand | boolean | - | true | Whether to automatically expand the canvas when nodes are dragged near the edge of the canvas. Note: If the canvas keeps scrolling when dragging nodes to a certain position, it's because there's an issue with the initialized canvas width and height. If the canvas width and height are variable, it's recommended to turn off autoExpand |

sites/docs/docs/api/detail/constructor.zh.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ table td:first-of-type {
3232
| height | number | - | - | 指定画布高度,单位为 'px',默认使用容器高度。 |
3333
| background | false | [BackgroundConfig](#BackgroundConfig) | - | false | 画布背景,默认无背景,支持传入参数配置 |
3434
| grid | number/boolean/[GridOptions](#GridOptions) | | false | 网格,若设为`false`不开启网格,则为 1px 移动单位,不绘制网格背景,若设置为`true`开启则默认为 20px 点状网格。 |
35-
| snapToGrid<Badge>2.0.10 新增</Badge> | boolean | - | false | 是否开启网格吸附,开启后拖动节点会有以网格大小为补步长移动 |
35+
| snapGrid<Badge>2.0.10 新增</Badge> | boolean | - | false | 是否开启网格吸附,开启后拖动节点会有以网格大小为补步长移动 |
3636
| partial | boolean | - | false | 是否开启局部渲染功能。 |
3737
| keyboard | [KeyboardDef](#KeyboardDef) | - | - | 自定义键盘相关配置。 |
3838
| [style](#style) | [Theme](../../api/type/Theme.zh.md) | - | - | 样式。 |
@@ -63,6 +63,7 @@ table td:first-of-type {
6363
| edgeTextDraggable | boolean | - | false | 允许边文本可以拖拽。 |
6464
| multipleSelectKey | string | - | - | 多选按键, 可选 meta(cmd)、shift、alt。 支持组合键点击元素实现多选。 |
6565
| idGenerator | function | - | - | 自定义创建节点、连线时生成 id 规则。 |
66+
| customTargetAnchor | `customTargetAnchorType` | - | - | 自定义锚点连接规则。 |
6667
| edgeGenerator | `EdgeGeneratorType` | - | - | 连接节点及移动边时边的生成规则。 |
6768
| plugins | `ExtensionConstructor[]` | - | - | 当前 LogicFlow 实例加载的插件,不传则采用全局插件。 |
6869
| autoExpand | boolean | - | - | 节点拖动靠近画布边缘时是否自动扩充画布, 默认 true。 注意,如果出现拖动节点到某个位置画布就不停滚动的问题,是因为初始化画布的时候宽高有问题。如果画布宽高不定,建议关闭 autoExpand。 |

sites/docs/docs/api/model/graphModel.en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CustomNode extends RectNode {
5757
| idGenerator | `(type?: string) => string \| undefined` | | Custom global id generator |
5858
| nodeMoveRules | `Model.NodeMoveRule[]` | [] | Node movement rules, all rules in this array are checked when node moves |
5959
| customTrajectory | `LFOptions.CustomAnchorLineProps` | | Get custom connection trajectory |
60+
| customTargetAnchor | `LFOptions.customTargetAnchorType` | | Custom anchor connection rules (when a manual connection drops on a node, decides which anchor to use). |
6061
| edgeGenerator | `LFOptions.EdgeGeneratorType` | | Edge generation rules for node connections and edge changes |
6162
| edgeType | `string` | | Default edge type used when creating edges on graph |
6263
| nodes | `BaseNodeModel[]` | [] | All node objects on canvas |

sites/docs/docs/api/model/graphModel.zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CustomNode extends RectNode {
5757
| idGenerator | `(type?: string) => string \| undefined` | | 自定义全局 id 生成器 |
5858
| nodeMoveRules | `Model.NodeMoveRule[]` | [] | 节点移动规则, 在节点移动的时候,会触发此数组中的所有规则判断 |
5959
| customTrajectory | `LFOptions.CustomAnchorLineProps` | | 获取自定义连线轨迹 |
60+
| customTargetAnchor | `LFOptions.customTargetAnchorType` | | 自定义锚点连接规则(手动连线落到节点时,决定使用哪个锚点) |
6061
| edgeGenerator | `LFOptions.EdgeGeneratorType` | | 节点间连线、连线变更时边的生成规则 |
6162
| edgeType | `string` | | 在图上操作创建边时,默认使用的边类型 |
6263
| nodes | `BaseNodeModel[]` | [] | 画布所有的节点对象 |

0 commit comments

Comments
 (0)