@logicflow/core 2.2.0-alpha.7 → 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.
Files changed (137) hide show
  1. package/package.json +6 -1
  2. package/.turbo/turbo-build$colon$dev.log +0 -10
  3. package/.turbo/turbo-build.log +0 -33
  4. package/CHANGELOG.md +0 -1901
  5. package/__tests__/algorithm/egde.test.ts +0 -131
  6. package/__tests__/algorithm/index.test.ts +0 -74
  7. package/__tests__/algorithm/outline.test.ts +0 -43
  8. package/__tests__/bugs/1545-spec.test.ts +0 -42
  9. package/__tests__/event/event.test.ts +0 -22
  10. package/__tests__/history/history.test.ts +0 -28
  11. package/__tests__/logicflow.test.ts +0 -575
  12. package/__tests__/model/graphmodel.test.ts +0 -87
  13. package/__tests__/util/compatible.test.ts +0 -48
  14. package/__tests__/util/edge.test.ts +0 -224
  15. package/__tests__/util/geometry.test.ts +0 -14
  16. package/__tests__/util/graph.test.ts +0 -16
  17. package/__tests__/util/matrix.test.ts +0 -41
  18. package/__tests__/util/node.test.ts +0 -68
  19. package/__tests__/util/sampling.test.ts +0 -12
  20. package/__tests__/util/vector.test.ts +0 -50
  21. package/__tests__/util/zIndex.test.ts +0 -10
  22. package/src/LogicFlow.tsx +0 -2017
  23. package/src/algorithm/edge.ts +0 -67
  24. package/src/algorithm/index.ts +0 -70
  25. package/src/algorithm/outline.ts +0 -77
  26. package/src/algorithm/rotate.ts +0 -55
  27. package/src/common/drag.ts +0 -219
  28. package/src/common/history.ts +0 -108
  29. package/src/common/index.ts +0 -6
  30. package/src/common/keyboard.ts +0 -108
  31. package/src/common/matrix.ts +0 -122
  32. package/src/common/vector.ts +0 -93
  33. package/src/constant/index.ts +0 -179
  34. package/src/constant/theme.ts +0 -708
  35. package/src/event/event.md +0 -66
  36. package/src/event/eventArgs.ts +0 -643
  37. package/src/event/eventEmitter.ts +0 -156
  38. package/src/history/index.ts +0 -119
  39. package/src/index.less +0 -1
  40. package/src/index.ts +0 -26
  41. package/src/keyboard/index.ts +0 -112
  42. package/src/keyboard/shortcut.ts +0 -200
  43. package/src/model/BaseModel.ts +0 -250
  44. package/src/model/EditConfigModel.ts +0 -334
  45. package/src/model/GraphModel.ts +0 -1824
  46. package/src/model/NestedTransformModel.ts +0 -121
  47. package/src/model/SnaplineModel.ts +0 -256
  48. package/src/model/TransformModel.ts +0 -258
  49. package/src/model/edge/BaseEdgeModel.ts +0 -785
  50. package/src/model/edge/BezierEdgeModel.ts +0 -197
  51. package/src/model/edge/LineEdgeModel.ts +0 -36
  52. package/src/model/edge/PolylineEdgeModel.ts +0 -817
  53. package/src/model/edge/index.ts +0 -4
  54. package/src/model/index.ts +0 -9
  55. package/src/model/node/BaseNodeModel.ts +0 -959
  56. package/src/model/node/CircleNodeModel.ts +0 -91
  57. package/src/model/node/DiamondNodeModel.ts +0 -132
  58. package/src/model/node/EllipseNodeModel.ts +0 -98
  59. package/src/model/node/HtmlNodeModel.ts +0 -64
  60. package/src/model/node/PolygonNodeModel.ts +0 -152
  61. package/src/model/node/RectNodeModel.ts +0 -69
  62. package/src/model/node/TextNodeModel.ts +0 -54
  63. package/src/model/node/index.ts +0 -8
  64. package/src/options.ts +0 -150
  65. package/src/style/index.less +0 -262
  66. package/src/style/raw.ts +0 -221
  67. package/src/tool/MultipleSelectTool.tsx +0 -140
  68. package/src/tool/TextEditTool.tsx +0 -193
  69. package/src/tool/index.ts +0 -101
  70. package/src/typings.d.ts +0 -5
  71. package/src/util/animation.ts +0 -29
  72. package/src/util/browser.ts +0 -4
  73. package/src/util/compatible.ts +0 -15
  74. package/src/util/drag.ts +0 -219
  75. package/src/util/edge.ts +0 -1094
  76. package/src/util/geometry.ts +0 -154
  77. package/src/util/graph.ts +0 -46
  78. package/src/util/index.ts +0 -17
  79. package/src/util/matrix.ts +0 -129
  80. package/src/util/mobx.ts +0 -23
  81. package/src/util/node.ts +0 -543
  82. package/src/util/raf.ts +0 -28
  83. package/src/util/resize.ts +0 -606
  84. package/src/util/sampling.ts +0 -85
  85. package/src/util/theme.ts +0 -84
  86. package/src/util/uuid.ts +0 -26
  87. package/src/util/vector.ts +0 -93
  88. package/src/util/zIndex.ts +0 -6
  89. package/src/view/Anchor.tsx +0 -462
  90. package/src/view/Control.tsx +0 -510
  91. package/src/view/Graph.tsx +0 -141
  92. package/src/view/Rotate.tsx +0 -113
  93. package/src/view/behavior/dnd.ts +0 -162
  94. package/src/view/behavior/index.ts +0 -2
  95. package/src/view/behavior/snapline.ts +0 -16
  96. package/src/view/edge/AdjustPoint.tsx +0 -425
  97. package/src/view/edge/Arrow.tsx +0 -54
  98. package/src/view/edge/BaseEdge.tsx +0 -660
  99. package/src/view/edge/BezierEdge.tsx +0 -101
  100. package/src/view/edge/LineEdge.tsx +0 -81
  101. package/src/view/edge/PolylineEdge.tsx +0 -311
  102. package/src/view/edge/index.ts +0 -6
  103. package/src/view/index.ts +0 -8
  104. package/src/view/node/BaseNode.tsx +0 -585
  105. package/src/view/node/CircleNode.tsx +0 -21
  106. package/src/view/node/DiamondNode.tsx +0 -24
  107. package/src/view/node/EllipseNode.tsx +0 -22
  108. package/src/view/node/HtmlNode.tsx +0 -112
  109. package/src/view/node/PolygonNode.tsx +0 -28
  110. package/src/view/node/RectNode.tsx +0 -30
  111. package/src/view/node/TextNode.tsx +0 -39
  112. package/src/view/node/index.ts +0 -8
  113. package/src/view/overlay/BackgroundOverlay.tsx +0 -34
  114. package/src/view/overlay/BezierAdjustOverlay.tsx +0 -150
  115. package/src/view/overlay/CanvasOverlay.tsx +0 -290
  116. package/src/view/overlay/Grid.tsx +0 -319
  117. package/src/view/overlay/ModificationOverlay.tsx +0 -31
  118. package/src/view/overlay/OutlineOverlay.tsx +0 -158
  119. package/src/view/overlay/SnaplineOverlay.tsx +0 -44
  120. package/src/view/overlay/ToolOverlay.tsx +0 -65
  121. package/src/view/overlay/getTransformHoc.tsx +0 -50
  122. package/src/view/overlay/gridConfig.ts +0 -103
  123. package/src/view/overlay/index.ts +0 -8
  124. package/src/view/shape/Circle.tsx +0 -41
  125. package/src/view/shape/Ellipse.tsx +0 -42
  126. package/src/view/shape/Line.tsx +0 -39
  127. package/src/view/shape/Path.tsx +0 -22
  128. package/src/view/shape/Polygon.tsx +0 -54
  129. package/src/view/shape/Polyline.tsx +0 -31
  130. package/src/view/shape/Rect.tsx +0 -44
  131. package/src/view/shape/Text.tsx +0 -168
  132. package/src/view/shape/index.ts +0 -8
  133. package/src/view/text/BaseText.tsx +0 -134
  134. package/src/view/text/LineText.tsx +0 -168
  135. package/src/view/text/index.ts +0 -2
  136. package/stats.html +0 -4842
  137. package/tsconfig.json +0 -18
