@logicflow/core 2.2.1 → 2.2.2

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 (126) hide show
  1. package/dist/docs/api/logicflow-constructor/index.en.md +106 -0
  2. package/dist/docs/api/logicflow-constructor/index.zh.md +106 -0
  3. package/dist/docs/api/logicflow-constructor/use.en.md +61 -0
  4. package/dist/docs/api/logicflow-constructor/use.zh.md +61 -0
  5. package/dist/docs/api/logicflow-instance/canvas.en.md +197 -0
  6. package/dist/docs/api/logicflow-instance/canvas.zh.md +199 -0
  7. package/dist/docs/api/logicflow-instance/edge.en.md +273 -0
  8. package/dist/docs/api/logicflow-instance/edge.zh.md +273 -0
  9. package/dist/docs/api/logicflow-instance/edit-config.en.md +59 -0
  10. package/dist/docs/api/logicflow-instance/edit-config.zh.md +59 -0
  11. package/dist/docs/api/logicflow-instance/element.en.md +375 -0
  12. package/dist/docs/api/logicflow-instance/element.zh.md +379 -0
  13. package/dist/docs/api/logicflow-instance/event.en.md +326 -0
  14. package/dist/docs/api/logicflow-instance/event.zh.md +406 -0
  15. package/dist/docs/api/logicflow-instance/history.en.md +38 -0
  16. package/dist/docs/api/logicflow-instance/history.zh.md +38 -0
  17. package/dist/docs/api/logicflow-instance/index.en.md +41 -0
  18. package/dist/docs/api/logicflow-instance/index.zh.md +41 -0
  19. package/dist/docs/api/logicflow-instance/node.en.md +308 -0
  20. package/dist/docs/api/logicflow-instance/node.zh.md +308 -0
  21. package/dist/docs/api/logicflow-instance/register.en.md +76 -0
  22. package/dist/docs/api/logicflow-instance/register.zh.md +76 -0
  23. package/dist/docs/api/logicflow-instance/render-and-data.en.md +179 -0
  24. package/dist/docs/api/logicflow-instance/render-and-data.zh.md +181 -0
  25. package/dist/docs/api/logicflow-instance/text.en.md +60 -0
  26. package/dist/docs/api/logicflow-instance/text.zh.md +60 -0
  27. package/dist/docs/api/logicflow-instance/theme.en.md +179 -0
  28. package/dist/docs/api/logicflow-instance/theme.zh.md +179 -0
  29. package/dist/docs/api/runtime-model/edgeModel.en.md +29 -0
  30. package/dist/docs/api/runtime-model/edgeModel.zh.md +325 -0
  31. package/dist/docs/api/runtime-model/graphModel.en.md +275 -0
  32. package/dist/docs/api/runtime-model/graphModel.zh.md +1153 -0
  33. package/dist/docs/api/runtime-model/nodeModel.en.md +37 -0
  34. package/dist/docs/api/runtime-model/nodeModel.zh.md +644 -0
  35. package/dist/docs/api/type/MainTypes.en.md +598 -0
  36. package/dist/docs/api/type/MainTypes.zh.md +867 -0
  37. package/dist/docs/api/type/Theme.en.md +187 -0
  38. package/dist/docs/api/type/Theme.zh.md +187 -0
  39. package/dist/docs/api/type/canvas-types.en.md +25 -0
  40. package/dist/docs/api/type/canvas-types.zh.md +25 -0
  41. package/dist/docs/api/type/index.en.md +96 -0
  42. package/dist/docs/api/type/index.zh.md +99 -0
  43. package/dist/docs/api/type/node-types.en.md +21 -0
  44. package/dist/docs/api/type/node-types.zh.md +21 -0
  45. package/dist/docs/api/type/plugin-types.en.md +24 -0
  46. package/dist/docs/api/type/plugin-types.zh.md +24 -0
  47. package/dist/docs/index.md +11 -0
  48. package/dist/docs/tutorial/about.en.md +38 -0
  49. package/dist/docs/tutorial/about.zh.md +65 -0
  50. package/dist/docs/tutorial/advanced/dnd.en.md +62 -0
  51. package/dist/docs/tutorial/advanced/dnd.zh.md +52 -0
  52. package/dist/docs/tutorial/advanced/edge.en.md +64 -0
  53. package/dist/docs/tutorial/advanced/edge.zh.md +66 -0
  54. package/dist/docs/tutorial/advanced/keyboard.en.md +70 -0
  55. package/dist/docs/tutorial/advanced/keyboard.zh.md +67 -0
  56. package/dist/docs/tutorial/advanced/node.en.md +338 -0
  57. package/dist/docs/tutorial/advanced/node.zh.md +338 -0
  58. package/dist/docs/tutorial/advanced/react.en.md +106 -0
  59. package/dist/docs/tutorial/advanced/react.zh.md +114 -0
  60. package/dist/docs/tutorial/advanced/silent-mode.en.md +75 -0
  61. package/dist/docs/tutorial/advanced/silent-mode.zh.md +71 -0
  62. package/dist/docs/tutorial/advanced/snapline.en.md +54 -0
  63. package/dist/docs/tutorial/advanced/vue.en.md +249 -0
  64. package/dist/docs/tutorial/advanced/vue.zh.md +248 -0
  65. package/dist/docs/tutorial/ai.en.md +64 -0
  66. package/dist/docs/tutorial/ai.zh.md +64 -0
  67. package/dist/docs/tutorial/basic/background.en.md +50 -0
  68. package/dist/docs/tutorial/basic/canvas.en.md +164 -0
  69. package/dist/docs/tutorial/basic/canvas.zh.md +183 -0
  70. package/dist/docs/tutorial/basic/class.en.md +106 -0
  71. package/dist/docs/tutorial/basic/class.zh.md +103 -0
  72. package/dist/docs/tutorial/basic/edge.en.md +151 -0
  73. package/dist/docs/tutorial/basic/edge.zh.md +152 -0
  74. package/dist/docs/tutorial/basic/event.en.md +70 -0
  75. package/dist/docs/tutorial/basic/event.zh.md +66 -0
  76. package/dist/docs/tutorial/basic/grid.en.md +77 -0
  77. package/dist/docs/tutorial/basic/node.en.md +358 -0
  78. package/dist/docs/tutorial/basic/node.zh.md +318 -0
  79. package/dist/docs/tutorial/basic/theme.en.md +154 -0
  80. package/dist/docs/tutorial/basic/theme.zh.md +157 -0
  81. package/dist/docs/tutorial/extension/adapter.en.md +446 -0
  82. package/dist/docs/tutorial/extension/adapter.zh.md +429 -0
  83. package/dist/docs/tutorial/extension/bpmn-element.en.md +1427 -0
  84. package/dist/docs/tutorial/extension/bpmn-element.zh.md +1472 -0
  85. package/dist/docs/tutorial/extension/control.en.md +117 -0
  86. package/dist/docs/tutorial/extension/control.zh.md +118 -0
  87. package/dist/docs/tutorial/extension/curved-edge.en.md +46 -0
  88. package/dist/docs/tutorial/extension/curved-edge.zh.md +46 -0
  89. package/dist/docs/tutorial/extension/custom.en.md +142 -0
  90. package/dist/docs/tutorial/extension/custom.zh.md +138 -0
  91. package/dist/docs/tutorial/extension/dnd-panel.en.md +109 -0
  92. package/dist/docs/tutorial/extension/dnd-panel.zh.md +109 -0
  93. package/dist/docs/tutorial/extension/dynamic-group.en.md +606 -0
  94. package/dist/docs/tutorial/extension/dynamic-group.zh.md +606 -0
  95. package/dist/docs/tutorial/extension/group.en.md +217 -0
  96. package/dist/docs/tutorial/extension/group.zh.md +209 -0
  97. package/dist/docs/tutorial/extension/highlight.en.md +50 -0
  98. package/dist/docs/tutorial/extension/highlight.zh.md +50 -0
  99. package/dist/docs/tutorial/extension/insert-node-in-polyline.en.md +52 -0
  100. package/dist/docs/tutorial/extension/insert-node-in-polyline.zh.md +47 -0
  101. package/dist/docs/tutorial/extension/intro.en.md +72 -0
  102. package/dist/docs/tutorial/extension/intro.zh.md +95 -0
  103. package/dist/docs/tutorial/extension/label.en.md +136 -0
  104. package/dist/docs/tutorial/extension/label.zh.md +135 -0
  105. package/dist/docs/tutorial/extension/layout.en.md +156 -0
  106. package/dist/docs/tutorial/extension/layout.zh.md +156 -0
  107. package/dist/docs/tutorial/extension/menu.en.md +319 -0
  108. package/dist/docs/tutorial/extension/menu.zh.md +377 -0
  109. package/dist/docs/tutorial/extension/minimap.en.md +164 -0
  110. package/dist/docs/tutorial/extension/minimap.zh.md +180 -0
  111. package/dist/docs/tutorial/extension/node-resize.en.md +199 -0
  112. package/dist/docs/tutorial/extension/node-resize.zh.md +221 -0
  113. package/dist/docs/tutorial/extension/pool.en.md +227 -0
  114. package/dist/docs/tutorial/extension/pool.zh.md +227 -0
  115. package/dist/docs/tutorial/extension/proximity-connect.en.md +104 -0
  116. package/dist/docs/tutorial/extension/proximity-connect.zh.md +107 -0
  117. package/dist/docs/tutorial/extension/selection.en.md +166 -0
  118. package/dist/docs/tutorial/extension/selection.zh.md +150 -0
  119. package/dist/docs/tutorial/extension/snapshot.en.md +276 -0
  120. package/dist/docs/tutorial/extension/snapshot.zh.md +276 -0
  121. package/dist/docs/tutorial/get-started.en.md +501 -0
  122. package/dist/docs/tutorial/get-started.zh.md +139 -0
  123. package/dist/docs/tutorial/update.en.md +213 -0
  124. package/dist/docs/tutorial/update.zh.md +212 -0
  125. package/package.json +5 -3
  126. package/scripts/postinstall-ai-prompt.js +67 -0
