Skip to content

Commit a77ef9c

Browse files
authored
Merge pull request #6 from lww117/master
feat(docs): 0.2.0
2 parents c6cbfd5 + ed5207a commit a77ef9c

27 files changed

+1384
-849
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ lf.render(data);
8282
- [快速上手](http://logic-flow.org/guide/start.html#安装)
8383
- [基础教程](http://logic-flow.org/guide/basic/logic-flow.html)
8484
- [进阶指南](http://logic-flow.org/guide/advance/theme.html)
85-
- [拓展](http://logic-flow.org/guide/extension/extension-intro.html)
85+
- [拓展](http://logic-flow.org/guide/extension/extension-components.html)
8686
- [示例](http://logic-flow.org/usage/bpmn.html)
8787

8888

docs/.vuepress/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const guide = [
3131
title: '拓展',
3232
collapsable: false,
3333
children: [
34-
'extension/extension-intro',
3534
'extension/extension-components',
3635
'extension/bpmn-element',
3736
'extension/snapshot',

docs/api/customEdgeApi.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 自定义连线
2+
3+
## getShape
4+
5+
获取连线的 SVG 元素。
6+
7+
```ts
8+
getShape(): h.JSX.Element
9+
```
10+
11+
## getAttributes
12+
13+
获取连线的属性,其返回值如下:
14+
15+
|key|类型|描述|
16+
|-|-|-|
17+
|stroke|string|连线和箭头当前状态的颜色|
18+
|strokeWidth|number|连线的宽度|
19+
|strokeOpacity|number|连线透明度|
20+
|selectedShadow|string|连线选中的阴影效果|
21+
|isSelected|boolean|连线选中状态|
22+
|isHoverd|boolean|连线是否被hoverd|
23+
|properties|object|连线属性|
24+
|hoverStroke|string|设置的连线被hover的颜色|
25+
|selectedStroke|string|设置的连线被选中的颜色|
26+
27+
使用示例:
28+
29+
```ts
30+
getAttributes() {
31+
const attributes = super.getAttributes();
32+
return Object.assign(attributes, {});
33+
}
34+
```
35+
36+
## getArrowStyle
37+
38+
获取连线的箭头样式,其返回值如下:
39+
40+
|key|类型|描述|
41+
|-|-|-|
42+
|stroke|string|箭头当前状态的颜色|
43+
|strokeWidth|number|箭头的宽度|
44+
|fill|string|箭头填充颜色|
45+
|offset|number|箭头长度|
46+
|verticalLength|number|箭头垂直于连线的距离|
47+
48+
使用示例:
49+
50+
```ts
51+
getArrowStyle() {
52+
const style = super.getArrowStyle();
53+
style.fill = "transparent";
54+
return style;
55+
}
56+
```

docs/api/customNodeApi.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 自定义节点
2+
3+
## getShape
4+
5+
获取连线的 SVG 元素。
6+
7+
```ts
8+
getShape(): h.JSX.Element
9+
```
10+
11+
## getAttributes
12+
13+
获取连线的属性,其返回值为[数据属性](/api/nodeApi.md#通用属性)[样式属性](/api/nodeApi.html#样式属性)的合集。
14+
15+
使用示例:
16+
17+
```ts
18+
getAttributes() {
19+
const attributes = super.getAttributes();
20+
return Object.assign(attributes, {});
21+
}
22+
```
23+
24+
## getConnectedSourceRules
25+
26+
获取节点作为开始节点(source)的校验规则。
27+
28+
```ts
29+
getConnectedSourceRules(): ConnectRule[]
30+
31+
export type ConnectRule = {
32+
message: string;
33+
validate: (source: BaseNodeModel, target: BaseNodeModel) => boolean;
34+
};
35+
```
36+
37+
## getConnectedTargetRules
38+
39+
获取节点作为目标节点(target)的校验规则。
40+
41+
```ts
42+
getConnectedTargetRules(): ConnectRule[]
43+
44+
export type ConnectRule = {
45+
message: string;
46+
validate: (source: BaseNodeModel, target: BaseNodeModel) => boolean;
47+
};
48+
```

0 commit comments

Comments
 (0)