@logicflow/core 2.2.0-alpha.2 → 2.2.0-alpha.4

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