chore: lint files

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-03-31 21:30:23 +02:00
committed by Braks
parent 9d597ff454
commit f61e5beb02
69 changed files with 623 additions and 424 deletions
@@ -22,7 +22,7 @@ const handleDirections = {
[Position.Bottom]: { x: 0, y: 1 },
}
const getDirection = ({
function getDirection({
source,
sourcePosition = Position.Bottom,
target,
@@ -30,14 +30,16 @@ const getDirection = ({
source: XYPosition
sourcePosition: Position
target: XYPosition
}): XYPosition => {
}): XYPosition {
if (sourcePosition === Position.Left || sourcePosition === Position.Right) {
return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 }
}
return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 }
}
const distance = (a: XYPosition, b: XYPosition) => Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2)
function distance(a: XYPosition, b: XYPosition) {
return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2)
}
// With this function we try to mimic an orthogonal edge routing behaviour
// It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges