@logicflow/core 1.2.0-next.0 → 1.2.0-next.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.
- package/README.md +81 -35
- package/dist/logic-flow.js +10907 -9659
- package/dist/logic-flow.min.js +15 -1
- package/dist/style/index.css +2 -12
- package/package.json +5 -4
- package/types/LogicFlow.d.ts +16 -10
- package/types/constant/constant.d.ts +7 -6
- package/types/history/History.d.ts +2 -4
- package/types/index.d.ts +5 -4
- package/types/model/BaseModel.d.ts +2 -2
- package/types/model/EditConfigModel.d.ts +0 -6
- package/types/model/GraphModel.d.ts +3 -2
- package/types/model/edge/BaseEdgeModel.d.ts +7 -8
- package/types/model/edge/BezierEdgeModel.d.ts +0 -1
- package/types/model/edge/PolylineEdgeModel.d.ts +4 -17
- package/types/model/node/BaseNodeModel.d.ts +25 -28
- package/types/model/node/CircleNodeModel.d.ts +0 -1
- package/types/model/node/DiamondNodeModel.d.ts +0 -1
- package/types/model/node/EllipseNodeModel.d.ts +0 -1
- package/types/model/node/PolygonNodeModel.d.ts +0 -1
- package/types/model/node/RectNodeModel.d.ts +0 -1
- package/types/model/node/TextNodeModel.d.ts +0 -1
- package/types/options.d.ts +8 -16
- package/types/type/index.d.ts +13 -10
- package/types/util/drag.d.ts +3 -1
- package/types/util/edge.d.ts +2 -13
- package/types/util/node.d.ts +2 -1
- package/types/view/Anchor.d.ts +3 -1
- package/types/view/basic-shape/LinearGradient.d.ts +1 -0
- package/types/view/behavior/Transform.d.ts +4 -0
- package/types/view/edge/AdjustPoint.d.ts +9 -4
- package/types/view/edge/BaseEdge.d.ts +3 -7
- package/types/view/node/BaseNode.d.ts +0 -1
- package/types/view/node/HtmlNode.d.ts +2 -2
- package/types/view/overlay/CanvasOverlay.d.ts +0 -5
- 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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
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
|

|
|
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
|

|
|
93
151
|
|
|
94
152
|
#### vue 应用 demo
|
|
95
153
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-

|
|
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
|
-

|
|
156
|
+

|
|
111
157
|
|
|
112
158
|
|
|
113
159
|
#### vue3 node-red风格示例
|
|
114
160
|
|
|
115
|
-
|
|
161
|
+
[Logic-Flow/logicflow-node-red-vue3](https://github.com/Logic-Flow/logicflow-node-red-vue3)
|
|
116
162
|
|
|
117
163
|

|
|
118
164
|
|