feat(edges): add pointerRadius prop to edges

This commit is contained in:
braks
2022-11-13 08:42:06 +01:00
committed by Braks
parent c8c9daffb7
commit a4fd0ebda4
9 changed files with 32 additions and 1 deletions
+12 -1
View File
@@ -14,11 +14,12 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function ({
labelBgBorderRadius,
labelBgPadding,
labelBgStyle,
labelShowBg,
labelShowBg = true,
labelStyle,
markerStart,
markerEnd,
style,
pointerRadius = 2,
}) {
return [
h('path', {
@@ -28,6 +29,15 @@ const BaseEdge: FunctionalComponent<BaseEdgeProps> = function ({
'marker-end': markerEnd,
'marker-start': markerStart,
}),
pointerRadius
? h('path', {
'style': 'opacity: 0',
'd': path,
'class': 'vue-flow__edge-pointer',
'stroke': 'transparent',
'stroke-width': pointerRadius,
})
: null,
label
? h(EdgeText, {
x: labelX,
@@ -56,6 +66,7 @@ BaseEdge.props = [
'markerStart',
'markerEnd',
'style',
'pointerRadius',
]
BaseEdge.inheritAttrs = false