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 type { FunctionalComponent } from 'vue'
|
||||||
import EdgeText from './EdgeText.vue'
|
import EdgeText from './EdgeText.vue'
|
||||||
import type { BaseEdgeProps } from '~/types'
|
import type { BaseEdgeProps } from '~/types'
|
||||||
@@ -39,7 +40,7 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function (
|
|||||||
'stroke-width': interactionWidth,
|
'stroke-width': interactionWidth,
|
||||||
})
|
})
|
||||||
: null,
|
: null,
|
||||||
label
|
label && isNumber(labelX) && isNumber(labelY)
|
||||||
? h(EdgeText, {
|
? h(EdgeText, {
|
||||||
x: labelX,
|
x: labelX,
|
||||||
y: labelY,
|
y: labelY,
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ export interface SmoothStepEdgeProps<Data = ElementData, CustomEvents = {}> exte
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseEdgeProps {
|
export interface BaseEdgeProps {
|
||||||
labelX: number
|
labelX?: number
|
||||||
labelY: number
|
labelY?: number
|
||||||
path: string
|
path: string
|
||||||
label?: any
|
label?: any
|
||||||
labelStyle?: any
|
labelStyle?: any
|
||||||
|
|||||||
Reference in New Issue
Block a user