refactor(edge-label): prevent junpming
This commit is contained in:
@@ -107,7 +107,7 @@ const edges: Edge[] = [
|
|||||||
|
|
||||||
const defaultEdgeOptions = {
|
const defaultEdgeOptions = {
|
||||||
label: 'Edge Label',
|
label: 'Edge Label',
|
||||||
type: 'default',
|
type: 'smoothstep',
|
||||||
markerEnd: {
|
markerEnd: {
|
||||||
type: MarkerType.ArrowClosed,
|
type: MarkerType.ArrowClosed,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ const EdgeText: FC<PropsWithChildren<EdgeTextProps>> = ({
|
|||||||
<g
|
<g
|
||||||
transform={`translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`}
|
transform={`translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`}
|
||||||
className={edgeTextClasses}
|
className={edgeTextClasses}
|
||||||
|
visibility={edgeTextBbox.width ? 'visible' : 'hidden'}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
{labelShowBg && (
|
{labelShowBg && (
|
||||||
|
|||||||
Reference in New Issue
Block a user