@@ -1,101 +0,0 @@
1
- import BaseEdge, { IEdgeState } from './BaseEdge'
2
- import { Path } from '../shape'
3
- import LogicFlow from '../../LogicFlow'
4
- import { getEndTangent } from '../../util'
5
- import { BezierEdgeModel, GraphModel } from '../../model'
6
-
7
- import Point = LogicFlow.Point
8
-
9
- import ArrowInfo = LogicFlow.ArrowInfo
10
-
11
- export type IBezierEdgeProps = {
12
- model: BezierEdgeModel
13
- graphModel: GraphModel
14
- }
15
-
16
- export class BezierEdge extends BaseEdge<IBezierEdgeProps> {
17
- /**
18
- * @overridable 支持重写, 此方法为获取边的形状,如果需要自定义边的形状,请重写此方法。
19
- * @example https://docs.logic-flow.cn/docs/#/zh/guide/basic/edge?id=%e5%9f%ba%e4%ba%8e-react-%e7%bb%84%e4%bb%b6%e8%87%aa%e5%ae%9a%e4%b9%89%e8%be%b9
20
- */
21
- getEdge() {
22
- const { model } = this.props
23
- const style = model.getEdgeStyle()
24
- const { path, isAnimation, arrowConfig } = model as BezierEdgeModel
25
- const animationStyle = model.getEdgeAnimationStyle()
26
- const {
27
- strokeDasharray,
28
- stroke,
29
- strokeDashoffset,
30
- animationName,
31
- animationDuration,
32
- animationIterationCount,
33
- animationTimingFunction,
34
- animationDirection,
35
- } = animationStyle
36
-
37
- return (
38
- <Path
39
- d={path}
40
- {...style}
41
- {...arrowConfig}
42
- {...(isAnimation
43
- ? {
44
- strokeDasharray,
45
- stroke,
46
- style: {
47
- strokeDashoffset,
48
- animationName,
49
- animationDuration,
50
- animationIterationCount,
51
- animationTimingFunction,
52
- animationDirection,
53
- },
54
- }
55
- : {})}
56
- />
57
- )
58
- }
59
-
60
- /**
61
- * @overridable 可重写,在完全自定义边的时候,可以重写此方法,来自定义边的选区。
62
- */
63
- getAppendWidth() {
64
- const { path } = this.props.model as BezierEdgeModel
65
- return <Path d={path} strokeWidth={10} stroke="transparent" fill="none" />
66
- }
67
-
68
- /**
69
- * @deprecated
70
- */
71
- getArrowInfo(): ArrowInfo {
72
- const { model } = this.props
73
- const { hover } = this.state as IEdgeState
74
- const { isSelected } = model as BezierEdgeModel
75
- const { offset } = model.getArrowStyle()
76
- const points = model.pointsList.map((point) => ({
77
- x: point.x,
78
- y: point.y,
79
- }))
80
- const [ePre, end] = getEndTangent(points, offset)
81
- const arrowInfo = {
82
- start: ePre,
83
- end,
84
- hover,
85
- isSelected,
86
- }
87
- return arrowInfo
88
- }
89
-
90
- getLastTwoPoints(): [Point, Point] {
91
- const { model } = this.props
92
- const { offset } = model.getArrowStyle()
93
- const points = model.pointsList.map((point) => ({
94
- x: point.x,
95
- y: point.y,
96
- }))
97
- return getEndTangent(points, offset)
98
- }
99
- }
100
-
101
- export default BezierEdge
@@ -1,81 +0,0 @@
1
- import BaseEdge from './BaseEdge'
2
- import { Line, Path } from '../shape'
3
- import { getAppendAttributes } from '../../util'
4
- import { GraphModel, LineEdgeModel } from '../../model'
5
-
6
- export type ILineEdgeProps = {
7
- model: LineEdgeModel
8
- graphModel: GraphModel
9
- }
10
-
11
- export class LineEdge extends BaseEdge<ILineEdgeProps> {
12
- /**
13
- * @overridable 支持重写, 此方法为获取边的形状,如果需要自定义边的形状,请重写此方法。
14
- * @example https://docs.logic-flow.cn/docs/#/zh/guide/basic/edge?id=%e5%9f%ba%e4%ba%8e-react-%e7%bb%84%e4%bb%b6%e8%87%aa%e5%ae%9a%e4%b9%89%e8%be%b9
15
- */
16
- getEdge() {
17
- const { model } = this.props
18
- const { startPoint, endPoint, isAnimation, arrowConfig } = model
19
- const style = model.getEdgeStyle()
20
- const animationStyle = model.getEdgeAnimationStyle()
21
- const {
22
- strokeDasharray,
23
- stroke,
24
- strokeDashoffset,
25
- animationName,
26
- animationDuration,
27
- animationIterationCount,
28
- animationTimingFunction,
29
- animationDirection,
30
- } = animationStyle
31
- return (
32
- <Line
33
- {...style}
34
- x1={startPoint.x}
35
- y1={startPoint.y}
36
- x2={endPoint.x}
37
- y2={endPoint.y}
38
- {...arrowConfig}
39
- {...(isAnimation
40
- ? {
41
- strokeDasharray,
42
- stroke,
43
- style: {
44
- strokeDashoffset,
45
- animationName,
46
- animationDuration,
47
- animationIterationCount,
48
- animationTimingFunction,
49
- animationDirection,
50
- },
51
- }
52
- : {})}
53
- />
54
- )
55
- }
56
-
57
- /**
58
- * @overridable 可重写,在完全自定义边的时候,可以重写此方法,来自定义边的选区。
59
- */
60
- getAppendWidth() {
61
- const { model } = this.props
62
- const { startPoint, endPoint } = model
63
- const appendInfo = {
64
- start: startPoint,
65
- end: endPoint,
66
- }
67
- const { d, strokeWidth, fill, strokeDasharray, stroke } =
68
- getAppendAttributes(appendInfo)
69
- return (
70
- <Path
71
- d={d}
72
- fill={fill}
73
- strokeWidth={strokeWidth}
74
- stroke={stroke}
75
- strokeDasharray={strokeDasharray}
76
- />
77
- )
78
- }
79
- }
80
-
81
- export default LineEdge
@@ -1,311 +0,0 @@
1
- import { createElement as h } from 'preact/compat'
2
- import BaseEdge, { IEdgeState } from './BaseEdge'
3
- import { Polyline, Path } from '../shape'
4
- import LogicFlow from '../../LogicFlow'
5
- import { GraphModel, PolylineEdgeModel } from '../../model'
6
- import { EventType, SegmentDirection } from '../../constant'
7
- import { StepDrag, points2PointsList } from '../../util'
8
- import { generateRoundedCorners } from '../../util/geometry'
9
- import { getVerticalPointOfLine } from '../../algorithm'
10
-
11
- import ArrowInfo = LogicFlow.ArrowInfo
12
- import AppendConfig = LogicFlow.AppendConfig
13
- import Point = LogicFlow.Point
14
-
15
- type AppendAttributesType = {
16
- d: string
17
- fill: string
18
- stroke: string
19
- strokeWidth: number
20
- strokeDasharray: string
21
- }
22
-
23
- export type IPolylineEdgeProps = {
24
- model: PolylineEdgeModel
25
- graphModel: GraphModel
26
- }
27
-
28
- export class PolylineEdge extends BaseEdge<IPolylineEdgeProps> {
29
- drag: StepDrag
30
- isDragging?: boolean
31
- isShowAdjustPointTemp?: boolean
32
- appendInfo?: AppendConfig
33
-
34
- constructor() {
35
- super()
36
- this.drag = new StepDrag({
37
- onDragStart: this.onDragStart,
38
- onDragging: this.onDragging,
39
- onDragEnd: this.onDragEnd,
40
- isStopPropagation: false,
41
- })
42
- }
43
-
44
- /**
45
- * 不支持重写
46
- */
47
- onDragStart = () => {
48
- const polylineModel = this.props.model as PolylineEdgeModel
49
- polylineModel.dragAppendStart()
50
- this.isShowAdjustPointTemp = polylineModel.isShowAdjustPoint
51
- polylineModel.isShowAdjustPoint = false
52
- }
53
- /**
54
- * 不支持重写
55
- */
56
- onDragging = ({ deltaX, deltaY }) => {
57
- const { model, graphModel } = this.props
58
- this.isDragging = true
59
- const { transformModel, editConfigModel } = graphModel
60
- const [curDeltaX, curDeltaY] = transformModel.fixDeltaXY(deltaX, deltaY)
61
- const polylineModel = model as PolylineEdgeModel
62
- // 更新当前拖拽的线段信息
63
- // 1、如果只允许调整中间线段调用dragAppendSimple
64
- // 2、如果允许调整所有线段调用dragAppend
65
- const { adjustEdgeMiddle } = editConfigModel
66
- if (adjustEdgeMiddle) {
67
- this.appendInfo = polylineModel.dragAppendSimple(this.appendInfo!, {
68
- x: curDeltaX,
69
- y: curDeltaY,
70
- })
71
- } else {
72
- this.appendInfo = polylineModel.dragAppend(this.appendInfo!, {
73
- x: curDeltaX,
74
- y: curDeltaY,
75
- })
76
- }
77
- }
78
- /**
79
- * 不支持重写
80
- */
81
- onDragEnd = () => {
82
- const {
83
- model,
84
- graphModel: { eventCenter },
85
- } = this.props
86
- const polylineModel = model as PolylineEdgeModel
87
- polylineModel.dragAppendEnd()
88
- this.isDragging = false
89
-
90
- polylineModel.isShowAdjustPoint = this.isShowAdjustPointTemp ?? false
91
- // 情况当前拖拽的线段信息
92
- this.appendInfo = undefined
93
- // 向外抛出事件
94
- eventCenter.emit(EventType.EDGE_ADJUST, { data: polylineModel.getData() })
95
- }
96
- /**
97
- * 不支持重写
98
- */
99
- beforeDragStart = (e: PointerEvent, appendInfo) => {
100
- // 如果允许拖拽调整触发事件处理
101
- if (appendInfo.draggable) {
102
- this.drag.handleMouseDown(e)
103
- }
104
- // 记录当前拖拽的线段信息
105
- this.appendInfo = appendInfo
106
- }
107
-
108
- /**
109
- * @overridable 支持重写, 此方法为获取边的形状,如果需要自定义边的形状,请重写此方法。
110
- * @example https://docs.logic-flow.cn/docs/#/zh/guide/basic/edge?id=%e5%9f%ba%e4%ba%8e-react-%e7%bb%84%e4%bb%b6%e8%87%aa%e5%ae%9a%e4%b9%89%e8%be%b9
111
- */
112
- getEdge() {
113
- const { model } = this.props
114
- const { points, isAnimation, arrowConfig, properties } = model
115
- const style = model.getEdgeStyle()
116
- const animationStyle = model.getEdgeAnimationStyle()
117
- const {
118
- strokeDasharray,
119
- stroke,
120
- strokeDashoffset,
121
- animationName,
122
- animationDuration,
123
- animationIterationCount,
124
- animationTimingFunction,
125
- animationDirection,
126
- } = animationStyle
127
- // 应用通用圆角:当存在样式半径时,为折线拐点生成圆角
128
- const radius: number = (properties?.radius ??
129
- (style as any)?.radius ??
130
- 0) as number
131
- const roundedPointsStr = (() => {
132
- if (!radius || radius <= 0) return points
133
- const list = points2PointsList(points)
134
- const rounded = generateRoundedCorners(list, radius, false)
135
- return rounded.map((p) => `${p.x},${p.y}`).join(' ')
136
- })()
137
-
138
- return (
139
- <Polyline
140
- points={roundedPointsStr}
141
- {...style}
142
- {...arrowConfig}
143
- {...(isAnimation
144
- ? {
145
- strokeDasharray,
146
- stroke,
147
- style: {
148
- strokeDashoffset,
149
- animationName,
150
- animationDuration,
151
- animationIterationCount,
152
- animationTimingFunction,
153
- animationDirection,
154
- },
155
- }
156
- : {})}
157
- />
158
- )
159
- }
160
-
161
- /**
162
- * @deprecated
163
- */
164
- getArrowInfo(): ArrowInfo {
165
- const { model } = this.props
166
- const { points, isSelected } = model
167
- const { hover } = this.state as IEdgeState
168
- const currentPositionList = points2PointsList(points)
169
- let startPoint: LogicFlow.Point = currentPositionList[0]
170
- let endPoint: LogicFlow.Point = currentPositionList[0]
171
-
172
- // 两点重合时不计算起终点
173
- if (currentPositionList.length >= 2) {
174
- startPoint = currentPositionList[currentPositionList.length - 2]
175
- endPoint = currentPositionList[currentPositionList.length - 1]
176
- }
177
- return {
178
- start: startPoint,
179
- end: endPoint,
180
- hover,
181
- isSelected,
182
- }
183
- }
184
-
185
- getLastTwoPoints(): [Point, Point] {
186
- const { model } = this.props
187
- const { points } = model
188
- const currentPositionList = points2PointsList(points)
189
- let startPoint: LogicFlow.Point = currentPositionList[0]
190
- let endPoint: LogicFlow.Point = currentPositionList[0]
191
- // 两点重合时不计算起终点
192
- if (currentPositionList.length >= 2) {
193
- startPoint = currentPositionList[currentPositionList.length - 2]
194
- endPoint = currentPositionList[currentPositionList.length - 1]
195
- }
196
- return [startPoint, endPoint]
197
- }
198
-
199
- private getAppendAttributes(appendInfo: AppendConfig): AppendAttributesType {
200
- const { start, end } = appendInfo
201
- let d
202
- if (start.x === end.x && start.y === end.y) {
203
- // 拖拽过程中会出现起终点重合的情况,这时候append无法计算
204
- d = ''
205
- } else {
206
- const config = {
207
- start,
208
- end,
209
- offset: 10,
210
- verticalLength: 5,
211
- }
212
- const startPosition = getVerticalPointOfLine({
213
- ...config,
214
- type: 'start',
215
- })
216
- const endPosition = getVerticalPointOfLine({
217
- ...config,
218
- type: 'end',
219
- })
220
- d = `M${startPosition.leftX} ${startPosition.leftY}
221
- L${startPosition.rightX} ${startPosition.rightY}
222
- L${endPosition.rightX} ${endPosition.rightY}
223
- L${endPosition.leftX} ${endPosition.leftY} z`
224
- }
225
- return {
226
- d,
227
- fill: 'transparent',
228
- stroke: 'transparent',
229
- strokeWidth: 1,
230
- strokeDasharray: '4, 4',
231
- }
232
- }
233
-
234
- private getAppendShape(appendInfo: AppendConfig) {
235
- const { d, strokeWidth, fill, strokeDasharray, stroke } =
236
- this.getAppendAttributes(appendInfo)
237
- return (
238
- <Path
239
- d={d}
240
- fill={fill}
241
- strokeWidth={strokeWidth}
242
- stroke={stroke}
243
- strokeDasharray={strokeDasharray}
244
- />
245
- )
246
- }
247
-
248
- /**
249
- * @overridable 可重写,在完全自定义边的时候,可以重写此方法,来自定义边的选区。
250
- */
251
- getAppendWidth() {
252
- const { model, graphModel } = this.props
253
- const { pointsList, draggable } = model
254
- const LineAppendList: h.JSX.Element[] = []
255
- const pointsLen = pointsList.length
256
- for (let i = 0; i < pointsLen - 1; i++) {
257
- let className = 'lf-polyline-append'
258
- const appendInfo: AppendConfig = {
259
- start: {
260
- x: pointsList[i].x,
261
- y: pointsList[i].y,
262
- },
263
- end: {
264
- x: pointsList[i + 1].x,
265
- y: pointsList[i + 1].y,
266
- },
267
- startIndex: i,
268
- endIndex: i + 1,
269
- direction: SegmentDirection.HORIZONTAL,
270
- draggable: true,
271
- }
272
- let append: h.JSX.Element = (
273
- <g className={className}>{this.getAppendShape(appendInfo)}</g>
274
- )
275
- const { editConfigModel } = graphModel
276
- const { adjustEdge, adjustEdgeMiddle } = editConfigModel
277
- if (adjustEdge && draggable) {
278
- const { startIndex, endIndex } = appendInfo
279
- // 如果不允许调整起点和终点相连的线段,设置该线段appendInfo的dragAble为false
280
- const dragDisable =
281
- adjustEdgeMiddle && (startIndex === 0 || endIndex === pointsLen - 1)
282
- appendInfo.draggable = !dragDisable
283
- if (appendInfo.start.x === appendInfo.end.x) {
284
- // 水平
285
- if (appendInfo.draggable) {
286
- className += '-ew-resize'
287
- }
288
- appendInfo.direction = SegmentDirection.VERTICAL
289
- } else if (appendInfo.start.y === appendInfo.end.y) {
290
- // 垂直
291
- if (appendInfo.draggable) {
292
- className += '-ns-resize'
293
- }
294
- appendInfo.direction = SegmentDirection.HORIZONTAL
295
- }
296
- append = (
297
- <g
298
- className={this.isDragging ? 'lf-dragging' : 'lf-drag-able'}
299
- onPointerDown={(e) => this.beforeDragStart(e, appendInfo)}
300
- >
301
- <g className={className}>{this.getAppendShape(appendInfo)}</g>
302
- </g>
303
- )
304
- }
305
- LineAppendList.push(append)
306
- }
307
- return <g>{LineAppendList}</g>
308
- }
309
- }
310
-
311
- export default PolylineEdge
@@ -1,6 +0,0 @@
1
- export * from './AdjustPoint'
2
- export * from './Arrow'
3
- export * from './BaseEdge'
4
- export * from './BezierEdge'
5
- export * from './LineEdge'
6
- export * from './PolylineEdge'
package/src/view/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './Anchor'
2
- export * from './Rotate'
3
- export * from './Graph'
4
-
5
- export * from './shape'
6
- export * from './node'
7
- export * from './edge'
8
- export * from './text'