import { computed, defineComponent, inject } from 'vue' import { getBezierPath, getEdgeCenter, getMarkerEnd, RevueFlowStore } from '../../src' import { DefaultEdgeProps } from '../../src/components/Edges/utils' import { RevueFlowHooks } from '../../src/hooks/RevueFlowHooks' export default defineComponent({ props: { ...DefaultEdgeProps }, setup(props) { const store = inject('store')! const hooks = inject('hooks')! const onEdgeClick = (evt: Event, id: string) => { const edge = store.edges.find((edge) => edge.id === id) if (edge) { hooks.elementsRemove.trigger([edge]) } evt.stopPropagation() alert(`remove ${id}`) } const foreignObjectSize = 40 const edgePath = computed(() => getBezierPath({ sourceX: props.sourceX, sourceY: props.sourceY, sourcePosition: props.sourcePosition, targetX: props.targetX, targetY: props.targetY, targetPosition: props.targetPosition }) ) const markerEnd = computed(() => getMarkerEnd(props.arrowHeadType, props.markerEndId)) const center = computed(() => getEdgeCenter({ sourceX: props.sourceX, sourceY: props.sourceY, targetX: props.targetX, targetY: props.targetY }) ) return () => ( <> ) } })