Skip to content

dom-socket-position

Classes

DOMSocketPosition<K>

Class for socket position calculation based on DOM elements. It uses getElementCenter function to calculate the position.

Extends

Type Parameters

K

Constructors

new DOMSocketPosition()
new DOMSocketPosition<K>(props?): DOMSocketPosition<K>
Parameters

props?: Props

Returns

DOMSocketPosition<K>

Overrides

BaseSocketPosition.constructor

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:26

Properties

area
area: null | BaseAreaPlugin<Schemes, ExpectArea2DExtra<Schemes>> = null;
Inherited from

BaseSocketPosition.area

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:31

emitter
emitter: EventEmitter<ListenerData>;
Inherited from

BaseSocketPosition.emitter

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:30

sockets
sockets: SocketsPositionsStorage;
Inherited from

BaseSocketPosition.sockets

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:29

Methods

attach()
attach(scope): void

Attach the watcher to the area’s child scope.

Parameters

scope: Scope<never, [K]>

Scope of the watcher that should be a child of BaseAreaPlugin

Returns

void

Inherited from

BaseSocketPosition.attach

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:51

calculatePosition()
calculatePosition(
nodeId,
side,
key,
element): Promise<null | Position>

The method needs to be implemented that calculates the position of the socket.

Parameters

nodeId: string

Node ID

side: Side

Side of the socket, ‘input’ or ‘output’

key: string

Socket key

element: HTMLElement

Socket element

Returns

Promise<null | Position>

Overrides

BaseSocketPosition.calculatePosition

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:30

Type Aliases

Props

type Props: object;

Props for DOMSocketPosition class.

Type declaration

offset()?
optional offset: (position, nodeId, side, key) => Position;

Allows to customize the position of the socket. By default, the position is shifted by 12px on the x-axis relative to the center of the socket.

Parameters

position: Position

Center position of the socket

nodeId: string

Node ID

side: Side

Side of the socket, ‘input’ or ‘output’

key: string

Socket key

Returns

Position

Custom position of the socket

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:10


Side

type Side: "input" | "output";

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:6

Functions

getDOMSocketPosition()

function getDOMSocketPosition<K>(props?): DOMSocketPosition<K>

Wrapper function for DOMSocketPosition class.

Type Parameters

K

Parameters

props?: Props

Props for DOMSocketPosition class

Returns

DOMSocketPosition<K>

Defined in

tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:50