@@ -0,0 +1,179 @@
1
+ ---
2
+ nav: API
3
+ group:
4
+ title: LogicFlow Instance
5
+ order: 2
6
+ title: Theme
7
+ toc: content
8
+ order: 9
9
+ ---
10
+
11
+ This page explains how a LogicFlow instance reads, overrides, and extends theme configuration at runtime.
12
+
13
+ ## setTheme
14
+
15
+ Apply a partial theme; values merge with the active theme.
16
+
17
+ **Signature**
18
+
19
+ ```ts
20
+ setTheme(style: Partial<Theme>, themeMode?: string): void
21
+ ```
22
+
23
+ **Parameters**
24
+
25
+ | Name | Type | Required | Description |
26
+ | :--- | :--- | :--- | :--- |
27
+ | `style` | [`Partial<Theme>`](../type/Theme.en.md#theme) | Yes | Incremental theme fields. |
28
+ | `themeMode` | `string` | No | Named theme mode to activate. |
29
+
30
+ **Example**
31
+
32
+ ```ts
33
+ lf.setTheme({
34
+ baseNode: {
35
+ fill: '#ffffff',
36
+ stroke: '#1f2937',
37
+ strokeWidth: 2,
38
+ },
39
+ nodeText: {
40
+ color: '#111827',
41
+ fontSize: 12,
42
+ },
43
+ });
44
+ ```
45
+
46
+ ## getTheme
47
+
48
+ Return the full theme currently in effect.
49
+
50
+ **Signature**
51
+
52
+ ```ts
53
+ getTheme(): Theme
54
+ ```
55
+
56
+ **Returns**
57
+
58
+ | Type | Description |
59
+ | :--- | :--- |
60
+ | [`Theme`](../type/Theme.en.md#theme) | Complete theme object. |
61
+
62
+ **Example**
63
+
64
+ ```ts
65
+ const currentTheme = lf.getTheme();
66
+ lf.setTheme({
67
+ rect: {
68
+ ...currentTheme.rect,
69
+ fill: '#ff0000',
70
+ },
71
+ });
72
+ ```
73
+
74
+ ## addThemeMode
75
+
76
+ Register a named theme mode, then switch with `setTheme({}, themeMode)`.
77
+
78
+ **Signature**
79
+
80
+ ```ts
81
+ addThemeMode(themeMode: string, style: Partial<Theme>): void
82
+ ```
83
+
84
+ **Parameters**
85
+
86
+ | Name | Type | Required | Description |
87
+ | :--- | :--- | :--- | :--- |
88
+ | `themeMode` | `string` | Yes | Mode name. |
89
+ | `style` | [`Partial<Theme>`](../type/Theme.en.md#theme) | Yes | Theme payload for that mode. |
90
+
91
+ **Example**
92
+
93
+ ```ts
94
+ lf.addThemeMode('custom', {
95
+ rect: {
96
+ fill: '#e6f7ff',
97
+ stroke: '#1890ff',
98
+ strokeWidth: 2,
99
+ },
100
+ nodeText: {
101
+ color: '#333333',
102
+ fontSize: 14,
103
+ },
104
+ });
105
+
106
+ lf.setTheme({}, 'custom');
107
+ ```
108
+
109
+ ## Type reference
110
+
111
+ ### Theme
112
+
113
+ `Theme` is the root runtime theme object covering nodes, edges, text, anchors, arrows, selection chrome, and more.
114
+
115
+ | Field | Type | Description |
116
+ | :--- | :--- | :--- |
117
+ | `baseNode` | [`CommonTheme`](../type/Theme.en.md#commontheme) | Defaults shared by all nodes. |
118
+ | `baseEdge` | [`EdgeTheme`](../type/Theme.en.md#edgetheme) | Defaults shared by all edges. |
119
+ | `rect` / `circle` / `diamond` / `ellipse` / `polygon` | [`NodeTheme`](../type/Theme.en.md#recttheme) | Per-shape node styling. |
120
+ | `line` / `polyline` / `bezier` | [`EdgeTheme`](../type/Theme.en.md#edgetheme) | Per edge-type styling. |
121
+ | `text` / `nodeText` / `edgeText` | [`TextTheme`](../type/Theme.en.md#texttheme) | Text nodes and labels. |
122
+ | `anchor` | [`AnchorTheme`](../type/Theme.en.md#anchortheme) | Anchor styling. |
123
+ | `arrow` | [`ArrowTheme`](../type/Theme.en.md#arrowtheme) | Arrowheads. |
124
+ | `snapline` | [`EdgeTheme`](../type/Theme.en.md#edgetheme) | Snapline appearance. |
125
+ | `outline` | [`OutlineTheme`](../type/Theme.en.md#outlinetheme) | Hover/selection outlines. |
126
+ | `edgeAdjust` | [`NodeTheme`](../type/Theme.en.md#recttheme) | Edge endpoint adjustment handles. |
127
+
128
+ ### CommonTheme
129
+
130
+ Shared fields for most theme records.
131
+
132
+ | Field | Type | Description |
133
+ | :--- | :--- | :--- |
134
+ | `fill` | `string \| 'none'` | Fill color. |
135
+ | `stroke` | `string \| 'none'` | Stroke color. |
136
+ | `strokeWidth` | `number` | Stroke width. |
137
+ | `radius` / `rx` / `ry` | `number` | Corner radii. |
138
+ | `width` / `height` | `number` | Optional sizing hints. |
139
+ | `path` | `string` | Custom SVG path. |
140
+ | `[key: string]` | `unknown` | Additional SVG attributes. |
141
+
142
+ ### NodeTheme
143
+
144
+ Used for concrete node shapes such as [`RectTheme`](../type/Theme.en.md#recttheme), [`CircleTheme`](../type/Theme.en.md#circletheme), [`PolygonTheme`](../type/Theme.en.md#polygontheme), and [`EllipseTheme`](../type/Theme.en.md#ellipsetheme); all extend [`CommonTheme`](../type/Theme.en.md#commontheme).
145
+
146
+ ### EdgeTheme
147
+
148
+ Extends [`CommonTheme`](../type/Theme.en.md#commontheme) with edge-specific fields.
149
+
150
+ | Field | Type | Description |
151
+ | :--- | :--- | :--- |
152
+ | `strokeDasharray` | `string` | Dash pattern. |
153
+ | `animation` | [`EdgeAnimation`](../type/Theme.en.md#edgeanimation) | Edge animation config. |
154
+
155
+ Curved edges may also define `adjustLine` and `adjustAnchor`.
156
+
157
+ ### TextTheme
158
+
159
+ Extends [`CommonTheme`](../type/Theme.en.md#commontheme) with typography fields.
160
+
161
+ | Field | Type | Description |
162
+ | :--- | :--- | :--- |
163
+ | `color` | `string \| 'none'` | Text color. |
164
+ | `fontSize` | `number` | Font size. |
165
+ | `textWidth` | `number` | Optional text box width. |
166
+ | `lineHeight` | `number` | Optional line height. |
167
+ | `textAnchor` | `'start' \| 'middle' \| 'end'` | Horizontal alignment. |
168
+ | `dominantBaseline` | `string` | Vertical baseline. |
169
+
170
+ Node text may add `overflowMode`, `background`, `wrapPadding`; edge text may add `hover`.
171
+
172
+ ### Other theme types
173
+
174
+ - [`AnchorTheme`](../type/Theme.en.md#anchortheme): anchor radius and hover state.
175
+ - [`ArrowTheme`](../type/Theme.en.md#arrowtheme): offsets, lengths, arrow kinds.
176
+ - [`OutlineTheme`](../type/Theme.en.md#outlinetheme): selection box hover styling.
177
+ - [`EdgeAnimation`](../type/Theme.en.md#edgeanimation): dash offset, duration, repeat count, etc.
178
+
179
+ Constructor-time `style` / `themeMode`: [Constructor](../logicflow-constructor/index.en.md).
@@ -0,0 +1,179 @@
1
+ ---
2
+ nav: API
3
+ group:
4
+ title: LogicFlow 实例
5
+ order: 2
6
+ title: 主题
7
+ toc: content
8
+ order: 9
9
+ ---
10
+
11
+ 本页说明 LogicFlow 实例在运行时如何读取、覆盖和扩展主题配置。
12
+
13
+ ## setTheme
14
+
15
+ 设置当前实例的主题。可只传部分字段,系统会与当前主题合并。
16
+
17
+ **签名**
18
+
19
+ ```ts
20
+ setTheme(style: Partial<Theme>, themeMode?: string): void
21
+ ```
22
+
23
+ **参数**
24
+
25
+ | 名称 | 类型 | 必传 | 说明 |
26
+ | :--- | :--- | :--- | :--- |
27
+ | `style` | [`Partial<Theme>`](../type/Theme.zh.md#theme主题配置) | 是 | 主题增量配置。 |
28
+ | `themeMode` | `string` | 否 | 指定要应用的主题模式名。 |
29
+
30
+ **示例**
31
+
32
+ ```ts
33
+ lf.setTheme({
34
+ baseNode: {
35
+ fill: '#ffffff',
36
+ stroke: '#1f2937',
37
+ strokeWidth: 2,
38
+ },
39
+ nodeText: {
40
+ color: '#111827',
41
+ fontSize: 12,
42
+ },
43
+ });
44
+ ```
45
+
46
+ ## getTheme
47
+
48
+ 获取当前画布生效的完整主题配置。
49
+
50
+ **签名**
51
+
52
+ ```ts
53
+ getTheme(): Theme
54
+ ```
55
+
56
+ **返回值**
57
+
58
+ | 类型 | 说明 |
59
+ | :--- | :--- |
60
+ | [`Theme`](../type/Theme.zh.md#theme主题配置) | 当前完整主题对象。 |
61
+
62
+ **示例**
63
+
64
+ ```ts
65
+ const currentTheme = lf.getTheme();
66
+ lf.setTheme({
67
+ rect: {
68
+ ...currentTheme.rect,
69
+ fill: '#ff0000',
70
+ },
71
+ });
72
+ ```
73
+
74
+ ## addThemeMode
75
+
76
+ 注册新的主题模式,注册后可通过 `setTheme({}, themeMode)` 切换。
77
+
78
+ **签名**
79
+
80
+ ```ts
81
+ addThemeMode(themeMode: string, style: Partial<Theme>): void
82
+ ```
83
+
84
+ **参数**
85
+
86
+ | 名称 | 类型 | 必传 | 说明 |
87
+ | :--- | :--- | :--- | :--- |
88
+ | `themeMode` | `string` | 是 | 主题模式名称。 |
89
+ | `style` | [`Partial<Theme>`](../type/Theme.zh.md#theme主题配置) | 是 | 该模式下的主题样式。 |
90
+
91
+ **示例**
92
+
93
+ ```ts
94
+ lf.addThemeMode('custom', {
95
+ rect: {
96
+ fill: '#e6f7ff',
97
+ stroke: '#1890ff',
98
+ strokeWidth: 2,
99
+ },
100
+ nodeText: {
101
+ color: '#333333',
102
+ fontSize: 14,
103
+ },
104
+ });
105
+
106
+ lf.setTheme({}, 'custom');
107
+ ```
108
+
109
+ ## 类型说明
110
+
111
+ ### Theme(主题配置)
112
+
113
+ `Theme` 是运行时主题的总类型,覆盖节点、边、文本、锚点、箭头、选中态等样式入口。
114
+
115
+ | 属性名 | 类型 | 描述 |
116
+ | :--- | :--- | :--- |
117
+ | `baseNode` | [`CommonTheme`](../type/Theme.zh.md#commontheme通用主题) | 所有节点通用样式。 |
118
+ | `baseEdge` | [`EdgeTheme`](../type/Theme.zh.md#edgetheme边主题) | 所有边通用样式。 |
119
+ | `rect/circle/diamond/ellipse/polygon` | [`NodeTheme`](../type/Theme.zh.md#nodetheme节点主题) | 对应节点形状样式。 |
120
+ | `line/polyline/bezier` | [`EdgeTheme`](../type/Theme.zh.md#edgetheme边主题) | 对应边形态样式。 |
121
+ | `text/nodeText/edgeText` | [`TextTheme`](../type/Theme.zh.md#texttheme文本主题) | 文本节点、节点文案、边文案样式。 |
122
+ | `anchor` | [`AnchorTheme`](../type/Theme.zh.md#anchortheme) | 锚点样式。 |
123
+ | `arrow` | [`ArrowTheme`](../type/Theme.zh.md#arrowtheme) | 箭头样式。 |
124
+ | `snapline` | [`EdgeTheme`](../type/Theme.zh.md#edgetheme边主题) | 对齐线样式。 |
125
+ | `outline` | [`OutlineTheme`](../type/Theme.zh.md#outlinetheme) | 选中/悬停外框样式。 |
126
+ | `edgeAdjust` | [`NodeTheme`](../type/Theme.zh.md#nodetheme节点主题) | 连线端点调整手柄样式。 |
127
+
128
+ ### CommonTheme(通用主题)
129
+
130
+ `CommonTheme` 是多数主题类型共享的基础字段。
131
+
132
+ | 属性名 | 类型 | 描述 |
133
+ | :--- | :--- | :--- |
134
+ | `fill` | `string \| 'none'` | 填充色。 |
135
+ | `stroke` | `string \| 'none'` | 描边色。 |
136
+ | `strokeWidth` | `number` | 描边宽度。 |
137
+ | `radius/rx/ry` | `number` | 圆角相关配置。 |
138
+ | `width/height` | `number` | 可用于部分图形尺寸样式。 |
139
+ | `path` | `string` | 自定义 SVG 路径。 |
140
+ | `[key: string]` | `unknown` | 透传扩展 SVG 属性。 |
141
+
142
+ ### NodeTheme(节点主题)
143
+
144
+ `NodeTheme` 用于节点图形样式(如 [`RectTheme`](../type/Theme.zh.md#recttheme)、[`CircleTheme`](../type/Theme.zh.md#circletheme)、[`PolygonTheme`](../type/Theme.zh.md#polygontheme)、[`EllipseTheme`](../type/Theme.zh.md#ellipsetheme)),本质上都基于 [`CommonTheme`](../type/Theme.zh.md#commontheme通用主题)。
145
+
146
+ ### EdgeTheme(边主题)
147
+
148
+ `EdgeTheme` 基于 [`CommonTheme`](../type/Theme.zh.md#commontheme通用主题),并扩展边样式能力。
149
+
150
+ | 属性名 | 类型 | 描述 |
151
+ | :--- | :--- | :--- |
152
+ | `strokeDasharray` | `string` | 虚线样式。 |
153
+ | `animation` | [`EdgeAnimation`](../type/Theme.zh.md#edgeanimation) | 边动画配置。 |
154
+
155
+ 曲线边还可扩展 `adjustLine` 与 `adjustAnchor`。
156
+
157
+ ### TextTheme(文本主题)
158
+
159
+ `TextTheme` 在 [`CommonTheme`](../type/Theme.zh.md#commontheme通用主题) 基础上扩展文本样式字段。
160
+
161
+ | 属性名 | 类型 | 描述 |
162
+ | :--- | :--- | :--- |
163
+ | `color` | `string \| 'none'` | 文字颜色。 |
164
+ | `fontSize` | `number` | 字号。 |
165
+ | `textWidth` | `number` | 文本宽度(可选)。 |
166
+ | `lineHeight` | `number` | 行高(可选)。 |
167
+ | `textAnchor` | `'start' \| 'middle' \| 'end'` | 水平对齐(可选)。 |
168
+ | `dominantBaseline` | `string` | 垂直基线(可选)。 |
169
+
170
+ 节点文本可继续扩展 `overflowMode`、`background`、`wrapPadding`;边文本可在此基础上扩展 `hover`。
171
+
172
+ ### 其他主题类型
173
+
174
+ - [`AnchorTheme`](../type/Theme.zh.md#anchortheme):锚点样式,支持 `r` 与 `hover`。
175
+ - [`ArrowTheme`](../type/Theme.zh.md#arrowtheme):箭头样式,支持 `offset`、`verticalLength`、`startArrowType`、`endArrowType` 等。
176
+ - [`OutlineTheme`](../type/Theme.zh.md#outlinetheme):选中框样式,支持 `hover`。
177
+ - [`EdgeAnimation`](../type/Theme.zh.md#edgeanimation):边动画样式,支持虚线偏移、时长、次数等字段。
178
+
179
+ 构造期 style / themeMode 见 [构造方法](../logicflow-constructor/index.zh.md)。
@@ -0,0 +1,29 @@
1
+ ---
2
+ nav: API
3
+ group:
4
+ title: Runtime Model
5
+ order: 3
6
+ title: edgeModel
7
+ toc: content
8
+ order: 14
9
+ ---
10
+
11
+ Every edge exposes an `edgeModel` that mirrors the node pattern: data feeds rendering, and state transitions should go through documented APIs.
12
+
13
+ :::error{title=Warning}
14
+ Direct field writes can desynchronize anchors, bend points, and text overlays. Use built-in helpers whenever possible.
15
+ :::
16
+
17
+ ## Data properties {#data-properties}
18
+
19
+ Edge payloads combine [`EdgeConfig`](../type/MainTypes.en.md#edgeconfig) fields (`sourceNodeId`, `targetNodeId`, anchor ids, `pointsList`, text metadata, etc.) with runtime caches maintained while the edge exists on the canvas.
20
+
21
+ ## Shape attributes {#shape-attributes}
22
+
23
+ Attributes that influence routing—control points, endpoints, or adjustable segments—belong in `setAttributes()` so dependent computations stay coherent.
24
+
25
+ ## Style attributes {#style-attributes}
26
+
27
+ Theme-facing hooks include `getEdgeStyle`, `getTextStyle`, `getArrowStyle`, `getOutlineStyle`, animation helpers, and adjust-handle styling. Override these methods inside custom edge models to integrate with LogicFlow’s theme pipeline rather than mutating SVG fragments manually.
28
+
29
+ For additional lifecycle methods (`initEdgeData`, `setAttributes`, history snapshots, etc.), follow the `BaseEdgeModel` typings shipped with `@logicflow/core`.