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

Class. Abstract Edge Router

applyReconnect()

applyReconnect(edge, newSourceId?, newTargetId?): void

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:316

Updates the routing points and handles of the given edge with regard to the given moves.

Parameters

edge

SRoutableElementImpl

newSourceId?

string

newTargetId?

string

Returns

void

Implementation of

IEdgeRouter.applyReconnect


applySnapshot()

applySnapshot(edge, snapshot): void

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:375

Applies a snapshot to the current edge.

Parameters

edge

SRoutableElementImpl

snapshot

EdgeSnapshot

Returns

void

Implementation of

IEdgeRouter.applySnapshot


calculateDefaultCorners()

protected calculateDefaultCorners(edge, sourceAnchors, targetAnchors, options): Point[]

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:389

Parameters

edge

SRoutableElementImpl

sourceAnchors

DefaultAnchors

targetAnchors

DefaultAnchors

options

LinearRouteOptions

Returns

Point[]


calculateSegment()

protected calculateSegment(edge, t): undefined | { lambda: number; segmentEnd: Point; segmentStart: Point; }

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:145

Parameters

edge

SRoutableElementImpl

t

number

Returns

undefined | { lambda: number; segmentEnd: Point; segmentStart: Point; }


cleanupRoutingPoints()

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

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:284

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

Implementation of

IEdgeRouter.cleanupRoutingPoints


commitRoute()

protected commitRoute(edge, routedPoints): void

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:432

Parameters

edge

SRoutableElementImpl

routedPoints

RoutedPoint[]

Returns

void


createRoutingHandles()

abstract createRoutingHandles(edge): void

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:87

Creates the routing handles for the given target.

Parameters

edge

SRoutableElementImpl

Returns

void

Implementation of

IEdgeRouter.createRoutingHandles


derivativeAt()

derivativeAt(edge, t): undefined | Point

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:134

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

Implementation of

IEdgeRouter.derivativeAt


findOrthogonalIntersection()

findOrthogonalIntersection(edge, point): object

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:91

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

object

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

derivative

derivative: Point

point

point: Point

Implementation of

IEdgeRouter.findOrthogonalIntersection


findRouteSegment()

protected findRouteSegment(edge, route, handleIndex): object

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:217

Parameters

edge

SRoutableElementImpl

route

RoutedPoint[]

handleIndex

number

Returns

object

end?

optional end: Point

start?

optional start: Point


getAnchorComputer()

protected getAnchorComputer(connectable): IAnchorComputer

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:245

Parameters

connectable

SConnectableElementImpl

Returns

IAnchorComputer


getHandlePosition()

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

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:192

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

Implementation of

IEdgeRouter.getHandlePosition


getInnerHandlePosition()

abstract protected getInnerHandlePosition(edge, route, handle): undefined | Point

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:215

Parameters

edge

SRoutableElementImpl

route

RoutedPoint[]

handle

SRoutingHandleImpl

Returns

undefined | Point


getOptions()

abstract protected getOptions(edge): LinearRouteOptions

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:89

Parameters

edge

SRoutableElementImpl

Returns

LinearRouteOptions


getSelfEdgeIndex()

protected getSelfEdgeIndex(edge): number

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:424

Parameters

edge

SRoutableElementImpl

Returns

number


getTranslatedAnchor()

getTranslatedAnchor(connectable, refPoint, refContainer, edge, anchorCorrection): Point

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:237

Parameters

connectable

SConnectableElementImpl

refPoint

Point

refContainer

SParentElementImpl

edge

SRoutableElementImpl

anchorCorrection

number = 0

Returns

Point


pointAt()

pointAt(edge, t): undefined | Point

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:126

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

Implementation of

IEdgeRouter.pointAt


resetRoutingPointsOnReconnect()

protected resetRoutingPointsOnReconnect(edge, routingPoints, updateHandles, sourceAnchors, targetAnchors): boolean

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:290

Parameters

edge

SRoutableElementImpl

routingPoints

Point[]

updateHandles

boolean

sourceAnchors

DefaultAnchors

targetAnchors

DefaultAnchors

Returns

boolean


route()

abstract route(edge): RoutedPoint[]

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:85

Calculates the route of the given edge.

Parameters

edge

SRoutableElementImpl

Returns

RoutedPoint[]

Implementation of

IEdgeRouter.route


takeSnapshot()

takeSnapshot(edge): EdgeSnapshot

Defined in: packages/sprotty/src/features/routing/abstract-edge-router.ts:362

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

Parameters

edge

SRoutableElementImpl

Returns

EdgeSnapshot

Implementation of

IEdgeRouter.takeSnapshot