import { defineComponent } from 'vue'; import EdgeText from './EdgeText'; import { getMarkerEnd } from './utils'; import { EdgeProps } from '../../types'; const StraightEdge = defineComponent({ props: EdgeProps, setup(props) { const yOffset = Math.abs(props.targetY - props.sourceY) / 2; const centerY = props.targetY < props.sourceY ? props.targetY + yOffset : props.targetY - yOffset; const xOffset = Math.abs(props.targetX - props.sourceX) / 2; const centerX = props.targetX < props.sourceX ? props.targetX + xOffset : props.targetX - xOffset; const markerEnd = getMarkerEnd(props.arrowHeadType, props.markerEndId); const text = props.label ? ( ) : null; return ( <> {text} ); } }); export default StraightEdge;