@logicflow/core 1.2.0-next.1 → 1.2.0-next.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.
Files changed (36) hide show
  1. package/README.md +81 -35
  2. package/dist/logic-flow.js +10925 -9653
  3. package/dist/logic-flow.min.js +15 -1
  4. package/dist/style/index.css +2 -12
  5. package/package.json +5 -4
  6. package/types/LogicFlow.d.ts +16 -10
  7. package/types/constant/constant.d.ts +7 -6
  8. package/types/history/History.d.ts +2 -4
  9. package/types/index.d.ts +5 -4
  10. package/types/model/BaseModel.d.ts +2 -2
  11. package/types/model/EditConfigModel.d.ts +0 -6
  12. package/types/model/GraphModel.d.ts +3 -2
  13. package/types/model/edge/BaseEdgeModel.d.ts +7 -8
  14. package/types/model/edge/BezierEdgeModel.d.ts +0 -1
  15. package/types/model/edge/PolylineEdgeModel.d.ts +4 -17
  16. package/types/model/node/BaseNodeModel.d.ts +25 -28
  17. package/types/model/node/CircleNodeModel.d.ts +0 -1
  18. package/types/model/node/DiamondNodeModel.d.ts +0 -1
  19. package/types/model/node/EllipseNodeModel.d.ts +0 -1
  20. package/types/model/node/PolygonNodeModel.d.ts +0 -1
  21. package/types/model/node/RectNodeModel.d.ts +0 -1
  22. package/types/model/node/TextNodeModel.d.ts +0 -1
  23. package/types/options.d.ts +8 -16
  24. package/types/type/index.d.ts +14 -11
  25. package/types/util/drag.d.ts +3 -1
  26. package/types/util/edge.d.ts +2 -13
  27. package/types/util/node.d.ts +2 -1
  28. package/types/view/Anchor.d.ts +3 -1
  29. package/types/view/basic-shape/LinearGradient.d.ts +1 -0
  30. package/types/view/behavior/Transform.d.ts +4 -0
  31. package/types/view/edge/AdjustPoint.d.ts +9 -4
  32. package/types/view/edge/BaseEdge.d.ts +4 -7
  33. package/types/view/node/BaseNode.d.ts +0 -1
  34. package/types/view/node/HtmlNode.d.ts +2 -2
  35. package/types/view/overlay/CanvasOverlay.d.ts +0 -5
  36. package/types/view/text/BaseText.d.ts +0 -1
package/README.md CHANGED
@@ -37,15 +37,82 @@ LogicFlow 是一款流程图编辑框架,提供了一系列流程图交互、
37
37
 
38
38
  专注于业务流程图编辑的框架
39
39
 
