-
-
Notifications
You must be signed in to change notification settings - Fork 209
/
SmoothStepEdge.ts
48 lines (43 loc) 路 968 Bytes
/
SmoothStepEdge.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import type { FunctionalComponent } from 'vue'
import BaseEdge from './BaseEdge'
import type { SmoothStepEdgeProps } from '~/types'
import { Position } from '~/types'
const SmoothStepEdge: FunctionalComponent<SmoothStepEdgeProps> = function (
{ sourcePosition = Position.Bottom, targetPosition = Position.Top, ...props },
{ attrs },
) {
const [path, labelX, labelY] = getSmoothStepPath({
sourcePosition,
targetPosition,
...props,
})
return h(BaseEdge, {
path,
labelX,
labelY,
...props,
...attrs,
})
}
SmoothStepEdge.props = [
'sourcePosition',
'targetPosition',
'label',
'labelStyle',
'labelShowBg',
'labelBgStyle',
'labelBgPadding',
'labelBgBorderRadius',
'sourceY',
'sourceX',
'targetX',
'targetY',
'borderRadius',
'markerEnd',
'markerStart',
'interactionWidth',
'offset',
]
SmoothStepEdge.inheritAttrs = false
SmoothStepEdge.compatConfig = { MODE: 3 }
export default SmoothStepEdge