@logicflow/core 2.2.0-alpha.2 → 2.2.0-alpha.3
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.
- package/.turbo/turbo-build$colon$dev.log +2 -2
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +6 -0
- package/dist/index.css +3 -2
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/LogicFlow.d.ts +9 -0
- package/es/constant/index.d.ts +1 -1
- package/es/constant/index.js +1 -1
- package/es/constant/theme.d.ts +136 -0
- package/es/constant/theme.js +680 -0
- package/es/index.css +3 -2
- package/es/model/GraphModel.d.ts +9 -2
- package/es/model/GraphModel.js +17 -6
- package/es/model/TransformModel.js +9 -9
- package/es/model/edge/BaseEdgeModel.js +7 -2
- package/es/model/edge/PolylineEdgeModel.d.ts +6 -0
- package/es/model/edge/PolylineEdgeModel.js +23 -1
- package/es/model/node/BaseNodeModel.d.ts +12 -1
- package/es/model/node/BaseNodeModel.js +6 -1
- package/es/model/node/HtmlNodeModel.d.ts +12 -0
- package/es/model/node/HtmlNodeModel.js +19 -0
- package/es/model/node/PolygonNodeModel.js +3 -3
- package/es/options.d.ts +1 -1
- package/es/style/index.css +3 -2
- package/es/style/index.less +3 -2
- package/es/style/raw.d.ts +1 -1
- package/es/style/raw.js +1 -1
- package/es/tool/MultipleSelectTool.js +6 -5
- package/es/util/edge.d.ts +1 -1
- package/es/util/edge.js +2 -2
- package/es/util/geometry.d.ts +8 -0
- package/es/util/geometry.js +79 -0
- package/es/util/theme.d.ts +2 -65
- package/es/util/theme.js +4 -281
- package/es/view/Control.d.ts +5 -0
- package/es/view/Control.js +44 -57
- package/es/view/edge/PolylineEdge.js +13 -2
- package/es/view/node/BaseNode.d.ts +1 -0
- package/es/view/node/BaseNode.js +14 -10
- package/es/view/node/HtmlNode.js +2 -4
- package/es/view/overlay/Grid.d.ts +12 -1
- package/es/view/overlay/Grid.js +85 -23
- package/es/view/overlay/OutlineOverlay.d.ts +1 -0
- package/es/view/overlay/OutlineOverlay.js +17 -16
- package/es/view/overlay/gridConfig.d.ts +46 -0
- package/es/view/overlay/gridConfig.js +99 -0
- package/es/view/shape/Polygon.d.ts +0 -7
- package/es/view/shape/Polygon.js +12 -43
- package/lib/LogicFlow.d.ts +9 -0
- package/lib/constant/index.d.ts +1 -1
- package/lib/constant/index.js +16 -2
- package/lib/constant/theme.d.ts +136 -0
- package/lib/constant/theme.js +683 -0
- package/lib/index.css +3 -2
- package/lib/model/GraphModel.d.ts +9 -2
- package/lib/model/GraphModel.js +18 -7
- package/lib/model/TransformModel.js +9 -9
- package/lib/model/edge/BaseEdgeModel.js +7 -2
- package/lib/model/edge/PolylineEdgeModel.d.ts +6 -0
- package/lib/model/edge/PolylineEdgeModel.js +23 -1
- package/lib/model/node/BaseNodeModel.d.ts +12 -1
- package/lib/model/node/BaseNodeModel.js +6 -1
- package/lib/model/node/HtmlNodeModel.d.ts +12 -0
- package/lib/model/node/HtmlNodeModel.js +19 -0
- package/lib/model/node/PolygonNodeModel.js +3 -3
- package/lib/options.d.ts +1 -1
- package/lib/style/index.css +3 -2
- package/lib/style/index.less +3 -2
- package/lib/style/raw.d.ts +1 -1
- package/lib/style/raw.js +1 -1
- package/lib/tool/MultipleSelectTool.js +6 -5
- package/lib/util/edge.d.ts +1 -1
- package/lib/util/edge.js +2 -2
- package/lib/util/geometry.d.ts +8 -0
- package/lib/util/geometry.js +81 -1
- package/lib/util/theme.d.ts +2 -65
- package/lib/util/theme.js +15 -292
- package/lib/view/Control.d.ts +5 -0
- package/lib/view/Control.js +44 -57
- package/lib/view/edge/PolylineEdge.js +13 -2
- package/lib/view/node/BaseNode.d.ts +1 -0
- package/lib/view/node/BaseNode.js +14 -10
- package/lib/view/node/HtmlNode.js +1 -3
- package/lib/view/overlay/Grid.d.ts +12 -1
- package/lib/view/overlay/Grid.js +83 -21
- package/lib/view/overlay/OutlineOverlay.d.ts +1 -0
- package/lib/view/overlay/OutlineOverlay.js +17 -16
- package/lib/view/overlay/gridConfig.d.ts +46 -0
- package/lib/view/overlay/gridConfig.js +104 -0
- package/lib/view/shape/Polygon.d.ts +0 -7
- package/lib/view/shape/Polygon.js +13 -45
- package/package.json +1 -1
- package/src/LogicFlow.tsx +10 -0
- package/src/constant/index.ts +2 -2
- package/src/constant/theme.ts +708 -0
- package/src/model/GraphModel.ts +19 -7
- package/src/model/TransformModel.ts +9 -9
- package/src/model/edge/BaseEdgeModel.ts +10 -2
- package/src/model/edge/PolylineEdgeModel.ts +26 -1
- package/src/model/node/BaseNodeModel.ts +9 -1
- package/src/model/node/HtmlNodeModel.ts +14 -0
- package/src/model/node/PolygonNodeModel.ts +2 -0
- package/src/options.ts +1 -1
- package/src/style/index.less +3 -2
- package/src/style/raw.ts +3 -2
- package/src/tool/MultipleSelectTool.tsx +6 -5
- package/src/util/edge.ts +2 -1
- package/src/util/geometry.ts +99 -0
- package/src/util/theme.ts +12 -303
- package/src/view/Control.tsx +61 -63
- package/src/view/edge/PolylineEdge.tsx +14 -2
- package/src/view/node/BaseNode.tsx +8 -3
- package/src/view/node/HtmlNode.tsx +27 -10
- package/src/view/overlay/Grid.tsx +187 -30
- package/src/view/overlay/OutlineOverlay.tsx +35 -47
- package/src/view/overlay/gridConfig.ts +103 -0
- package/src/view/shape/Polygon.tsx +12 -49
- package/stats.html +1 -1
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
export var DEFAULT_GRID_SIZE = 10;
|
|
2
|
+
export var defaultTheme = {
|
|
3
|
+
baseNode: {
|
|
4
|
+
fill: '#fff',
|
|
5
|
+
stroke: '#474747',
|
|
6
|
+
strokeWidth: 2,
|
|
7
|
+
radius: 12,
|
|
8
|
+
},
|
|
9
|
+
baseEdge: {
|
|
10
|
+
stroke: '#474747',
|
|
11
|
+
strokeWidth: 2,
|
|
12
|
+
radius: 12,
|
|
13
|
+
},
|
|
14
|
+
rect: {
|
|
15
|
+
shadow: {
|
|
16
|
+
dx: 0,
|
|
17
|
+
dy: 0,
|
|
18
|
+
stdDeviation: 4,
|
|
19
|
+
floodColor: '#9CA1AA55',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
circle: {},
|
|
23
|
+
diamond: {},
|
|
24
|
+
ellipse: {},
|
|
25
|
+
polygon: {},
|
|
26
|
+
html: {
|
|
27
|
+
fill: 'transparent',
|
|
28
|
+
stroke: 'transparent',
|
|
29
|
+
shadow: {
|
|
30
|
+
dx: 0,
|
|
31
|
+
dy: 0,
|
|
32
|
+
stdDeviation: 4,
|
|
33
|
+
floodColor: '#9CA1AA55',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
text: {
|
|
37
|
+
color: '#474747',
|
|
38
|
+
stroke: 'none',
|
|
39
|
+
fontSize: 12,
|
|
40
|
+
background: {
|
|
41
|
+
fill: 'transparent',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
nodeText: {
|
|
45
|
+
color: '#474747',
|
|
46
|
+
overflowMode: 'default',
|
|
47
|
+
fontSize: 12,
|
|
48
|
+
lineHeight: 1.2,
|
|
49
|
+
},
|
|
50
|
+
anchor: {
|
|
51
|
+
stroke: '#474747',
|
|
52
|
+
fill: '#fff',
|
|
53
|
+
r: 4,
|
|
54
|
+
hover: {
|
|
55
|
+
r: 8,
|
|
56
|
+
fill: '#707070',
|
|
57
|
+
fillOpacity: 0.15,
|
|
58
|
+
stroke: 'transparent',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
anchorLine: {
|
|
62
|
+
stroke: '#474747',
|
|
63
|
+
strokeWidth: 2,
|
|
64
|
+
strokeDasharray: '3,2',
|
|
65
|
+
},
|
|
66
|
+
line: {},
|
|
67
|
+
polyline: {},
|
|
68
|
+
bezier: {
|
|
69
|
+
fill: 'none',
|
|
70
|
+
adjustLine: {
|
|
71
|
+
stroke: '#949494',
|
|
72
|
+
},
|
|
73
|
+
adjustAnchor: {
|
|
74
|
+
r: 4,
|
|
75
|
+
fill: '#949494',
|
|
76
|
+
fillOpacity: 1,
|
|
77
|
+
stroke: '#949494',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
edgeText: {
|
|
81
|
+
textWidth: 100,
|
|
82
|
+
overflowMode: 'default',
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
background: {
|
|
85
|
+
fill: '#fff',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
arrow: {
|
|
89
|
+
strokeLinecap: 'round',
|
|
90
|
+
strokeLinejoin: 'round',
|
|
91
|
+
offset: 10,
|
|
92
|
+
verticalLength: 5, // 箭头垂直于边的距离
|
|
93
|
+
},
|
|
94
|
+
snapline: {
|
|
95
|
+
strokeLinecap: 'round',
|
|
96
|
+
strokeLinejoin: 'round',
|
|
97
|
+
stroke: '#AAAAAA',
|
|
98
|
+
strokeWidth: 1,
|
|
99
|
+
strokeDasharray: '3,3',
|
|
100
|
+
},
|
|
101
|
+
edgeAdjust: {
|
|
102
|
+
r: 4,
|
|
103
|
+
fill: '#fff',
|
|
104
|
+
stroke: '#474747',
|
|
105
|
+
strokeWidth: 1,
|
|
106
|
+
},
|
|
107
|
+
outline: {
|
|
108
|
+
fill: 'none',
|
|
109
|
+
stroke: 'transparent', // 矩形默认不显示调整边框
|
|
110
|
+
strokeWidth: 0,
|
|
111
|
+
},
|
|
112
|
+
edgeOutline: {
|
|
113
|
+
fill: 'transparent',
|
|
114
|
+
stroke: '#757575',
|
|
115
|
+
strokeWidth: 1.5,
|
|
116
|
+
strokeDasharray: '4,4',
|
|
117
|
+
radius: 8,
|
|
118
|
+
hover: {
|
|
119
|
+
stroke: '#4271DF',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
edgeAnimation: {
|
|
123
|
+
stroke: '#4271DF',
|
|
124
|
+
strokeDasharray: '12,4,6,4',
|
|
125
|
+
strokeDashoffset: '100%',
|
|
126
|
+
animationName: 'lf_animate_dash',
|
|
127
|
+
animationDuration: '20s',
|
|
128
|
+
animationIterationCount: 'infinite',
|
|
129
|
+
animationTimingFunction: 'linear',
|
|
130
|
+
animationDirection: 'normal',
|
|
131
|
+
},
|
|
132
|
+
rotateControl: {
|
|
133
|
+
stroke: '#474747',
|
|
134
|
+
fill: '#fff',
|
|
135
|
+
strokeWidth: 1,
|
|
136
|
+
hover: {
|
|
137
|
+
fill: '#707070',
|
|
138
|
+
fillOpacity: 0.15,
|
|
139
|
+
stroke: 'transparent',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
resizeControl: {
|
|
143
|
+
width: 8,
|
|
144
|
+
height: 8,
|
|
145
|
+
radius: 2,
|
|
146
|
+
fill: '#fff',
|
|
147
|
+
stroke: '#474747',
|
|
148
|
+
hover: {
|
|
149
|
+
width: 12,
|
|
150
|
+
height: 12,
|
|
151
|
+
fill: '#707070',
|
|
152
|
+
fillOpacity: 0.15,
|
|
153
|
+
stroke: 'transparent',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
resizeOutline: {
|
|
157
|
+
fill: 'transparent',
|
|
158
|
+
stroke: '#757575',
|
|
159
|
+
strokeWidth: 1.5,
|
|
160
|
+
strokeDasharray: '4,4',
|
|
161
|
+
radius: 8,
|
|
162
|
+
hover: {
|
|
163
|
+
stroke: '#4271DF',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
export var retroTheme = {
|
|
168
|
+
baseNode: {
|
|
169
|
+
fill: '#fff',
|
|
170
|
+
stroke: '#000',
|
|
171
|
+
strokeWidth: 2,
|
|
172
|
+
},
|
|
173
|
+
baseEdge: {
|
|
174
|
+
stroke: '#000',
|
|
175
|
+
strokeWidth: 2,
|
|
176
|
+
},
|
|
177
|
+
rect: {},
|
|
178
|
+
circle: {},
|
|
179
|
+
diamond: {},
|
|
180
|
+
ellipse: {},
|
|
181
|
+
polygon: {},
|
|
182
|
+
html: {
|
|
183
|
+
fill: 'transparent',
|
|
184
|
+
stroke: 'transparent',
|
|
185
|
+
},
|
|
186
|
+
text: {
|
|
187
|
+
color: '#000',
|
|
188
|
+
stroke: 'none',
|
|
189
|
+
fontSize: 12,
|
|
190
|
+
background: {
|
|
191
|
+
fill: 'transparent',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
anchor: {
|
|
195
|
+
stroke: '#000',
|
|
196
|
+
fill: '#fff',
|
|
197
|
+
r: 4,
|
|
198
|
+
hover: {
|
|
199
|
+
r: 10,
|
|
200
|
+
fill: '#949494',
|
|
201
|
+
fillOpacity: 0.5,
|
|
202
|
+
stroke: '#949494',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
anchorLine: {
|
|
206
|
+
stroke: '#000',
|
|
207
|
+
strokeWidth: 2,
|
|
208
|
+
strokeDasharray: '3,2',
|
|
209
|
+
},
|
|
210
|
+
nodeText: {
|
|
211
|
+
color: '#000',
|
|
212
|
+
overflowMode: 'default',
|
|
213
|
+
fontSize: 12,
|
|
214
|
+
lineHeight: 1.2,
|
|
215
|
+
},
|
|
216
|
+
edgeText: {
|
|
217
|
+
textWidth: 100,
|
|
218
|
+
overflowMode: 'default',
|
|
219
|
+
fontSize: 12,
|
|
220
|
+
background: {
|
|
221
|
+
fill: '#fff',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
line: {},
|
|
225
|
+
polyline: {},
|
|
226
|
+
bezier: {
|
|
227
|
+
fill: 'none',
|
|
228
|
+
adjustLine: {
|
|
229
|
+
stroke: '#949494',
|
|
230
|
+
},
|
|
231
|
+
adjustAnchor: {
|
|
232
|
+
r: 4,
|
|
233
|
+
fill: '#949494',
|
|
234
|
+
fillOpacity: 1,
|
|
235
|
+
stroke: '#949494',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
arrow: {
|
|
239
|
+
offset: 10,
|
|
240
|
+
verticalLength: 5, // 箭头垂直于边的距离
|
|
241
|
+
},
|
|
242
|
+
snapline: {
|
|
243
|
+
stroke: '#949494',
|
|
244
|
+
strokeWidth: 1,
|
|
245
|
+
},
|
|
246
|
+
edgeAdjust: {
|
|
247
|
+
r: 4,
|
|
248
|
+
fill: '#fff',
|
|
249
|
+
stroke: '#949494',
|
|
250
|
+
strokeWidth: 2,
|
|
251
|
+
},
|
|
252
|
+
outline: {
|
|
253
|
+
fill: 'transparent',
|
|
254
|
+
stroke: '#949494',
|
|
255
|
+
strokeDasharray: '3,3',
|
|
256
|
+
hover: {
|
|
257
|
+
stroke: '#949494',
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
edgeOutline: {
|
|
261
|
+
fill: 'transparent',
|
|
262
|
+
stroke: '#949494',
|
|
263
|
+
strokeDasharray: '3,3',
|
|
264
|
+
hover: {
|
|
265
|
+
stroke: '#949494',
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
edgeAnimation: {
|
|
269
|
+
stroke: 'red',
|
|
270
|
+
strokeDasharray: '10,10',
|
|
271
|
+
strokeDashoffset: '100%',
|
|
272
|
+
animationName: 'lf_animate_dash',
|
|
273
|
+
animationDuration: '20s',
|
|
274
|
+
animationIterationCount: 'infinite',
|
|
275
|
+
animationTimingFunction: 'linear',
|
|
276
|
+
animationDirection: 'normal',
|
|
277
|
+
},
|
|
278
|
+
rotateControl: {
|
|
279
|
+
stroke: '#000',
|
|
280
|
+
fill: '#fff',
|
|
281
|
+
strokeWidth: 1.5,
|
|
282
|
+
},
|
|
283
|
+
resizeControl: {
|
|
284
|
+
width: 7,
|
|
285
|
+
height: 7,
|
|
286
|
+
fill: '#fff',
|
|
287
|
+
stroke: '#000',
|
|
288
|
+
},
|
|
289
|
+
resizeOutline: {
|
|
290
|
+
fill: 'none',
|
|
291
|
+
stroke: 'transparent', // 矩形默认不显示调整边框
|
|
292
|
+
strokeWidth: 1,
|
|
293
|
+
strokeDasharray: '3,3',
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
export var darkTheme = {
|
|
297
|
+
baseNode: {
|
|
298
|
+
fill: '#33353A',
|
|
299
|
+
stroke: '#EAEAEA',
|
|
300
|
+
strokeWidth: 2,
|
|
301
|
+
radius: 12,
|
|
302
|
+
},
|
|
303
|
+
baseEdge: {
|
|
304
|
+
stroke: '#EAEAEA',
|
|
305
|
+
strokeWidth: 2,
|
|
306
|
+
radius: 12,
|
|
307
|
+
},
|
|
308
|
+
rect: {},
|
|
309
|
+
circle: {},
|
|
310
|
+
diamond: {},
|
|
311
|
+
ellipse: {},
|
|
312
|
+
polygon: {},
|
|
313
|
+
html: {
|
|
314
|
+
fill: '#33353A',
|
|
315
|
+
stroke: 'transparent',
|
|
316
|
+
shadow: {
|
|
317
|
+
dx: 0,
|
|
318
|
+
dy: 0,
|
|
319
|
+
stdDeviation: 4,
|
|
320
|
+
floodColor: '#9CA1AA55',
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
text: {
|
|
324
|
+
color: '#EAEAEA',
|
|
325
|
+
stroke: 'none',
|
|
326
|
+
fontSize: 12,
|
|
327
|
+
background: {
|
|
328
|
+
fill: 'transparent',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
nodeText: {
|
|
332
|
+
color: '#EAEAEA',
|
|
333
|
+
overflowMode: 'default',
|
|
334
|
+
fontSize: 12,
|
|
335
|
+
lineHeight: 1.2,
|
|
336
|
+
},
|
|
337
|
+
anchor: {
|
|
338
|
+
stroke: '#EAEAEA',
|
|
339
|
+
fill: '#33353A',
|
|
340
|
+
r: 4,
|
|
341
|
+
hover: {
|
|
342
|
+
r: 8,
|
|
343
|
+
fill: '#707070',
|
|
344
|
+
fillOpacity: 0.15,
|
|
345
|
+
stroke: 'transparent',
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
anchorLine: {
|
|
349
|
+
stroke: '#EAEAEA',
|
|
350
|
+
strokeWidth: 2,
|
|
351
|
+
strokeDasharray: '3,2',
|
|
352
|
+
},
|
|
353
|
+
line: {},
|
|
354
|
+
polyline: {},
|
|
355
|
+
bezier: {
|
|
356
|
+
fill: 'none',
|
|
357
|
+
adjustLine: {
|
|
358
|
+
stroke: '#EAEAEA',
|
|
359
|
+
},
|
|
360
|
+
adjustAnchor: {
|
|
361
|
+
r: 4,
|
|
362
|
+
fill: '#33353A',
|
|
363
|
+
fillOpacity: 1,
|
|
364
|
+
stroke: '#EAEAEA',
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
edgeText: {
|
|
368
|
+
textWidth: 100,
|
|
369
|
+
overflowMode: 'default',
|
|
370
|
+
fontSize: 12,
|
|
371
|
+
background: {
|
|
372
|
+
fill: '#EAEAEA',
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
arrow: {
|
|
376
|
+
strokeLinecap: 'round',
|
|
377
|
+
strokeLinejoin: 'round',
|
|
378
|
+
offset: 10,
|
|
379
|
+
verticalLength: 5, // 箭头垂直于边的距离
|
|
380
|
+
},
|
|
381
|
+
snapline: {
|
|
382
|
+
strokeLinecap: 'round',
|
|
383
|
+
strokeLinejoin: 'round',
|
|
384
|
+
stroke: '#949494',
|
|
385
|
+
strokeWidth: 1,
|
|
386
|
+
},
|
|
387
|
+
edgeAdjust: {
|
|
388
|
+
r: 4,
|
|
389
|
+
fill: '#33353A',
|
|
390
|
+
stroke: '#EAEAEA',
|
|
391
|
+
strokeWidth: 1,
|
|
392
|
+
},
|
|
393
|
+
outline: {
|
|
394
|
+
fill: 'none',
|
|
395
|
+
stroke: 'transparent', // 矩形默认不显示调整边框
|
|
396
|
+
strokeWidth: 0,
|
|
397
|
+
},
|
|
398
|
+
edgeOutline: {
|
|
399
|
+
fill: 'transparent',
|
|
400
|
+
stroke: '#EAEAEA',
|
|
401
|
+
strokeWidth: 1.5,
|
|
402
|
+
strokeDasharray: '4,4',
|
|
403
|
+
radius: 8,
|
|
404
|
+
hover: {
|
|
405
|
+
stroke: '#4271DF',
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
edgeAnimation: {
|
|
409
|
+
stroke: '#4271DF',
|
|
410
|
+
strokeDasharray: '12,4,6,4',
|
|
411
|
+
strokeDashoffset: '100%',
|
|
412
|
+
animationName: 'lf_animate_dash',
|
|
413
|
+
animationDuration: '20s',
|
|
414
|
+
animationIterationCount: 'infinite',
|
|
415
|
+
animationTimingFunction: 'linear',
|
|
416
|
+
animationDirection: 'normal',
|
|
417
|
+
},
|
|
418
|
+
rotateControl: {
|
|
419
|
+
stroke: '#EAEAEA',
|
|
420
|
+
fill: '#33353A',
|
|
421
|
+
strokeWidth: 1,
|
|
422
|
+
hover: {
|
|
423
|
+
fill: '#707070',
|
|
424
|
+
fillOpacity: 0.15,
|
|
425
|
+
stroke: 'transparent',
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
resizeControl: {
|
|
429
|
+
width: 8,
|
|
430
|
+
height: 8,
|
|
431
|
+
radius: 2,
|
|
432
|
+
fill: '#33353A',
|
|
433
|
+
stroke: '#EAEAEA',
|
|
434
|
+
hover: {
|
|
435
|
+
width: 12,
|
|
436
|
+
height: 12,
|
|
437
|
+
fill: '#707070',
|
|
438
|
+
fillOpacity: 0.15,
|
|
439
|
+
stroke: 'transparent',
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
resizeOutline: {
|
|
443
|
+
fill: 'transparent',
|
|
444
|
+
stroke: '#EAEAEA',
|
|
445
|
+
strokeWidth: 1.5,
|
|
446
|
+
strokeDasharray: '4,4',
|
|
447
|
+
radius: 8,
|
|
448
|
+
hover: {
|
|
449
|
+
stroke: '#4271DF',
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
};
|
|
453
|
+
export var colorfulTheme = {
|
|
454
|
+
baseNode: {
|
|
455
|
+
fill: '#fff',
|
|
456
|
+
stroke: '#474747',
|
|
457
|
+
strokeWidth: 2,
|
|
458
|
+
radius: 12,
|
|
459
|
+
},
|
|
460
|
+
baseEdge: {
|
|
461
|
+
stroke: '#474747',
|
|
462
|
+
strokeWidth: 2,
|
|
463
|
+
radius: 12,
|
|
464
|
+
},
|
|
465
|
+
rect: { fill: '#72CBFF', stroke: '#3ABDF9', radius: 8 },
|
|
466
|
+
circle: { fill: '#FFE075', stroke: '#F9CE3A', radius: 8 },
|
|
467
|
+
ellipse: { fill: '#FFA8A8', stroke: '#FF6B66', radius: 8 },
|
|
468
|
+
text: { fill: '#72CBFF', radius: 8, fontSize: 12 },
|
|
469
|
+
diamond: { fill: '#96F7AF', stroke: '#40EF7E', radius: 8 },
|
|
470
|
+
polygon: { fill: '#E0A8FF', stroke: '#C271FF', radius: 8 },
|
|
471
|
+
nodeText: {
|
|
472
|
+
color: '#474747',
|
|
473
|
+
overflowMode: 'default',
|
|
474
|
+
fontSize: 12,
|
|
475
|
+
lineHeight: 1.2,
|
|
476
|
+
},
|
|
477
|
+
edgeText: {
|
|
478
|
+
textWidth: 100,
|
|
479
|
+
overflowMode: 'default',
|
|
480
|
+
fontSize: 12,
|
|
481
|
+
background: {
|
|
482
|
+
fill: '#fff',
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
html: {
|
|
486
|
+
fill: '#fff',
|
|
487
|
+
stroke: 'transparent',
|
|
488
|
+
strokeWidth: 0,
|
|
489
|
+
},
|
|
490
|
+
anchor: {
|
|
491
|
+
stroke: '#474747',
|
|
492
|
+
fill: '#fff',
|
|
493
|
+
r: 4,
|
|
494
|
+
hover: {
|
|
495
|
+
r: 8,
|
|
496
|
+
fill: '#707070',
|
|
497
|
+
fillOpacity: 0.15,
|
|
498
|
+
stroke: 'transparent',
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
anchorLine: {
|
|
502
|
+
stroke: '#474747',
|
|
503
|
+
strokeWidth: 2,
|
|
504
|
+
strokeDasharray: '3,2',
|
|
505
|
+
},
|
|
506
|
+
line: {},
|
|
507
|
+
polyline: { radius: 8 },
|
|
508
|
+
bezier: {
|
|
509
|
+
fill: 'none',
|
|
510
|
+
adjustLine: {
|
|
511
|
+
stroke: '#3ABDF9',
|
|
512
|
+
},
|
|
513
|
+
adjustAnchor: {
|
|
514
|
+
r: 4,
|
|
515
|
+
fill: '#3ABDF9',
|
|
516
|
+
fillOpacity: 1,
|
|
517
|
+
stroke: '#3ABDF9',
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
edgeAdjust: {
|
|
521
|
+
r: 4,
|
|
522
|
+
fill: '#fff',
|
|
523
|
+
stroke: '#474747',
|
|
524
|
+
strokeWidth: 1,
|
|
525
|
+
},
|
|
526
|
+
arrow: {
|
|
527
|
+
strokeLinecap: 'round',
|
|
528
|
+
strokeLinejoin: 'round',
|
|
529
|
+
offset: 10,
|
|
530
|
+
verticalLength: 5, // 箭头垂直于边的距离
|
|
531
|
+
},
|
|
532
|
+
snapline: {
|
|
533
|
+
strokeLinecap: 'round',
|
|
534
|
+
strokeLinejoin: 'round',
|
|
535
|
+
stroke: '#949494',
|
|
536
|
+
strokeWidth: 1,
|
|
537
|
+
},
|
|
538
|
+
outline: {
|
|
539
|
+
radius: 8,
|
|
540
|
+
fill: 'transparent',
|
|
541
|
+
stroke: '#949494',
|
|
542
|
+
strokeDasharray: '3,3',
|
|
543
|
+
hover: {
|
|
544
|
+
stroke: '#949494',
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
edgeOutline: {
|
|
548
|
+
fill: 'transparent',
|
|
549
|
+
stroke: '#757575',
|
|
550
|
+
strokeWidth: 1.5,
|
|
551
|
+
strokeDasharray: '4,4',
|
|
552
|
+
radius: 8,
|
|
553
|
+
hover: {
|
|
554
|
+
stroke: '#4271DF',
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
edgeAnimation: {
|
|
558
|
+
stroke: '#4271DF',
|
|
559
|
+
strokeDasharray: '12,4,6,4',
|
|
560
|
+
strokeDashoffset: '100%',
|
|
561
|
+
animationName: 'lf_animate_dash',
|
|
562
|
+
animationDuration: '20s',
|
|
563
|
+
animationIterationCount: 'infinite',
|
|
564
|
+
animationTimingFunction: 'linear',
|
|
565
|
+
animationDirection: 'normal',
|
|
566
|
+
},
|
|
567
|
+
rotateControl: {
|
|
568
|
+
stroke: '#474747',
|
|
569
|
+
fill: '#fff',
|
|
570
|
+
strokeWidth: 1,
|
|
571
|
+
hover: {
|
|
572
|
+
fill: '#707070',
|
|
573
|
+
fillOpacity: 0.15,
|
|
574
|
+
stroke: 'transparent',
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
resizeControl: {
|
|
578
|
+
width: 8,
|
|
579
|
+
height: 8,
|
|
580
|
+
radius: 2,
|
|
581
|
+
fill: '#fff',
|
|
582
|
+
stroke: '#474747',
|
|
583
|
+
hover: {
|
|
584
|
+
width: 12,
|
|
585
|
+
height: 12,
|
|
586
|
+
fill: '#707070',
|
|
587
|
+
fillOpacity: 0.15,
|
|
588
|
+
stroke: 'transparent',
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
resizeOutline: {
|
|
592
|
+
fill: 'transparent',
|
|
593
|
+
stroke: '#757575',
|
|
594
|
+
strokeWidth: 1.5,
|
|
595
|
+
strokeDasharray: '4,4',
|
|
596
|
+
radius: 8,
|
|
597
|
+
hover: {
|
|
598
|
+
stroke: '#4271DF',
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
};
|
|
602
|
+
export var themeModeMap = {
|
|
603
|
+
default: defaultTheme,
|
|
604
|
+
colorful: colorfulTheme,
|
|
605
|
+
dark: darkTheme,
|
|
606
|
+
retro: retroTheme,
|
|
607
|
+
};
|
|
608
|
+
// 不同主题的背景色
|
|
609
|
+
export var darkBackground = {
|
|
610
|
+
background: '#33353A',
|
|
611
|
+
};
|
|
612
|
+
export var colorfulBackground = {
|
|
613
|
+
background: '#fefeff',
|
|
614
|
+
};
|
|
615
|
+
export var defaultBackground = {
|
|
616
|
+
background: '#FBFCFE',
|
|
617
|
+
};
|
|
618
|
+
export var retroBackground = {
|
|
619
|
+
background: '#ffffff',
|
|
620
|
+
};
|
|
621
|
+
export var backgroundModeMap = {
|
|
622
|
+
colorful: colorfulBackground,
|
|
623
|
+
dark: darkBackground,
|
|
624
|
+
default: defaultBackground,
|
|
625
|
+
retro: retroBackground,
|
|
626
|
+
};
|
|
627
|
+
// 不同主题的网格样式
|
|
628
|
+
export var darkGrid = {
|
|
629
|
+
size: DEFAULT_GRID_SIZE,
|
|
630
|
+
visible: true,
|
|
631
|
+
type: 'mesh',
|
|
632
|
+
config: {
|
|
633
|
+
color: '#83838377',
|
|
634
|
+
thickness: 2,
|
|
635
|
+
},
|
|
636
|
+
majorBold: true,
|
|
637
|
+
};
|
|
638
|
+
export var colorfulGrid = {
|
|
639
|
+
size: DEFAULT_GRID_SIZE,
|
|
640
|
+
visible: true,
|
|
641
|
+
type: 'dot',
|
|
642
|
+
config: {
|
|
643
|
+
color: '#b7c2d9',
|
|
644
|
+
thickness: 2,
|
|
645
|
+
},
|
|
646
|
+
majorBold: false,
|
|
647
|
+
};
|
|
648
|
+
export var defaultGrid = {
|
|
649
|
+
size: DEFAULT_GRID_SIZE,
|
|
650
|
+
visible: true,
|
|
651
|
+
type: 'mesh',
|
|
652
|
+
config: {
|
|
653
|
+
color: '#D7DEEB',
|
|
654
|
+
thickness: 1,
|
|
655
|
+
},
|
|
656
|
+
// majorBold: true,
|
|
657
|
+
majorBold: {
|
|
658
|
+
opacity: 0.6,
|
|
659
|
+
boldIndices: [5],
|
|
660
|
+
dashArrayConfig: { pattern: [] },
|
|
661
|
+
customBoldWidth: 2,
|
|
662
|
+
},
|
|
663
|
+
};
|
|
664
|
+
export var retroGrid = {
|
|
665
|
+
size: DEFAULT_GRID_SIZE,
|
|
666
|
+
visible: true,
|
|
667
|
+
type: 'dot',
|
|
668
|
+
config: {
|
|
669
|
+
color: '#ababab',
|
|
670
|
+
thickness: 1,
|
|
671
|
+
},
|
|
672
|
+
majorBold: false,
|
|
673
|
+
};
|
|
674
|
+
export var gridModeMap = {
|
|
675
|
+
colorful: colorfulGrid,
|
|
676
|
+
dark: darkGrid,
|
|
677
|
+
retro: retroGrid,
|
|
678
|
+
default: defaultGrid,
|
|
679
|
+
};
|
|
680
|
+
export default null;
|
package/es/index.css
CHANGED
|
@@ -177,8 +177,9 @@
|
|
|
177
177
|
}
|
|
178
178
|
.lf-multiple-select {
|
|
179
179
|
position: absolute;
|
|
180
|
-
border: 2px dashed #
|
|
181
|
-
|
|
180
|
+
border: 2px dashed #4271dfcc;
|
|
181
|
+
border-radius: 12px;
|
|
182
|
+
box-shadow: 0 0 3px 0 #4271df80;
|
|
182
183
|
cursor: move;
|
|
183
184
|
}
|
|
184
185
|
.lf-edge-adjust-point {
|
package/es/model/GraphModel.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare class GraphModel {
|
|
|
17
17
|
width: number;
|
|
18
18
|
height: number;
|
|
19
19
|
theme: LogicFlow.Theme;
|
|
20
|
-
|
|
20
|
+
themeMode: LogicFlow.ThemeMode | string;
|
|
21
|
+
customStyles: LogicFlow.Theme;
|
|
21
22
|
grid: Grid.GridOptions;
|
|
22
23
|
readonly eventCenter: EventEmitter;
|
|
23
24
|
readonly modelMap: Map<string, LogicFlow.GraphElementCtor>;
|
|
@@ -404,7 +405,7 @@ export declare class GraphModel {
|
|
|
404
405
|
* 设置主题
|
|
405
406
|
* todo docs link
|
|
406
407
|
*/
|
|
407
|
-
setTheme(style: Partial<LogicFlow.Theme>, themeMode?:
|
|
408
|
+
setTheme(style: Partial<LogicFlow.Theme>, themeMode?: LogicFlow.ThemeMode | string): void;
|
|
408
409
|
/**
|
|
409
410
|
* 设置主题
|
|
410
411
|
* todo docs link
|
|
@@ -419,6 +420,7 @@ export declare class GraphModel {
|
|
|
419
420
|
diamond: LogicFlow.CommonTheme;
|
|
420
421
|
ellipse: LogicFlow.CommonTheme;
|
|
421
422
|
polygon: LogicFlow.CommonTheme;
|
|
423
|
+
html: LogicFlow.CommonTheme;
|
|
422
424
|
line: LogicFlow.CommonTheme;
|
|
423
425
|
polyline: LogicFlow.CommonTheme;
|
|
424
426
|
bezier: LogicFlow.EdgeBezierTheme;
|
|
@@ -433,8 +435,13 @@ export declare class GraphModel {
|
|
|
433
435
|
rotateControl: LogicFlow.CommonTheme;
|
|
434
436
|
resizeControl: LogicFlow.CommonTheme;
|
|
435
437
|
resizeOutline: LogicFlow.CommonTheme;
|
|
438
|
+
multiSelect?: {
|
|
439
|
+
xPadding?: number | undefined;
|
|
440
|
+
yPadding?: number | undefined;
|
|
441
|
+
} | undefined;
|
|
436
442
|
edgeAdjust: LogicFlow.CommonTheme;
|
|
437
443
|
outline: LogicFlow.OutlineTheme;
|
|
444
|
+
edgeOutline: LogicFlow.OutlineTheme;
|
|
438
445
|
edgeAnimation: LogicFlow.EdgeAnimation;
|
|
439
446
|
};
|
|
440
447
|
/**
|