40
- ## 官方文档
41
-
42
- http://logic-flow.org
43
-
44
- ## GITHUB
45
-
46
- https://github.com/didi/LogicFlow
47
-
48
- ## 演示示例
40
+ ## 使用
41
+
42
+ ### 安装
43
+
44
+ ```sh
45
+ # npm
46
+ $ npm install @logicflow/core --save
47
+
48
+
49
+ # yarn
50
+ $ yarn add @logicflow/core
51
+ ```
52
+
53
+ ### 代码示例
54
+
55
+ ```js
56
+ // 创建容器
57
+ <div id="container"></div>;
58
+
59
+ // 准备数据
60
+ const data = {
61
+ // 节点
62
+ nodes: [
63
+ {
64
+ id: 21,
65
+ type: 'rect',
66
+ x: 100,
67
+ y: 200,
68
+ text: {
69
+ value: '矩形节点',
70
+ x: 100,
71
+ y: 200,
72
+ },
73
+ },
74
+ {
75
+ id: 50,
76
+ type: 'circle',
77
+ x: 300,
78
+ y: 400,
79
+ text: {
80
+ value: '圆形节点',
81
+ x: 300,
82
+ y: 400,
83
+ },
84
+ },
85
+ ],
86
+ // 边
87
+ edges: [
88
+ {
89
+ type: 'polyline',
90
+ sourceNodeId: 50,
91
+ targetNodeId: 21,
92
+ },
93
+ ],
94
+ };
95
+ // 渲染画布
96
+ const lf = new LogicFlow({
97
+ container: document.querySelector('#container'),
98
+ width: 700,
99
+ height: 600,
100
+ });
101
+
102
+ lf.render(data);
103
+ ```
104
+
105
+ ## 文档
106
+
107
+ [官方文档](http://logic-flow.org)
108
+
109
+ - [快速上手](http://logic-flow.org/guide/start.html#安装)
110
+ - [基础教程](http://logic-flow.org/guide/basic/logic-flow.html)
111
+ - [进阶指南](http://logic-flow.org/guide/advance/theme.html)
112
+ - [拓展](http://logic-flow.org/guide/extension/extension-components.html)
113
+ - [示例](http://logic-flow.org/usage/bpmn.html)
114
+
115
+ ## 核心能力
49
116
 
50
117
  ### 流程图编辑器快速搭建
51
118
 
@@ -74,45 +141,24 @@ https://github.com/didi/LogicFlow
74
141
 
75
142
  基于上述拓展的能力,前端研发能够根据实际业务场景的需求,灵活的开发出所需的节点、组件等。下面有两个基于 LogicFlow 拓展能力做出的流程图:
76
143
 
77
- ### BPMN应用demo
78
-
79
- 示例地址:http://logic-flow.org/examples/#/extension/bpmn
80
-
81
- 源码地址:https://github.com/didi/LogicFlow/tree/master/examples/src/pages/usage/bpmn
144
+ #### BPMN 规范
82
145
 
83
146
  ![图片:bpmn](https://dpubstatic.udache.com/static/dpubimg/CS6S6q9Yxf/lfexample2.gif)
84
147
 
85
-
86
- #### 审批流应用demo
87
-
88
- 示例地址:http://logic-flow.org/examples/#/usage/approve
89
-
90
- 源码地址:https://github.com/didi/LogicFlow/tree/master/examples/src/pages/usage/approve
148
+ #### 审批流
91
149
 
92
150
  ![图片: 审批流](https://dpubstatic.udache.com/static/dpubimg/uBeSlMEytL/lfexample3.gif)
93
151
 
94
152
  #### vue 应用 demo
95
153
 
96
- 源码地址 [https://github.com/xinxin93/logicflow_vue_demo](https://github.com/xinxin93/logicflow_vue_demo)
97
-
98
- ![https://dpubstatic.udache.com/static/dpubimg/e35cef10-bb7c-4662-a494-f5aac024c092.gif](https://dpubstatic.udache.com/static/dpubimg/e35cef10-bb7c-4662-a494-f5aac024c092.gif)
99
-
100
-
101
- #### 作图工具示例
102
-
103
- LogicFlow不仅支持开发类似bpmn.js这种固定整体样式、更偏向生成数据在流程引擎可执行的流程图工具。也支持实现类似ProcessOn这种自由控制样式的作图工具。
104
-
105
- 示例地址:[http://logic-flow.org/mvp/index.html](http://logic-flow.org/mvp/index.html)
106
-
107
- 源码地址:[https://github.com/didi/LogicFlow/tree/master/site/mvp](https://github.com/didi/LogicFlow/tree/master/site/mvp)
154
+ [代码地址](https://github.com/xinxin93/logicflow_vue_demo)
108
155
 
109
- 示例图如下:
110
- ![logicflow-1.0-4.png](/docs/assets/images/LogicFlow-1.0-4.png)
156
+ ![图片:vue应用](https://dpubstatic.udache.com/static/dpubimg/e35cef10-bb7c-4662-a494-f5aac024c092.gif)
111
157
 
112
158
 
113
159
  #### vue3 node-red风格示例
114
160
 
115
- 源码地址: [https://github.com/Logic-Flow/logicflow-node-red-vue3](https://github.com/Logic-Flow/logicflow-node-red-vue3)
161
+ [Logic-Flow/logicflow-node-red-vue3](https://github.com/Logic-Flow/logicflow-node-red-vue3)
116
162
 
117
163
  ![node-red](https://cdn.jsdelivr.net/gh/Logic-Flow/static@latest/core/node-red.png)
118
164