diff --git a/src/components/Edges/BezierEdge.vue b/src/components/Edges/BezierEdge.vue
index 29f4c585..1bb2ace4 100644
--- a/src/components/Edges/BezierEdge.vue
+++ b/src/components/Edges/BezierEdge.vue
@@ -1,37 +1,14 @@
-
+
-import { CSSProperties } from 'vue'
-import { ArrowHeadType, EdgeProps, EdgeTextProps, Position } from '../../types'
-import EdgeText from './EdgeText.vue'
+import { Position } from '../../types'
+import type { SmoothStepEdgeProps } from '../../types/edge'
import { getCenter, getMarkerEnd, getSmoothStepPath } from './utils'
-
-interface SmoothStepEdgeProps extends EdgeProps {
- id: string
- source: string
- target: string
- sourceX: number
- sourceY: number
- targetX: number
- targetY: number
- selected?: boolean
- animated?: boolean
- sourcePosition: Position
- targetPosition: Position
- label?: string
- labelStyle?: CSSProperties
- labelShowBg?: boolean
- labelBgStyle?: CSSProperties
- labelBgPadding?: [number, number]
- labelBgBorderRadius?: number
- arrowHeadType?: ArrowHeadType
- markerEndId?: string
- borderRadius?: number
- sourceHandleId?: string
- targetHandleId?: string
-}
+import EdgeText from './EdgeText.vue'
const props = withDefaults(defineProps(), {
selected: false,
- sourcePosition: Position.Bottom,
- targetPosition: Position.Top,
+ sourcePosition: 'bottom' as Position,
+ targetPosition: 'top' as Position,
label: '',
labelStyle: () => ({}),
labelShowBg: true,
@@ -54,8 +29,6 @@ const path = computed(() => {
})
const markerEnd = computed(() => getMarkerEnd(props.arrowHeadType, props.markerEndId))
-
-const attrs = useAttrs() as Record<'style', CSSProperties>
-
-
+
+
-import { CSSProperties } from 'vue'
-import { ArrowHeadType, EdgeProps, Position } from '../../types'
+import { Position } from '../../types'
+import type { EdgeProps } from '../../types/edge'
import SmoothStepEdge from './SmoothStepEdge.vue'
-interface StepEdgeProps extends EdgeProps {
- id: string
- source: string
- target: string
- sourceX: number
- sourceY: number
- targetX: number
- targetY: number
- selected?: boolean
- animated?: boolean
- sourcePosition: Position
- targetPosition: Position
- label?: string
- labelStyle?: CSSProperties
- labelShowBg?: boolean
- labelBgStyle?: CSSProperties
- labelBgPadding?: [number, number]
- labelBgBorderRadius?: number
- arrowHeadType?: ArrowHeadType
- markerEndId?: string
- sourceHandleId?: string
- targetHandleId?: string
-}
-
-const props = withDefaults(defineProps(), {
+const props = withDefaults(defineProps(), {
selected: false,
- sourcePosition: Position.Bottom,
- targetPosition: Position.Top,
+ sourcePosition: 'bottom' as Position,
+ targetPosition: 'top' as Position,
label: '',
labelStyle: () => ({}),
labelShowBg: true,
labelBgStyle: () => ({}),
})
-const attrs = useAttrs() as Record<'style', CSSProperties>
-
+
diff --git a/src/components/Edges/StraightEdge.vue b/src/components/Edges/StraightEdge.vue
index c13748ea..80eb8ba1 100644
--- a/src/components/Edges/StraightEdge.vue
+++ b/src/components/Edges/StraightEdge.vue
@@ -1,37 +1,13 @@
-
-
+
+