@logicflow/core 2.2.0 → 2.2.1
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/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/LogicFlow.js +0 -1
- 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 +10 -2
- package/es/model/GraphModel.js +48 -14
- package/es/model/TransformModel.js +9 -9
- package/es/model/edge/BaseEdgeModel.js +7 -2
- package/es/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/es/model/edge/PolylineEdgeModel.js +136 -7
- package/es/model/node/BaseNodeModel.d.ts +12 -1
- package/es/model/node/BaseNodeModel.js +9 -2
- 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 +4 -2
- 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 +10 -5
- package/es/util/drag.js +0 -1
- package/es/util/edge.d.ts +40 -1
- package/es/util/edge.js +43 -9
- 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/Anchor.d.ts +1 -0
- package/es/view/Anchor.js +24 -21
- package/es/view/Control.d.ts +5 -0
- package/es/view/Control.js +44 -57
- package/es/view/edge/BaseEdge.js +9 -0
- package/es/view/edge/PolylineEdge.js +13 -2
- package/es/view/node/BaseNode.d.ts +1 -0
- package/es/view/node/BaseNode.js +23 -11
- package/es/view/node/HtmlNode.js +2 -4
- package/es/view/overlay/CanvasOverlay.js +5 -2
- 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 +18 -17
- 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/LogicFlow.js +0 -1
- 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 +10 -2
- package/lib/model/GraphModel.js +49 -15
- package/lib/model/TransformModel.js +9 -9
- package/lib/model/edge/BaseEdgeModel.js +7 -2
- package/lib/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/lib/model/edge/PolylineEdgeModel.js +136 -7
- package/lib/model/node/BaseNodeModel.d.ts +12 -1
- package/lib/model/node/BaseNodeModel.js +9 -2
- 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 +4 -2
- 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 +10 -5
- package/lib/util/drag.js +0 -1
- package/lib/util/edge.d.ts +40 -1
- package/lib/util/edge.js +43 -9
- 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/Anchor.d.ts +1 -0
- package/lib/view/Anchor.js +24 -21
- package/lib/view/Control.d.ts +5 -0
- package/lib/view/Control.js +44 -57
- package/lib/view/edge/BaseEdge.js +9 -0
- package/lib/view/edge/PolylineEdge.js +13 -2
- package/lib/view/node/BaseNode.d.ts +1 -0
- package/lib/view/node/BaseNode.js +22 -10
- package/lib/view/node/HtmlNode.js +1 -3
- package/lib/view/overlay/CanvasOverlay.js +5 -2
- 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 +18 -17
- 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 +6 -1
- package/.turbo/turbo-build$colon$dev.log +0 -10
- package/.turbo/turbo-build.log +0 -33
- package/CHANGELOG.md +0 -1849
- package/__tests__/algorithm/egde.test.ts +0 -131
- package/__tests__/algorithm/index.test.ts +0 -74
- package/__tests__/algorithm/outline.test.ts +0 -43
- package/__tests__/bugs/1545-spec.test.ts +0 -42
- package/__tests__/event/event.test.ts +0 -22
- package/__tests__/history/history.test.ts +0 -28
- package/__tests__/logicflow.test.ts +0 -575
- package/__tests__/model/graphmodel.test.ts +0 -87
- package/__tests__/util/compatible.test.ts +0 -48
- package/__tests__/util/edge.test.ts +0 -224
- package/__tests__/util/geometry.test.ts +0 -14
- package/__tests__/util/graph.test.ts +0 -16
- package/__tests__/util/matrix.test.ts +0 -41
- package/__tests__/util/node.test.ts +0 -68
- package/__tests__/util/sampling.test.ts +0 -12
- package/__tests__/util/vector.test.ts +0 -50
- package/__tests__/util/zIndex.test.ts +0 -10
- package/src/LogicFlow.tsx +0 -2008
- package/src/algorithm/edge.ts +0 -67
- package/src/algorithm/index.ts +0 -70
- package/src/algorithm/outline.ts +0 -77
- package/src/algorithm/rotate.ts +0 -55
- package/src/common/drag.ts +0 -219
- package/src/common/history.ts +0 -108
- package/src/common/index.ts +0 -6
- package/src/common/keyboard.ts +0 -108
- package/src/common/matrix.ts +0 -122
- package/src/common/vector.ts +0 -93
- package/src/constant/index.ts +0 -179
- package/src/event/event.md +0 -66
- package/src/event/eventArgs.ts +0 -643
- package/src/event/eventEmitter.ts +0 -156
- package/src/history/index.ts +0 -119
- package/src/index.less +0 -1
- package/src/index.ts +0 -26
- package/src/keyboard/index.ts +0 -112
- package/src/keyboard/shortcut.ts +0 -200
- package/src/model/BaseModel.ts +0 -250
- package/src/model/EditConfigModel.ts +0 -334
- package/src/model/GraphModel.ts +0 -1788
- package/src/model/NestedTransformModel.ts +0 -121
- package/src/model/SnaplineModel.ts +0 -256
- package/src/model/TransformModel.ts +0 -258
- package/src/model/edge/BaseEdgeModel.ts +0 -777
- package/src/model/edge/BezierEdgeModel.ts +0 -197
- package/src/model/edge/LineEdgeModel.ts +0 -36
- package/src/model/edge/PolylineEdgeModel.ts +0 -672
- package/src/model/edge/index.ts +0 -4
- package/src/model/index.ts +0 -9
- package/src/model/node/BaseNodeModel.ts +0 -949
- package/src/model/node/CircleNodeModel.ts +0 -91
- package/src/model/node/DiamondNodeModel.ts +0 -132
- package/src/model/node/EllipseNodeModel.ts +0 -98
- package/src/model/node/HtmlNodeModel.ts +0 -50
- package/src/model/node/PolygonNodeModel.ts +0 -150
- package/src/model/node/RectNodeModel.ts +0 -69
- package/src/model/node/TextNodeModel.ts +0 -54
- package/src/model/node/index.ts +0 -8
- package/src/options.ts +0 -145
- package/src/style/index.less +0 -261
- package/src/style/raw.ts +0 -220
- package/src/tool/MultipleSelectTool.tsx +0 -132
- package/src/tool/TextEditTool.tsx +0 -193
- package/src/tool/index.ts +0 -101
- package/src/typings.d.ts +0 -5
- package/src/util/animation.ts +0 -29
- package/src/util/browser.ts +0 -4
- package/src/util/compatible.ts +0 -15
- package/src/util/drag.ts +0 -220
- package/src/util/edge.ts +0 -1060
- package/src/util/geometry.ts +0 -55
- package/src/util/graph.ts +0 -46
- package/src/util/index.ts +0 -17
- package/src/util/matrix.ts +0 -129
- package/src/util/mobx.ts +0 -23
- package/src/util/node.ts +0 -543
- package/src/util/raf.ts +0 -28
- package/src/util/resize.ts +0 -606
- package/src/util/sampling.ts +0 -85
- package/src/util/theme.ts +0 -375
- package/src/util/uuid.ts +0 -26
- package/src/util/vector.ts +0 -93
- package/src/util/zIndex.ts +0 -6
- package/src/view/Anchor.tsx +0 -445
- package/src/view/Control.tsx +0 -512
- package/src/view/Graph.tsx +0 -141
- package/src/view/Rotate.tsx +0 -113
- package/src/view/behavior/dnd.ts +0 -162
- package/src/view/behavior/index.ts +0 -2
- package/src/view/behavior/snapline.ts +0 -16
- package/src/view/edge/AdjustPoint.tsx +0 -425
- package/src/view/edge/Arrow.tsx +0 -54
- package/src/view/edge/BaseEdge.tsx +0 -650
- package/src/view/edge/BezierEdge.tsx +0 -101
- package/src/view/edge/LineEdge.tsx +0 -81
- package/src/view/edge/PolylineEdge.tsx +0 -299
- package/src/view/edge/index.ts +0 -6
- package/src/view/index.ts +0 -8
- package/src/view/node/BaseNode.tsx +0 -571
- package/src/view/node/CircleNode.tsx +0 -21
- package/src/view/node/DiamondNode.tsx +0 -24
- package/src/view/node/EllipseNode.tsx +0 -22
- package/src/view/node/HtmlNode.tsx +0 -95
- package/src/view/node/PolygonNode.tsx +0 -28
- package/src/view/node/RectNode.tsx +0 -30
- package/src/view/node/TextNode.tsx +0 -39
- package/src/view/node/index.ts +0 -8
- package/src/view/overlay/BackgroundOverlay.tsx +0 -34
- package/src/view/overlay/BezierAdjustOverlay.tsx +0 -150
- package/src/view/overlay/CanvasOverlay.tsx +0 -288
- package/src/view/overlay/Grid.tsx +0 -162
- package/src/view/overlay/ModificationOverlay.tsx +0 -31
- package/src/view/overlay/OutlineOverlay.tsx +0 -170
- package/src/view/overlay/SnaplineOverlay.tsx +0 -44
- package/src/view/overlay/ToolOverlay.tsx +0 -65
- package/src/view/overlay/getTransformHoc.tsx +0 -50
- package/src/view/overlay/index.ts +0 -8
- package/src/view/shape/Circle.tsx +0 -41
- package/src/view/shape/Ellipse.tsx +0 -42
- package/src/view/shape/Line.tsx +0 -39
- package/src/view/shape/Path.tsx +0 -22
- package/src/view/shape/Polygon.tsx +0 -91
- package/src/view/shape/Polyline.tsx +0 -31
- package/src/view/shape/Rect.tsx +0 -44
- package/src/view/shape/Text.tsx +0 -169
- package/src/view/shape/index.ts +0 -8
- package/src/view/text/BaseText.tsx +0 -134
- package/src/view/text/LineText.tsx +0 -168
- package/src/view/text/index.ts +0 -2
- package/stats.html +0 -4842
- package/tsconfig.json +0 -18
|
@@ -1,777 +0,0 @@
|
|
|
1
|
-
import { assign, cloneDeep, find, isUndefined } from 'lodash-es'
|
|
2
|
-
import { action, computed, isObservable, observable, set, toJS } from 'mobx'
|
|
3
|
-
import { BaseNodeModel, GraphModel, Model } from '..'
|
|
4
|
-
import LogicFlow from '../../LogicFlow'
|
|
5
|
-
import {
|
|
6
|
-
createUuid,
|
|
7
|
-
formatData,
|
|
8
|
-
getAnchors,
|
|
9
|
-
getZIndex,
|
|
10
|
-
pickEdgeConfig,
|
|
11
|
-
twoPointDistance,
|
|
12
|
-
} from '../../util'
|
|
13
|
-
import {
|
|
14
|
-
ElementState,
|
|
15
|
-
ElementType,
|
|
16
|
-
ModelType,
|
|
17
|
-
OverlapMode,
|
|
18
|
-
TextMode,
|
|
19
|
-
} from '../../constant'
|
|
20
|
-
|
|
21
|
-
import Point = LogicFlow.Point
|
|
22
|
-
import EdgeData = LogicFlow.EdgeData
|
|
23
|
-
import EdgeConfig = LogicFlow.EdgeConfig
|
|
24
|
-
import TextConfig = LogicFlow.TextConfig
|
|
25
|
-
import PropertiesType = LogicFlow.PropertiesType
|
|
26
|
-
|
|
27
|
-
export interface IBaseEdgeModel<P extends PropertiesType>
|
|
28
|
-
extends Model.BaseModel<P> {
|
|
29
|
-
/**
|
|
30
|
-
* model 基础类型,固定为 edge
|
|
31
|
-
*/
|
|
32
|
-
readonly BaseType: ElementType.EDGE
|
|
33
|
-
properties: P
|
|
34
|
-
|
|
35
|
-
sourceNodeId: string
|
|
36
|
-
targetNodeId: string
|
|
37
|
-
|
|
38
|
-
startPoint?: Point
|
|
39
|
-
endPoint?: Point
|
|
40
|
-
points: string
|
|
41
|
-
pointsList: Point[]
|
|
42
|
-
|
|
43
|
-
isAnimation: boolean
|
|
44
|
-
isDragging?: boolean
|
|
45
|
-
isShowAdjustPoint: boolean // 是否显示边两端的调整点
|
|
46
|
-
|
|
47
|
-
sourceAnchorId?: string
|
|
48
|
-
targetAnchorId?: string
|
|
49
|
-
arrowConfig?: LogicFlow.ArrowConfig
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class BaseEdgeModel<P extends PropertiesType = PropertiesType>
|
|
53
|
-
implements IBaseEdgeModel<P>
|
|
54
|
-
{
|
|
55
|
-
readonly BaseType = ElementType.EDGE
|
|
56
|
-
static BaseType: ElementType = ElementType.EDGE
|
|
57
|
-
|
|
58
|
-
// 数据属性
|
|
59
|
-
public id = ''
|
|
60
|
-
@observable type = ''
|
|
61
|
-
@observable sourceNodeId = ''
|
|
62
|
-
@observable targetNodeId = ''
|
|
63
|
-
@observable startPoint!: Point
|
|
64
|
-
@observable endPoint!: Point
|
|
65
|
-
|
|
66
|
-
@observable textMode = TextMode.TEXT
|
|
67
|
-
@observable text: Required<TextConfig> = {
|
|
68
|
-
value: '',
|
|
69
|
-
x: 0,
|
|
70
|
-
y: 0,
|
|
71
|
-
draggable: false,
|
|
72
|
-
editable: true,
|
|
73
|
-
}
|
|
74
|
-
@observable properties: P
|
|
75
|
-
@observable points = ''
|
|
76
|
-
@observable pointsList: Point[] = []
|
|
77
|
-
|
|
78
|
-
// 状态属性
|
|
79
|
-
virtual = false
|
|
80
|
-
@observable isSelected = false
|
|
81
|
-
@observable isHovered = false
|
|
82
|
-
@observable isHitable = true // 细粒度控制边是否对用户操作进行反应
|
|
83
|
-
@observable isHittable = true // 细粒度控制边是否对用户操作进行反应
|
|
84
|
-
@observable draggable = true
|
|
85
|
-
@observable visible = true
|
|
86
|
-
|
|
87
|
-
// 边特有属性,动画及调整点
|
|
88
|
-
@observable isAnimation = false
|
|
89
|
-
@observable isShowAdjustPoint = false // 是否显示边两端的调整点
|
|
90
|
-
isDragging?: boolean
|
|
91
|
-
// 引用属性
|
|
92
|
-
graphModel: GraphModel
|
|
93
|
-
@observable zIndex: number = 0
|
|
94
|
-
@observable state = ElementState.DEFAULT
|
|
95
|
-
modelType = ModelType.EDGE
|
|
96
|
-
additionStateData?: Model.AdditionStateDataType
|
|
97
|
-
|
|
98
|
-
sourceAnchorId?: string
|
|
99
|
-
targetAnchorId?: string
|
|
100
|
-
|
|
101
|
-
menu?: LogicFlow.MenuConfig[]
|
|
102
|
-
customTextPosition = false // 是否自定义边文本位置
|
|
103
|
-
@observable style: LogicFlow.CommonTheme = {} // 每条边自己的样式,动态修改
|
|
104
|
-
|
|
105
|
-
// TODO: 每个边独立生成一个marker没必要
|
|
106
|
-
// 箭头属性
|
|
107
|
-
@observable arrowConfig: LogicFlow.ArrowConfig = {
|
|
108
|
-
markerEnd: `url(#marker-end-${this.id})`,
|
|
109
|
-
markerStart: `url(#marker-start-${this.id})`,
|
|
110
|
-
};
|
|
111
|
-
[propName: string]: unknown // 支持自定义
|
|
112
|
-
|
|
113
|
-
constructor(data: EdgeConfig<P>, graphModel: GraphModel) {
|
|
114
|
-
this.graphModel = graphModel
|
|
115
|
-
this.properties = data.properties ?? ({} as P)
|
|
116
|
-
|
|
117
|
-
this.initEdgeData(data)
|
|
118
|
-
this.setAttributes()
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* 初始化边数据
|
|
123
|
-
* @overridable 支持重写
|
|
124
|
-
* initNodeData和setAttributes的区别在于
|
|
125
|
-
* initNodeData只在节点初始化的时候调用,用于初始化节点的所有属性。
|
|
126
|
-
* setAttributes除了初始化调用外,还会在properties发生变化后调用。
|
|
127
|
-
*/
|
|
128
|
-
initEdgeData(data: EdgeConfig) {
|
|
129
|
-
if (!data.properties) {
|
|
130
|
-
data.properties = {}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!data.id) {
|
|
134
|
-
// 自定义边id > 全局定义边id > 内置
|
|
135
|
-
const { idGenerator } = this.graphModel
|
|
136
|
-
const globalId = idGenerator && idGenerator(data.type)
|
|
137
|
-
const nodeId = this.createId()
|
|
138
|
-
data.id = nodeId || globalId || createUuid()
|
|
139
|
-
}
|
|
140
|
-
this.arrowConfig.markerEnd = `url(#marker-end-${data.id})`
|
|
141
|
-
this.arrowConfig.markerStart = `url(#marker-start-${data.id})`
|
|
142
|
-
const {
|
|
143
|
-
editConfigModel: { adjustEdgeStartAndEnd },
|
|
144
|
-
} = this.graphModel
|
|
145
|
-
this.isShowAdjustPoint = adjustEdgeStartAndEnd
|
|
146
|
-
assign(this, pickEdgeConfig(data))
|
|
147
|
-
const { overlapMode, eventCenter } = this.graphModel
|
|
148
|
-
this.updateZIndexByOverlap(overlapMode, data.zIndex || getZIndex())
|
|
149
|
-
// 设置边的 anchors,也就是边的两个端点
|
|
150
|
-
// 端点依赖于 edgeData 的 sourceNode 和 targetNode
|
|
151
|
-
this.setAnchors()
|
|
152
|
-
// 边的拐点依赖于两个端点
|
|
153
|
-
this.initPoints()
|
|
154
|
-
// 文本位置依赖于边上的所有拐点
|
|
155
|
-
this.formatText(data)
|
|
156
|
-
|
|
157
|
-
eventCenter.on('overlap:change', (data) => {
|
|
158
|
-
const { overlapMode: newMode } = data
|
|
159
|
-
this.updateZIndexByOverlap(newMode, this.zIndex || getZIndex())
|
|
160
|
-
})
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* 设置model属性
|
|
165
|
-
* @overridable 支持重写
|
|
166
|
-
* 每次properties发生变化会触发
|
|
167
|
-
*/
|
|
168
|
-
setAttributes() {}
|
|
169
|
-
|
|
170
|
-
createId(): string | null {
|
|
171
|
-
return null
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* 自定义边样式
|
|
176
|
-
*
|
|
177
|
-
* @overridable 支持重写
|
|
178
|
-
* @returns 自定义边样式
|
|
179
|
-
*/
|
|
180
|
-
getEdgeStyle(): LogicFlow.EdgeTheme {
|
|
181
|
-
return {
|
|
182
|
-
...this.graphModel.theme.baseEdge,
|
|
183
|
-
...this.style,
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* 自定义边调整点样式
|
|
189
|
-
*
|
|
190
|
-
* @overridable 支持重写
|
|
191
|
-
* 在isShowAdjustPoint为true时会显示调整点。
|
|
192
|
-
*/
|
|
193
|
-
getAdjustPointStyle() {
|
|
194
|
-
return {
|
|
195
|
-
...this.graphModel.theme.edgeAdjust,
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* 自定义边文本样式
|
|
200
|
-
*
|
|
201
|
-
* @overridable 支持重写
|
|
202
|
-
*/
|
|
203
|
-
getTextStyle() {
|
|
204
|
-
// 透传 edgeText
|
|
205
|
-
const { edgeText } = this.graphModel.theme
|
|
206
|
-
return cloneDeep(edgeText)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* 自定义边动画样式
|
|
211
|
-
*
|
|
212
|
-
* @overridable 支持重写
|
|
213
|
-
* @example
|
|
214
|
-
* getEdgeAnimationStyle() {
|
|
215
|
-
* const style = super.getEdgeAnimationStyle()
|
|
216
|
-
* style.stroke = 'blue'
|
|
217
|
-
* style.animationDuration = '30s'
|
|
218
|
-
* style.animationDirection = 'reverse'
|
|
219
|
-
* return style
|
|
220
|
-
* }
|
|
221
|
-
*/
|
|
222
|
-
getEdgeAnimationStyle() {
|
|
223
|
-
const { edgeAnimation } = this.graphModel.theme
|
|
224
|
-
return cloneDeep(edgeAnimation)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* 自定义边箭头样式
|
|
229
|
-
*
|
|
230
|
-
* @overridable 支持重写
|
|
231
|
-
* @example
|
|
232
|
-
* getArrowStyle() {
|
|
233
|
-
* const style = super.getArrowStyle()
|
|
234
|
-
* style.stroke = 'green'
|
|
235
|
-
* return style
|
|
236
|
-
* }
|
|
237
|
-
*/
|
|
238
|
-
getArrowStyle(): LogicFlow.ArrowTheme {
|
|
239
|
-
const edgeStyle = this.getEdgeStyle()
|
|
240
|
-
const edgeAnimationStyle = this.getEdgeAnimationStyle()
|
|
241
|
-
const { arrow } = this.graphModel.theme
|
|
242
|
-
const stroke = this.isAnimation
|
|
243
|
-
? edgeAnimationStyle.stroke
|
|
244
|
-
: edgeStyle.stroke
|
|
245
|
-
return {
|
|
246
|
-
...edgeStyle,
|
|
247
|
-
fill: stroke,
|
|
248
|
-
stroke,
|
|
249
|
-
...arrow,
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* 自定义边被选中时展示其范围的矩形框样式
|
|
255
|
-
*
|
|
256
|
-
* @overridable 支持重写
|
|
257
|
-
* @example
|
|
258
|
-
* // 隐藏outline
|
|
259
|
-
* getOutlineStyle() {
|
|
260
|
-
* const style = super.getOutlineStyle()
|
|
261
|
-
* style.stroke = "none"
|
|
262
|
-
* style.hover.stroke = "none"
|
|
263
|
-
* return style
|
|
264
|
-
* }
|
|
265
|
-
*/
|
|
266
|
-
getOutlineStyle(): LogicFlow.OutlineTheme {
|
|
267
|
-
const { graphModel } = this
|
|
268
|
-
const { outline } = graphModel.theme
|
|
269
|
-
return cloneDeep(outline)
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* 重新自定义文本位置
|
|
274
|
-
*
|
|
275
|
-
* @overridable 支持重写
|
|
276
|
-
*/
|
|
277
|
-
getTextPosition(): Point {
|
|
278
|
-
return {
|
|
279
|
-
x: 0,
|
|
280
|
-
y: 0,
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* 边的前一个节点
|
|
286
|
-
*/
|
|
287
|
-
@computed get sourceNode() {
|
|
288
|
-
return this.graphModel?.nodesMap[this.sourceNodeId]?.model
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* 边的后一个节点
|
|
293
|
-
*/
|
|
294
|
-
@computed get targetNode() {
|
|
295
|
-
return this.graphModel?.nodesMap[this.targetNodeId]?.model
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
@computed get textPosition(): Point {
|
|
299
|
-
return this.getTextPosition()
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* 内部方法,计算两个节点相连时的起点位置
|
|
304
|
-
*/
|
|
305
|
-
getBeginAnchor(
|
|
306
|
-
sourceNode: BaseNodeModel,
|
|
307
|
-
targetNode: BaseNodeModel,
|
|
308
|
-
sourceAnchorId?: string,
|
|
309
|
-
): Point | undefined {
|
|
310
|
-
// https://github.com/didi/LogicFlow/issues/1077
|
|
311
|
-
// 可能拿到的sourceAnchors为空数组,因此position可能返回为undefined
|
|
312
|
-
let position: Point | undefined
|
|
313
|
-
let minDistance: number | undefined
|
|
314
|
-
const sourceAnchors = getAnchors(sourceNode)
|
|
315
|
-
if (sourceAnchorId) {
|
|
316
|
-
position = find(sourceAnchors, (anchor) => anchor.id === sourceAnchorId)
|
|
317
|
-
// 如果指定了起始锚点,且指定锚点是节点拥有的锚点时,就把该点设置为起点
|
|
318
|
-
if (position) {
|
|
319
|
-
return position
|
|
320
|
-
}
|
|
321
|
-
console.warn(
|
|
322
|
-
`未在节点上找到指定的起点锚点${sourceAnchorId},已使用默认锚点作为起点`,
|
|
323
|
-
)
|
|
324
|
-
}
|
|
325
|
-
sourceAnchors.forEach((anchor) => {
|
|
326
|
-
const distance = twoPointDistance(anchor, targetNode)
|
|
327
|
-
if (minDistance === undefined) {
|
|
328
|
-
minDistance = distance
|
|
329
|
-
position = anchor
|
|
330
|
-
} else if (distance < minDistance) {
|
|
331
|
-
minDistance = distance
|
|
332
|
-
position = anchor
|
|
333
|
-
}
|
|
334
|
-
})
|
|
335
|
-
return position
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* 内部方法,计算两个节点相连时的终点位置
|
|
340
|
-
*/
|
|
341
|
-
getEndAnchor(
|
|
342
|
-
targetNode: BaseNodeModel,
|
|
343
|
-
targetAnchorId?: string,
|
|
344
|
-
): Point | undefined {
|
|
345
|
-
// https://github.com/didi/LogicFlow/issues/1077
|
|
346
|
-
// 可能拿到的targetAnchors为空数组,因此position可能返回为undefined
|
|
347
|
-
let position: Point | undefined
|
|
348
|
-
let minDistance: number | undefined
|
|
349
|
-
const targetAnchors = getAnchors(targetNode)
|
|
350
|
-
if (targetAnchorId) {
|
|
351
|
-
position = find(targetAnchors, (anchor) => anchor.id === targetAnchorId)
|
|
352
|
-
// 如果指定了终点锚点,且指定锚点是节点拥有的锚点时,就把该点设置为终点
|
|
353
|
-
if (position) {
|
|
354
|
-
return position
|
|
355
|
-
}
|
|
356
|
-
console.warn(
|
|
357
|
-
`未在节点上找到指定的终点锚点${targetAnchorId},已使用默认锚点作为终点`,
|
|
358
|
-
)
|
|
359
|
-
}
|
|
360
|
-
targetAnchors.forEach((anchor) => {
|
|
361
|
-
if (!this.startPoint) return // 如果此时 this.startPoint 为 undefined,直接返回
|
|
362
|
-
|
|
363
|
-
const distance = twoPointDistance(anchor, this.startPoint)
|
|
364
|
-
if (minDistance === undefined) {
|
|
365
|
-
minDistance = distance
|
|
366
|
-
position = anchor
|
|
367
|
-
} else if (distance < minDistance) {
|
|
368
|
-
minDistance = distance
|
|
369
|
-
position = anchor
|
|
370
|
-
}
|
|
371
|
-
})
|
|
372
|
-
return position
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* 获取当前边的properties
|
|
377
|
-
*/
|
|
378
|
-
getProperties() {
|
|
379
|
-
return toJS(this.properties)
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* 获取被保存时返回的数据
|
|
384
|
-
*
|
|
385
|
-
* @overridable 支持重写
|
|
386
|
-
*/
|
|
387
|
-
getData(): EdgeData {
|
|
388
|
-
let { properties } = this
|
|
389
|
-
if (isObservable(properties)) {
|
|
390
|
-
properties = toJS(properties)
|
|
391
|
-
}
|
|
392
|
-
const data: EdgeData = {
|
|
393
|
-
id: this.id,
|
|
394
|
-
type: this.type,
|
|
395
|
-
properties,
|
|
396
|
-
sourceNodeId: this.sourceNodeId,
|
|
397
|
-
targetNodeId: this.targetNodeId,
|
|
398
|
-
sourceAnchorId: this.sourceAnchorId,
|
|
399
|
-
targetAnchorId: this.targetAnchorId,
|
|
400
|
-
startPoint: assign({}, this.startPoint),
|
|
401
|
-
endPoint: assign({}, this.endPoint),
|
|
402
|
-
}
|
|
403
|
-
// 因为默认模式和边在上模式下,对节点的zIndex要求不高(因为渲染的时候会按照模式对所有元素进行排序)
|
|
404
|
-
// 所以只在递增模式和静态模式下设置zIndex
|
|
405
|
-
if (
|
|
406
|
-
[OverlapMode.INCREASE, OverlapMode.STATIC].includes(
|
|
407
|
-
this.graphModel.overlapMode,
|
|
408
|
-
)
|
|
409
|
-
) {
|
|
410
|
-
data.zIndex = this.zIndex
|
|
411
|
-
}
|
|
412
|
-
const { x, y, value } = this.text
|
|
413
|
-
if (value) {
|
|
414
|
-
data.text = {
|
|
415
|
-
x,
|
|
416
|
-
y,
|
|
417
|
-
value,
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
return data
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* 获取边的数据
|
|
425
|
-
*
|
|
426
|
-
* @overridable 支持重写
|
|
427
|
-
* 用于在历史记录时获取节点数据。
|
|
428
|
-
* 在某些情况下,如果希望某个属性变化不引起history的变化,
|
|
429
|
-
* 可以重写此方法。
|
|
430
|
-
*/
|
|
431
|
-
getHistoryData(): EdgeData {
|
|
432
|
-
return this.getData()
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* 设置边的属性,会触发重新渲染
|
|
437
|
-
* @param key 属性名
|
|
438
|
-
* @param val 属性值
|
|
439
|
-
*/
|
|
440
|
-
@action setProperty(key: string, val: any): void {
|
|
441
|
-
set(this.properties, key, formatData(val))
|
|
442
|
-
this.setAttributes()
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* 删除边的属性,会触发重新渲染
|
|
447
|
-
* @param key 属性名
|
|
448
|
-
*/
|
|
449
|
-
@action deleteProperty(key: string): void {
|
|
450
|
-
delete this.properties[key]
|
|
451
|
-
this.setAttributes()
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* 设置边的属性,会触发重新渲染
|
|
456
|
-
* @param properties 要更新的 properties,会做合并
|
|
457
|
-
*/
|
|
458
|
-
@action
|
|
459
|
-
setProperties(properties: Record<string, any>): void {
|
|
460
|
-
this.properties = {
|
|
461
|
-
...toJS(this.properties),
|
|
462
|
-
...formatData(properties),
|
|
463
|
-
}
|
|
464
|
-
this.setAttributes()
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* 修改边的id
|
|
469
|
-
*/
|
|
470
|
-
@action
|
|
471
|
-
changeEdgeId(id: string) {
|
|
472
|
-
const { markerEnd, markerStart } = this.arrowConfig
|
|
473
|
-
if (markerStart && markerStart === `url(#marker-start-${this.id})`) {
|
|
474
|
-
this.arrowConfig.markerStart = `url(#marker-start-${id})`
|
|
475
|
-
}
|
|
476
|
-
if (markerEnd && markerEnd === `url(#marker-end-${this.id})`) {
|
|
477
|
-
this.arrowConfig.markerEnd = `url(#marker-end-${id})`
|
|
478
|
-
}
|
|
479
|
-
this.id = id
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* 设置边样式,用于插件开发时跳过自定义边的渲染。大多数情况下,不需要使用此方法。
|
|
484
|
-
* 如果需要设置边的样式,请使用 getEdgeStyle 方法自定义边样式。
|
|
485
|
-
*/
|
|
486
|
-
@action
|
|
487
|
-
setStyle(key: string, val): void {
|
|
488
|
-
this.style = {
|
|
489
|
-
...this.style,
|
|
490
|
-
[key]: formatData(val),
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* 设置边样式,用于插件开发时跳过自定义边的渲染。大多数情况下,不需要使用此方法。
|
|
496
|
-
* 如果需要设置边的样式,请使用 getEdgeStyle 方法自定义边样式。
|
|
497
|
-
*/
|
|
498
|
-
@action
|
|
499
|
-
setStyles(styles): void {
|
|
500
|
-
this.style = {
|
|
501
|
-
...this.style,
|
|
502
|
-
...formatData(styles),
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* 设置边样式,用于插件开发时跳过自定义边的渲染。大多数情况下,不需要使用此方法。
|
|
508
|
-
* 如果需要设置边的样式,请使用 getEdgeStyle 方法自定义边样式。
|
|
509
|
-
*/
|
|
510
|
-
@action
|
|
511
|
-
updateStyles(styles): void {
|
|
512
|
-
this.style = {
|
|
513
|
-
...formatData(styles),
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* 设置当前元素的文本模式
|
|
519
|
-
* @param mode
|
|
520
|
-
*/
|
|
521
|
-
@action setTextMode(mode: TextMode) {
|
|
522
|
-
this.textMode = mode
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* 内部方法,处理初始化文本格式
|
|
527
|
-
*/
|
|
528
|
-
@action formatText(data: EdgeConfig) {
|
|
529
|
-
const {
|
|
530
|
-
editConfigModel: { edgeTextDraggable, edgeTextEdit },
|
|
531
|
-
} = this.graphModel
|
|
532
|
-
const { x, y } = this.textPosition
|
|
533
|
-
const { text } = data
|
|
534
|
-
let textConfig: Required<TextConfig> = {
|
|
535
|
-
value: '',
|
|
536
|
-
x,
|
|
537
|
-
y,
|
|
538
|
-
draggable: edgeTextDraggable,
|
|
539
|
-
editable: edgeTextEdit,
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
if (text) {
|
|
543
|
-
if (typeof text === 'string') {
|
|
544
|
-
textConfig = {
|
|
545
|
-
...textConfig,
|
|
546
|
-
value: text,
|
|
547
|
-
}
|
|
548
|
-
} else {
|
|
549
|
-
textConfig = {
|
|
550
|
-
...textConfig,
|
|
551
|
-
x: text.x ?? x,
|
|
552
|
-
y: text.y ?? y,
|
|
553
|
-
value: text.value ?? '',
|
|
554
|
-
}
|
|
555
|
-
if (!isUndefined(text.draggable)) {
|
|
556
|
-
textConfig.draggable = text.draggable
|
|
557
|
-
}
|
|
558
|
-
if (!isUndefined(text.editable)) {
|
|
559
|
-
textConfig.editable = text.editable
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
this.text = textConfig
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* 重置文本位置
|
|
567
|
-
*/
|
|
568
|
-
@action resetTextPosition() {
|
|
569
|
-
const { x, y } = this.textPosition
|
|
570
|
-
this.text.x = x
|
|
571
|
-
this.text.y = y
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* 移动边上的文本
|
|
576
|
-
*/
|
|
577
|
-
@action moveText(deltaX: number, deltaY: number): void {
|
|
578
|
-
const { x, y, value, draggable, editable } = this.text
|
|
579
|
-
this.text = {
|
|
580
|
-
value,
|
|
581
|
-
editable,
|
|
582
|
-
draggable,
|
|
583
|
-
x: x + deltaX,
|
|
584
|
-
y: y + deltaY,
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* 设置文本位置和值
|
|
590
|
-
*/
|
|
591
|
-
@action setText(textConfig: LogicFlow.TextConfig): void {
|
|
592
|
-
if (textConfig) {
|
|
593
|
-
assign(this.text, textConfig)
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* 更新文本的值
|
|
599
|
-
*/
|
|
600
|
-
@action updateText(value: string): void {
|
|
601
|
-
this.text = {
|
|
602
|
-
...toJS(this.text),
|
|
603
|
-
value,
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* 内部方法,计算边的起点和终点和其对于的锚点Id
|
|
609
|
-
*/
|
|
610
|
-
@action
|
|
611
|
-
setAnchors(): void {
|
|
612
|
-
if (!this.sourceAnchorId || !this.startPoint) {
|
|
613
|
-
const anchor = this.getBeginAnchor(
|
|
614
|
-
this.sourceNode,
|
|
615
|
-
this.targetNode,
|
|
616
|
-
this.sourceAnchorId,
|
|
617
|
-
)
|
|
618
|
-
if (!anchor) {
|
|
619
|
-
// https://github.com/didi/LogicFlow/issues/1077
|
|
620
|
-
// 当用户自定义getDefaultAnchor(){return []}时,表示:不显示锚点,也不允许其他节点连接到此节点
|
|
621
|
-
// 此时拿到的anchor=undefined,下面会直接报错
|
|
622
|
-
throw new Error(
|
|
623
|
-
'无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空',
|
|
624
|
-
)
|
|
625
|
-
}
|
|
626
|
-
if (!this.startPoint) {
|
|
627
|
-
this.startPoint = {
|
|
628
|
-
x: anchor.x,
|
|
629
|
-
y: anchor.y,
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (!this.sourceAnchorId) {
|
|
633
|
-
this.sourceAnchorId = anchor.id
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
if (!this.targetAnchorId || !this.endPoint) {
|
|
637
|
-
const anchor = this.getEndAnchor(this.targetNode, this.targetAnchorId)
|
|
638
|
-
if (!anchor) {
|
|
639
|
-
// https://github.com/didi/LogicFlow/issues/1077
|
|
640
|
-
// 当用户自定义getDefaultAnchor(){return []}时,表示:不显示锚点,也不允许其他节点连接到此节点
|
|
641
|
-
// 此时拿到的anchor=undefined,下面会直接报错
|
|
642
|
-
throw new Error(
|
|
643
|
-
'无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空',
|
|
644
|
-
)
|
|
645
|
-
}
|
|
646
|
-
if (!this.endPoint) {
|
|
647
|
-
this.endPoint = {
|
|
648
|
-
x: anchor.x,
|
|
649
|
-
y: anchor.y,
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
if (!this.targetAnchorId) {
|
|
653
|
-
this.targetAnchorId = anchor.id
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
@action
|
|
659
|
-
setSelected(flag = true): void {
|
|
660
|
-
this.isSelected = flag
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
@action
|
|
664
|
-
setHovered(flag = true): void {
|
|
665
|
-
this.isHovered = flag
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
@action
|
|
669
|
-
setHitable(flag = true): void {
|
|
670
|
-
this.isHitable = flag
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
@action
|
|
674
|
-
setHittable(flag = true): void {
|
|
675
|
-
this.isHittable = flag
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
@action
|
|
679
|
-
openEdgeAnimation(): void {
|
|
680
|
-
this.isAnimation = true
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
@action
|
|
684
|
-
closeEdgeAnimation(): void {
|
|
685
|
-
this.isAnimation = false
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
@action
|
|
689
|
-
setElementState(
|
|
690
|
-
state: ElementState,
|
|
691
|
-
additionStateData?: Model.AdditionStateDataType,
|
|
692
|
-
): void {
|
|
693
|
-
this.state = state
|
|
694
|
-
this.additionStateData = additionStateData
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
@action
|
|
698
|
-
updateStartPoint(anchor: Point): void {
|
|
699
|
-
this.startPoint = anchor
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
@action
|
|
703
|
-
moveStartPoint(deltaX: number, deltaY: number): void {
|
|
704
|
-
if (this.startPoint) {
|
|
705
|
-
this.startPoint.x += deltaX
|
|
706
|
-
this.startPoint.y += deltaY
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
@action
|
|
711
|
-
updateEndPoint(anchor: Point): void {
|
|
712
|
-
this.endPoint = anchor
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
@action
|
|
716
|
-
moveEndPoint(deltaX: number, deltaY: number): void {
|
|
717
|
-
if (this.endPoint) {
|
|
718
|
-
this.endPoint.x += deltaX
|
|
719
|
-
this.endPoint.y += deltaY
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
@action
|
|
724
|
-
setZIndex(zIndex = 0): void {
|
|
725
|
-
this.zIndex = zIndex
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
@action
|
|
729
|
-
initPoints() {}
|
|
730
|
-
|
|
731
|
-
@action
|
|
732
|
-
updateAttributes(attributes) {
|
|
733
|
-
assign(this, attributes)
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// 获取边调整的起点
|
|
737
|
-
@action
|
|
738
|
-
getAdjustStart() {
|
|
739
|
-
return this.startPoint
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// 获取边调整的终点
|
|
743
|
-
@action
|
|
744
|
-
getAdjustEnd() {
|
|
745
|
-
return this.endPoint
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
// 起终点拖拽调整过程中,进行直线路径更新
|
|
749
|
-
@action
|
|
750
|
-
updateAfterAdjustStartAndEnd({
|
|
751
|
-
startPoint,
|
|
752
|
-
endPoint,
|
|
753
|
-
}: Record<'startPoint' | 'endPoint', Point>) {
|
|
754
|
-
this.updateStartPoint({ x: startPoint.x, y: startPoint.y })
|
|
755
|
-
this.updateEndPoint({ x: endPoint.x, y: endPoint.y })
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
// 堆叠模式变化时,更新zIndex
|
|
759
|
-
@action
|
|
760
|
-
updateZIndexByOverlap(overlapMode: OverlapMode, defaultZIndex) {
|
|
761
|
-
switch (overlapMode) {
|
|
762
|
-
case OverlapMode.DEFAULT:
|
|
763
|
-
this.zIndex = 0
|
|
764
|
-
break
|
|
765
|
-
case OverlapMode.EDGE_TOP:
|
|
766
|
-
this.zIndex = 1
|
|
767
|
-
break
|
|
768
|
-
case OverlapMode.INCREASE:
|
|
769
|
-
this.zIndex = defaultZIndex
|
|
770
|
-
break
|
|
771
|
-
default:
|
|
772
|
-
break
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
export default BaseEdgeModel
|