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()
Parameters
• props?: Props
Returns
Overrides
BaseSocketPosition
.constructor
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:26
Properties
area
Inherited from
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:31
emitter
Inherited from
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:30
sockets
Inherited from
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:29
Methods
attach()
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
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/base-socket-position.ts:51
calculatePosition()
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
Props for DOMSocketPosition
class.
Type declaration
offset()?
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
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:6
Functions
getDOMSocketPosition()
Wrapper function for DOMSocketPosition
class.
Type Parameters
• K
Parameters
• props?: Props
Props for DOMSocketPosition
class
Returns
Defined in
tmp/graph-editor/src/lib/graph-editor/render/sockets-position.ts/dom-socket-position.ts:50