chore: remove unused imports

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent c82ca4e225
commit 3e42948cac
7 changed files with 35 additions and 146 deletions
+2 -17
View File
@@ -1,5 +1,5 @@
import { isGraphNode, rectToBox } from './graph'
import { Edge, EdgePositions, GraphNode, HandleElement, Position, Transform, XYPosition, FlowElements, GraphEdge } from '~/types'
import { rectToBox } from './graph'
import { EdgePositions, GraphNode, HandleElement, Position, Transform, XYPosition } from '~/types'
export function getHandlePosition(position: Position, node: GraphNode, handle?: HandleElement): XYPosition {
const x = (handle?.x ?? 0) + node.position.x
@@ -102,18 +102,3 @@ export function isEdgeVisible({ sourcePos, targetPos, width, height, transform }
return overlappingArea > 0
}
export const getSourceTargetNodes = (edge: GraphEdge | Edge, elements: FlowElements) => {
const nodes: GraphNode[] = []
for (const el of elements) {
if (!nodes[0] || !nodes[1]) {
if (isGraphNode(el)) {
if (el.id === edge.source) nodes[0] = el
if (el.id === edge.target) nodes[1] = el
}
} else {
break
}
}
return { sourceNode: nodes[0], targetNode: nodes[1] }
}