refactor(core,edges): make label coords optional

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-19 16:17:50 +01:00
committed by Braks
parent 952525e18c
commit 31cdd9f899
2 changed files with 4 additions and 3 deletions
@@ -1,3 +1,4 @@
import { isNumber } from '@vueuse/core'
import type { FunctionalComponent } from 'vue'
import EdgeText from './EdgeText.vue'
import type { BaseEdgeProps } from '~/types'
@@ -39,7 +40,7 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function (
'stroke-width': interactionWidth,
})
: null,
label
label && isNumber(labelX) && isNumber(labelY)
? h(EdgeText, {
x: labelX,
y: labelY,
+2 -2
View File
@@ -156,8 +156,8 @@ export interface SmoothStepEdgeProps<Data = ElementData, CustomEvents = {}> exte
}
export interface BaseEdgeProps {
labelX: number
labelY: number
labelX?: number
labelY?: number
path: string
label?: any
labelStyle?: any