refactor(core,edges): make label coords optional
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user