Sprotty
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Interface. Iedge Router

cleanupRoutingPoints()

cleanupRoutingPoints(edge, routingPoints, updateHandles, addRoutingPoints): void

Defined in: packages/sprotty/src/features/routing/routing.ts:123

Remove/add points in order to keep routing constraints consistent, or reset RPs on reconnect.

Parameters

edge

SRoutableElementImpl

routingPoints

Point[]

updateHandles

boolean

addRoutingPoints

boolean

Returns

void


createRoutingHandles()

createRoutingHandles(edge): void

Defined in: packages/sprotty/src/features/routing/routing.ts:108

Creates the routing handles for the given target.

Parameters

edge

SRoutableElementImpl

Returns

void


derivativeAt()

derivativeAt(edge, t): undefined | Point

Defined in: packages/sprotty/src/features/routing/routing.ts:98

Calculates the derivative at a point on the edge.

Parameters

edge

SRoutableElementImpl

t

number

a value between 0 (sourceAnchor) and 1 (targetAnchor)

Returns

undefined | Point

the point or undefined if t is out of bounds or it cannot be computed


findOrthogonalIntersection()

findOrthogonalIntersection(edge, point): undefined | { derivative: Point; point: Point; }

Defined in: packages/sprotty/src/features/routing/routing.ts:82

Finds the orthogonal intersection point between an edge and a given point in 2D space.

Parameters

edge

SRoutableElementImpl

The edge to find the intersection point on.

point

Point

The point to find the intersection with.

Returns

undefined | { derivative: Point; point: Point; }

The intersection point and its derivative on the respective edge segment.


getHandlePosition()

getHandlePosition(edge, route, handle): undefined | Point

Defined in: packages/sprotty/src/features/routing/routing.ts:103

Retuns the position of the given handle based on the routing points of the edge.

Parameters

edge

SRoutableElementImpl

route

RoutedPoint[]

handle

SRoutingHandleImpl

Returns

undefined | Point


pointAt()

pointAt(edge, t): undefined | Point

Defined in: packages/sprotty/src/features/routing/routing.ts:90

Calculates a point on the edge

Parameters

edge

SRoutableElementImpl

t

number

a value between 0 (sourceAnchor) and 1 (targetAnchor)

Returns

undefined | Point

the point or undefined if t is out of bounds or it cannot be computed


route()

route(edge): RoutedPoint[]

Defined in: packages/sprotty/src/features/routing/routing.ts:73

Calculates the route of the given edge.

Parameters

edge

SRoutableElementImpl

Returns

RoutedPoint[]


takeSnapshot()

takeSnapshot(edge): EdgeSnapshot

Defined in: packages/sprotty/src/features/routing/routing.ts:128

Creates a snapshot of the given edge, storing all the data needed to restore it to its current state.

Parameters

edge

SRoutableElementImpl

Returns

EdgeSnapshot