@logicflow/core 2.2.2 → 2.2.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +32 -0
  2. package/es/model/GraphModel.js +3 -1
  3. package/lib/model/GraphModel.js +3 -1
  4. package/package.json +6 -6
  5. package/dist/docs/api/logicflow-constructor/index.en.md +0 -106
  6. package/dist/docs/api/logicflow-constructor/index.zh.md +0 -106
  7. package/dist/docs/api/logicflow-constructor/use.en.md +0 -61
  8. package/dist/docs/api/logicflow-constructor/use.zh.md +0 -61
  9. package/dist/docs/api/logicflow-instance/canvas.en.md +0 -197
  10. package/dist/docs/api/logicflow-instance/canvas.zh.md +0 -199
  11. package/dist/docs/api/logicflow-instance/edge.en.md +0 -273
  12. package/dist/docs/api/logicflow-instance/edge.zh.md +0 -273
  13. package/dist/docs/api/logicflow-instance/edit-config.en.md +0 -59
  14. package/dist/docs/api/logicflow-instance/edit-config.zh.md +0 -59
  15. package/dist/docs/api/logicflow-instance/element.en.md +0 -375
  16. package/dist/docs/api/logicflow-instance/element.zh.md +0 -379
  17. package/dist/docs/api/logicflow-instance/event.en.md +0 -326
  18. package/dist/docs/api/logicflow-instance/event.zh.md +0 -406
  19. package/dist/docs/api/logicflow-instance/history.en.md +0 -38
  20. package/dist/docs/api/logicflow-instance/history.zh.md +0 -38
  21. package/dist/docs/api/logicflow-instance/index.en.md +0 -41
  22. package/dist/docs/api/logicflow-instance/index.zh.md +0 -41
  23. package/dist/docs/api/logicflow-instance/node.en.md +0 -308
  24. package/dist/docs/api/logicflow-instance/node.zh.md +0 -308
  25. package/dist/docs/api/logicflow-instance/register.en.md +0 -76
  26. package/dist/docs/api/logicflow-instance/register.zh.md +0 -76
  27. package/dist/docs/api/logicflow-instance/render-and-data.en.md +0 -179
  28. package/dist/docs/api/logicflow-instance/render-and-data.zh.md +0 -181
  29. package/dist/docs/api/logicflow-instance/text.en.md +0 -60
  30. package/dist/docs/api/logicflow-instance/text.zh.md +0 -60
  31. package/dist/docs/api/logicflow-instance/theme.en.md +0 -179
  32. package/dist/docs/api/logicflow-instance/theme.zh.md +0 -179
  33. package/dist/docs/api/runtime-model/edgeModel.en.md +0 -29
  34. package/dist/docs/api/runtime-model/edgeModel.zh.md +0 -325
  35. package/dist/docs/api/runtime-model/graphModel.en.md +0 -275
  36. package/dist/docs/api/runtime-model/graphModel.zh.md +0 -1153
  37. package/dist/docs/api/runtime-model/nodeModel.en.md +0 -37
  38. package/dist/docs/api/runtime-model/nodeModel.zh.md +0 -644
  39. package/dist/docs/api/type/MainTypes.en.md +0 -598
  40. package/dist/docs/api/type/MainTypes.zh.md +0 -867
  41. package/dist/docs/api/type/Theme.en.md +0 -187
  42. package/dist/docs/api/type/Theme.zh.md +0 -187
  43. package/dist/docs/api/type/canvas-types.en.md +0 -25
  44. package/dist/docs/api/type/canvas-types.zh.md +0 -25
  45. package/dist/docs/api/type/index.en.md +0 -96
  46. package/dist/docs/api/type/index.zh.md +0 -99
  47. package/dist/docs/api/type/node-types.en.md +0 -21
  48. package/dist/docs/api/type/node-types.zh.md +0 -21
  49. package/dist/docs/api/type/plugin-types.en.md +0 -24
  50. package/dist/docs/api/type/plugin-types.zh.md +0 -24
  51. package/dist/docs/index.md +0 -11
  52. package/dist/docs/tutorial/about.en.md +0 -38
  53. package/dist/docs/tutorial/about.zh.md +0 -65
  54. package/dist/docs/tutorial/advanced/dnd.en.md +0 -62
  55. package/dist/docs/tutorial/advanced/dnd.zh.md +0 -52
  56. package/dist/docs/tutorial/advanced/edge.en.md +0 -64
  57. package/dist/docs/tutorial/advanced/edge.zh.md +0 -66
  58. package/dist/docs/tutorial/advanced/keyboard.en.md +0 -70
  59. package/dist/docs/tutorial/advanced/keyboard.zh.md +0 -67
  60. package/dist/docs/tutorial/advanced/node.en.md +0 -338
  61. package/dist/docs/tutorial/advanced/node.zh.md +0 -338
  62. package/dist/docs/tutorial/advanced/react.en.md +0 -106
  63. package/dist/docs/tutorial/advanced/react.zh.md +0 -114
  64. package/dist/docs/tutorial/advanced/silent-mode.en.md +0 -75
  65. package/dist/docs/tutorial/advanced/silent-mode.zh.md +0 -71
  66. package/dist/docs/tutorial/advanced/snapline.en.md +0 -54
  67. package/dist/docs/tutorial/advanced/vue.en.md +0 -249
  68. package/dist/docs/tutorial/advanced/vue.zh.md +0 -248
  69. package/dist/docs/tutorial/ai.en.md +0 -64
  70. package/dist/docs/tutorial/ai.zh.md +0 -64
  71. package/dist/docs/tutorial/basic/background.en.md +0 -50
  72. package/dist/docs/tutorial/basic/canvas.en.md +0 -164
  73. package/dist/docs/tutorial/basic/canvas.zh.md +0 -183
  74. package/dist/docs/tutorial/basic/class.en.md +0 -106
  75. package/dist/docs/tutorial/basic/class.zh.md +0 -103
  76. package/dist/docs/tutorial/basic/edge.en.md +0 -151
  77. package/dist/docs/tutorial/basic/edge.zh.md +0 -152
  78. package/dist/docs/tutorial/basic/event.en.md +0 -70
  79. package/dist/docs/tutorial/basic/event.zh.md +0 -66
  80. package/dist/docs/tutorial/basic/grid.en.md +0 -77
  81. package/dist/docs/tutorial/basic/node.en.md +0 -358
  82. package/dist/docs/tutorial/basic/node.zh.md +0 -318
  83. package/dist/docs/tutorial/basic/theme.en.md +0 -154
  84. package/dist/docs/tutorial/basic/theme.zh.md +0 -157
  85. package/dist/docs/tutorial/extension/adapter.en.md +0 -446
  86. package/dist/docs/tutorial/extension/adapter.zh.md +0 -429
  87. package/dist/docs/tutorial/extension/bpmn-element.en.md +0 -1427
  88. package/dist/docs/tutorial/extension/bpmn-element.zh.md +0 -1472
  89. package/dist/docs/tutorial/extension/control.en.md +0 -117
  90. package/dist/docs/tutorial/extension/control.zh.md +0 -118
  91. package/dist/docs/tutorial/extension/curved-edge.en.md +0 -46
  92. package/dist/docs/tutorial/extension/curved-edge.zh.md +0 -46
  93. package/dist/docs/tutorial/extension/custom.en.md +0 -142
  94. package/dist/docs/tutorial/extension/custom.zh.md +0 -138
  95. package/dist/docs/tutorial/extension/dnd-panel.en.md +0 -109
  96. package/dist/docs/tutorial/extension/dnd-panel.zh.md +0 -109
  97. package/dist/docs/tutorial/extension/dynamic-group.en.md +0 -606
  98. package/dist/docs/tutorial/extension/dynamic-group.zh.md +0 -606
  99. package/dist/docs/tutorial/extension/group.en.md +0 -217
  100. package/dist/docs/tutorial/extension/group.zh.md +0 -209
  101. package/dist/docs/tutorial/extension/highlight.en.md +0 -50
  102. package/dist/docs/tutorial/extension/highlight.zh.md +0 -50
  103. package/dist/docs/tutorial/extension/insert-node-in-polyline.en.md +0 -52
  104. package/dist/docs/tutorial/extension/insert-node-in-polyline.zh.md +0 -47
  105. package/dist/docs/tutorial/extension/intro.en.md +0 -72
  106. package/dist/docs/tutorial/extension/intro.zh.md +0 -95
  107. package/dist/docs/tutorial/extension/label.en.md +0 -136
  108. package/dist/docs/tutorial/extension/label.zh.md +0 -135
  109. package/dist/docs/tutorial/extension/layout.en.md +0 -156
  110. package/dist/docs/tutorial/extension/layout.zh.md +0 -156
  111. package/dist/docs/tutorial/extension/menu.en.md +0 -319
  112. package/dist/docs/tutorial/extension/menu.zh.md +0 -377
  113. package/dist/docs/tutorial/extension/minimap.en.md +0 -164
  114. package/dist/docs/tutorial/extension/minimap.zh.md +0 -180
  115. package/dist/docs/tutorial/extension/node-resize.en.md +0 -199
  116. package/dist/docs/tutorial/extension/node-resize.zh.md +0 -221
  117. package/dist/docs/tutorial/extension/pool.en.md +0 -227
  118. package/dist/docs/tutorial/extension/pool.zh.md +0 -227
  119. package/dist/docs/tutorial/extension/proximity-connect.en.md +0 -104
  120. package/dist/docs/tutorial/extension/proximity-connect.zh.md +0 -107
  121. package/dist/docs/tutorial/extension/selection.en.md +0 -166
  122. package/dist/docs/tutorial/extension/selection.zh.md +0 -150
  123. package/dist/docs/tutorial/extension/snapshot.en.md +0 -276
  124. package/dist/docs/tutorial/extension/snapshot.zh.md +0 -276
  125. package/dist/docs/tutorial/get-started.en.md +0 -501
  126. package/dist/docs/tutorial/get-started.zh.md +0 -139
  127. package/dist/docs/tutorial/update.en.md +0 -213
  128. package/dist/docs/tutorial/update.zh.md +0 -212
  129. package/dist/index.css +0 -214
  130. package/dist/index.min.js +0 -2
  131. package/dist/index.min.js.map +0 -1
@@ -1,76 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow 实例
5
- order: 2
6
- title: 注册
7
- toc: content
8
- order: 10
9
- ---
10
-
11
- 本页汇总 LogicFlow 实例中与自定义节点/边注册相关的方法。
12
-
13
- ### register
14
-
15
- 注册单个自定义节点或边。
16
-
17
- **签名**
18
-
19
- ```ts
20
- register(config: RegisterConfig): void
21
- ```
22
-
23
- 参数类型见 [`RegisterConfig`](../type/MainTypes.zh.md#registerconfig注册配置)。
24
-
25
- **示例**
26
-
27
- ```ts
28
- import { RectNode, RectNodeModel } from '@logicflow/core';
29
-
30
- class CustomRectNode extends RectNode {}
31
-
32
- class CustomRectModel extends RectNodeModel {
33
- setAttributes() {
34
- this.width = 200;
35
- this.height = 80;
36
- this.radius = 50;
37
- }
38
- }
39
-
40
- lf.register({
41
- type: 'custom-rect',
42
- view: CustomRectNode,
43
- model: CustomRectModel,
44
- });
45
- ```
46
-
47
- ### batchRegister
48
-
49
- 批量注册多个自定义节点或边。
50
-
51
- **签名**
52
-
53
- ```ts
54
- batchRegister(configList: RegisterConfig[]): void
55
- ```
56
-
57
- 参数类型见 [`RegisterConfig`](../type/MainTypes.zh.md#registerconfig注册配置)。
58
-
59
- **示例**
60
-
61
- ```ts
62
- lf.batchRegister([
63
- {
64
- type: 'user',
65
- view: UserNode,
66
- model: UserModel,
67
- },
68
- {
69
- type: 'user1',
70
- view: UserNode1,
71
- model: UserModel1,
72
- },
73
- ]);
74
- ```
75
-
76
- 插件全局注册见 [LogicFlow.use](../logicflow-constructor/use.zh.md)。
@@ -1,179 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow Instance
5
- order: 2
6
- title: Rendering and data
7
- toc: content
8
- order: 1
9
- ---
10
-
11
- This page covers rendering entry points, reading and writing graph data, and adapter hooks on the LogicFlow instance.
12
-
13
- ### render
14
-
15
- Render graph data. When `adapterIn` is configured, incoming data is converted to LogicFlow’s internal shape first.
16
-
17
- **Signature**
18
-
19
- ```ts
20
- render(graphData: unknown): void
21
- ```
22
-
23
- **Parameters**
24
-
25
- | Name | Type | Required | Description |
26
- | :--- | :--- | :--- | :--- |
27
- | `graphData` | `unknown` | Yes | Graph payload; shape depends on `adapterIn`. |
28
-
29
- **Example**
30
-
31
- ```ts
32
- lf.render({
33
- nodes: [{ id: 'node_1', type: 'rect', x: 120, y: 100 }],
34
- edges: [],
35
- });
36
- ```
37
-
38
- ### renderRawData
39
-
40
- Render native LogicFlow graph data without running `adapterIn`.
41
-
42
- **Signature**
43
-
44
- ```ts
45
- renderRawData(graphData: GraphData): void
46
- ```
47
-
48
- **Parameters**
49
-
50
- | Name | Type | Required | Description |
51
- | :--- | :--- | :--- | :--- |
52
- | `graphData` | [`GraphData`](../type/MainTypes.en.md#graphdata) | Yes | Native LogicFlow graph data. |
53
-
54
- **Example**
55
-
56
- ```ts
57
- lf.renderRawData({
58
- nodes: [{ id: 'node_1', type: 'rect', x: 120, y: 100 }],
59
- edges: [],
60
- });
61
- ```
62
-
63
- ### getGraphData
64
-
65
- Return the current graph. When `adapterOut` is set, the result is passed through that adapter.
66
-
67
- **Signature**
68
-
69
- ```ts
70
- getGraphData(...params: any[]): GraphConfigData | unknown
71
- ```
72
-
73
- **Parameters**
74
-
75
- | Name | Type | Required | Description |
76
- | :--- | :--- | :--- | :--- |
77
- | `...params` | `any[]` | No | Extra arguments forwarded to `adapterOut`. |
78
-
79
- **Returns**
80
-
81
- - Without `adapterOut`: [`GraphConfigData`](../type/MainTypes.en.md#graphconfigdata).
82
- - With `adapterOut`: your business shape (`unknown`).
83
-
84
- **Example**
85
-
86
- ```ts
87
- const data = lf.getGraphData(['property1', 'property2']);
88
- ```
89
-
90
- ### getGraphRawData
91
-
92
- Return native LogicFlow data, ignoring `adapterOut`.
93
-
94
- **Signature**
95
-
96
- ```ts
97
- getGraphRawData(): GraphData
98
- ```
99
-
100
- **Returns**
101
-
102
- - [`GraphData`](../type/MainTypes.en.md#graphdata)
103
-
104
- **Example**
105
-
106
- ```ts
107
- const rawData = lf.getGraphRawData();
108
- console.log(rawData.nodes, rawData.edges);
109
- ```
110
-
111
- ### clearData
112
-
113
- Remove every node and edge from the canvas.
114
-
115
- **Signature**
116
-
117
- ```ts
118
- clearData(): void
119
- ```
120
-
121
- **Example**
122
-
123
- ```ts
124
- lf.clearData();
125
- ```
126
-
127
- ### adapterIn
128
-
129
- Optional inbound adapter: convert business data to LogicFlow graph data before `render`.
130
-
131
- **Signature**
132
-
133
- ```ts
134
- adapterIn?: (data: unknown) => GraphData
135
- ```
136
-
137
- **Returns**
138
-
139
- - [`GraphData`](../type/MainTypes.en.md#graphdata)
140
-
141
- **Example**
142
-
143
- ```ts
144
- lf.adapterIn = (bizData) => {
145
- return {
146
- nodes: [],
147
- edges: [],
148
- };
149
- };
150
- ```
151
-
152
- ### adapterOut
153
-
154
- Optional outbound adapter: convert LogicFlow graph data when `getGraphData` runs.
155
-
156
- **Signature**
157
-
158
- ```ts
159
- adapterOut?: (data: GraphConfigData, ...params: any[]) => unknown
160
- ```
161
-
162
- **Parameters**
163
-
164
- | Name | Type | Required | Description |
165
- | :--- | :--- | :--- | :--- |
166
- | `data` | [`GraphConfigData`](../type/MainTypes.en.md#graphconfigdata) | Yes | Current graph data. |
167
- | `...params` | `any[]` | No | Same extras passed to `getGraphData`. |
168
-
169
- **Example**
170
-
171
- ```ts
172
- lf.adapterOut = (data, reserveFields = []) => {
173
- return {
174
- processNodes: data.nodes,
175
- processEdges: data.edges,
176
- reserveFields,
177
- };
178
- };
179
- ```
@@ -1,181 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow 实例
5
- order: 2
6
- title: 渲染与数据
7
- toc: content
8
- order: 1
9
- ---
10
-
11
- 本页聚焦 LogicFlow 实例的渲染入口、图数据读写与数据适配器接口。
12
-
13
- ### render
14
-
15
- 渲染图数据;当配置了 `adapterIn` 时,会先转换为 LogicFlow 标准数据再渲染。
16
-
17
- **签名**
18
-
19
- ```ts
20
- render(graphData: unknown): void
21
- ```
22
-
23
- **参数**
24
-
25
- | 名称 | 类型 | 必传 | 说明 |
26
- | :--- | :--- | :--- | :--- |
27
- | `graphData` | `unknown` | 是 | 图数据,格式取决于是否配置了 `adapterIn`。 |
28
-
29
- **示例**
30
-
31
- ```ts
32
- // 直接渲染 LogicFlow 标准格式
33
- lf.render({
34
- nodes: [{ id: 'node_1', type: 'rect', x: 120, y: 100 }],
35
- edges: [],
36
- });
37
- ```
38
-
39
- ### renderRawData
40
-
41
- 渲染 LogicFlow 原生图数据,不经过 `adapterIn` 转换。
42
-
43
- **签名**
44
-
45
- ```ts
46
- renderRawData(graphData: GraphData): void
47
- ```
48
-
49
- **参数**
50
-
51
- | 名称 | 类型 | 必传 | 说明 |
52
- | :--- | :--- | :--- | :--- |
53
- | `graphData` | [`GraphData`](../type/MainTypes.zh.md#graphdata画布数据) | 是 | LogicFlow 原生图数据。 |
54
-
55
- **示例**
56
-
57
- ```ts
58
- lf.renderRawData({
59
- nodes: [{ id: 'node_1', type: 'rect', x: 120, y: 100 }],
60
- edges: [],
61
- });
62
- ```
63
-
64
- ### getGraphData
65
-
66
- 获取当前图数据;当配置了 `adapterOut` 时,返回值会先经过适配器转换。
67
-
68
- **签名**
69
-
70
- ```ts
71
- getGraphData(...params: any[]): GraphConfigData | unknown
72
- ```
73
-
74
- **参数**
75
-
76
- | 名称 | 类型 | 必传 | 说明 |
77
- | :--- | :--- | :--- | :--- |
78
- | `...params` | `any[]` | 否 | 透传给 `adapterOut` 的额外参数。 |
79
-
80
- **返回值**
81
-
82
- - 未配置 `adapterOut`:返回 [`GraphConfigData`](../type/MainTypes.zh.md#graphconfigdata流程图渲染数据类型)。
83
- - 已配置 `adapterOut`:返回适配后的业务数据(`unknown`)。
84
-
85
- **示例**
86
-
87
- ```ts
88
- const data = lf.getGraphData(['property1', 'property2']);
89
- ```
90
-
91
- ### getGraphRawData
92
-
93
- 获取当前图的 LogicFlow 原生数据,不受 `adapterOut` 影响。
94
-
95
- **签名**
96
-
97
- ```ts
98
- getGraphRawData(): GraphData
99
- ```
100
-
101
- **返回值**
102
-
103
- - [`GraphData`](../type/MainTypes.zh.md#graphdata画布数据)
104
-
105
- **示例**
106
-
107
- ```ts
108
- const rawData = lf.getGraphRawData();
109
- console.log(rawData.nodes, rawData.edges);
110
- ```
111
-
112
- ### clearData
113
-
114
- 清空当前画布中的全部节点和边数据。
115
-
116
- **签名**
117
-
118
- ```ts
119
- clearData(): void
120
- ```
121
-
122
- **示例**
123
-
124
- ```ts
125
- lf.clearData();
126
- ```
127
-
128
- ### adapterIn
129
-
130
- 自定义输入数据适配函数,用于在 `render` 前把业务数据转换为 LogicFlow 原生数据。
131
-
132
- **签名**
133
-
134
- ```ts
135
- adapterIn?: (data: unknown) => GraphData
136
- ```
137
-
138
- **返回值**
139
-
140
- - [`GraphData`](../type/MainTypes.zh.md#graphdata画布数据)
141
-
142
- **示例**
143
-
144
- ```ts
145
- lf.adapterIn = (bizData) => {
146
- // 将业务结构转换成 nodes / edges
147
- return {
148
- nodes: [],
149
- edges: [],
150
- };
151
- };
152
- ```
153
-
154
- ### adapterOut
155
-
156
- 自定义输出数据适配函数,用于在 `getGraphData` 时把 LogicFlow 原生数据转换为业务数据。
157
-
158
- **签名**
159
-
160
- ```ts
161
- adapterOut?: (data: GraphConfigData, ...params: any[]) => unknown
162
- ```
163
-
164
- **参数**
165
-
166
- | 名称 | 类型 | 必传 | 说明 |
167
- | :--- | :--- | :--- | :--- |
168
- | `data` | [`GraphConfigData`](../type/MainTypes.zh.md#graphconfigdata流程图渲染数据类型) | 是 | 当前图数据。 |
169
- | `...params` | `any[]` | 否 | 来自 `getGraphData(...params)` 的透传参数。 |
170
-
171
- **示例**
172
-
173
- ```ts
174
- lf.adapterOut = (data, reserveFields = []) => {
175
- return {
176
- processNodes: data.nodes,
177
- processEdges: data.edges,
178
- reserveFields,
179
- };
180
- };
181
- ```
@@ -1,60 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow Instance
5
- order: 2
6
- title: Text editing
7
- toc: content
8
- order: 5
9
- ---
10
-
11
- This page documents instance APIs related to node and edge text editing.
12
-
13
- ### editText
14
-
15
- Open the text editor for a node or edge.
16
-
17
- **Signature**
18
-
19
- ```ts
20
- editText(id: string): void
21
- ```
22
-
23
- **Parameters**
24
-
25
- | Name | Type | Required | Description |
26
- | :--- | :--- | :--- | :--- |
27
- | `id` | `string` | Yes | Node or edge id. |
28
-
29
- **Example**
30
-
31
- ```ts
32
- lf.editText('node_1');
33
- ```
34
-
35
- :::info{title=Note}
36
- If text editing was disabled at initialization, LogicFlow does not automatically clear edit state. Listen for the relevant events and call `setElementState` yourself to leave edit mode.
37
- :::
38
-
39
- ### updateText
40
-
41
- Update the text value of a node or edge.
42
-
43
- **Signature**
44
-
45
- ```ts
46
- updateText(id: string, value: string): void
47
- ```
48
-
49
- **Parameters**
50
-
51
- | Name | Type | Required | Description |
52
- | :--- | :--- | :--- | :--- |
53
- | `id` | `string` | Yes | Node or edge id. |
54
- | `value` | `string` | Yes | New text content. |
55
-
56
- **Example**
57
-
58
- ```ts
59
- lf.updateText('id', 'value');
60
- ```
@@ -1,60 +0,0 @@
1
- ---
2
- nav: API
3
- group:
4
- title: LogicFlow 实例
5
- order: 2
6
- title: 文本编辑
7
- toc: content
8
- order: 5
9
- ---
10
-
11
- 本页汇总 LogicFlow 实例中与节点/边文本编辑相关的方法。
12
-
13
- ### editText
14
-
15
- 显示节点、连线文本编辑框,进入编辑状态。
16
-
17
- **签名**
18
-
19
- ```ts
20
- editText(id: string): void
21
- ```
22
-
23
- **参数**
24
-
25
- | 名称 | 类型 | 必传 | 说明 |
26
- | :--- | :--- | :--- | :--- |
27
- | `id` | `string` | 是 | 节点或边 ID。 |
28
-
29
- **示例**
30
-
31
- ```ts
32
- lf.editText('node_1');
33
- ```
34
-
35
- :::info{title=注意}
36
- 当初始化 `lf` 实例时设置了文本不可编辑,LogicFlow 内部不会自动监听并取消元素编辑状态。此时需要自行监听并通过 `setElementState` 取消文本编辑状态。
37
- :::
38
-
39
- ### updateText
40
-
41
- 更新节点或边的文本内容。
42
-
43
- **签名**
44
-
45
- ```ts
46
- updateText(id: string, value: string): void
47
- ```
48
-
49
- **参数**
50
-
51
- | 名称 | 类型 | 必传 | 说明 |
52
- | :--- | :--- | :--- | :--- |
53
- | `id` | `string` | 是 | 节点或边 ID。 |
54
- | `value` | `string` | 是 | 更新后的文本值。 |
55
-
56
- **示例**
57
-
58
- ```ts
59
- lf.updateText('id', 'value');
60
- ```