Skip to main content

Class: PortState

Constructors

constructor

new PortState(rootStore, node, id, state?)

Parameters

NameType
rootStoreRootStore
nodeNodeState
idstring
state?IPortStateWithoutIds

Accessors

componentDefinition

get componentDefinition(): VisualComponentState<IPortVisualComponentProps<any>, any>

Returns

VisualComponentState<IPortVisualComponentProps<any>, any>


get connectedLinks(): LinkState[]

Returns

LinkState[]


connectedPorts

get connectedPorts(): PortState[]

Returns

PortState[]


data

get data(): any

Returns

any


dragging

get dragging(): boolean

Returns

boolean

set dragging(value): void

Parameters

NameType
valueboolean

Returns

void


fullId

get fullId(): string

Returns

string


hovered

get hovered(): boolean

Returns

boolean

set hovered(value): void

Parameters

NameType
valueboolean

Returns

void


id

get id(): string

Returns

string


isConnectionEnabled

get isConnectionEnabled(): boolean

Returns

boolean


label

get label(): undefined | string

Returns

undefined | string


linkDirection

get linkDirection(): undefined | "left" | "right" | "up" | "down" | "left-down" | "left-up" | "right-down" | "right-up"

Returns

undefined | "left" | "right" | "up" | "down" | "left-down" | "left-up" | "right-down" | "right-up"


node

get node(): NodeState

Returns

NodeState


nodeComponentPortState

get nodeComponentPortState(): undefined | IPortFinalState

Returns

undefined | IPortFinalState


nodeId

get nodeId(): string

Returns

string


offsetFromNodeCenter

get offsetFromNodeCenter(): undefined | number

Returns

undefined | number


offsetFromOrigin

get offsetFromOrigin(): undefined | Point

Returns

undefined | Point


offsetRecalculationRequested

get offsetRecalculationRequested(): number

Is used to trigger port rerendering and following offset recalculation

Returns

number


offsetRelativeToNode

get offsetRelativeToNode(): null | Point

Offset relative to parent node, helps us to calculate positions of link endpoints for example.

Returns

null | Point

offset excluding zoom


position

get position(): undefined | "left-top" | "right-top" | "right-bottom" | "left-bottom" | "left-center" | "top-left" | "top-center" | "top-right" | "right-center" | "bottom-left" | "bottom-center" | "bottom-right" | "diagonal-left-top" | "diagonal-right-top" | "diagonal-right-bottom" | "diagonal-left-bottom"

Returns

undefined | "left-top" | "right-top" | "right-bottom" | "left-bottom" | "left-center" | "top-left" | "top-center" | "top-right" | "right-center" | "bottom-left" | "bottom-center" | "bottom-right" | "diagonal-left-top" | "diagonal-right-top" | "diagonal-right-bottom" | "diagonal-left-bottom"


ref

get ref(): HtmlElementRefState

Returns

HtmlElementRefState


type

get type(): string

Returns

string


validForConnection

get validForConnection(): boolean

Returns

boolean

set validForConnection(value): void

Parameters

NameType
valueboolean

Returns

void

Methods

export

export(): IPortExport

Returns

IPortExport


import

import(state?): void

Update all properties. If some property missing in state parameter, the default one will be used.

Parameters

NameType
state?IPortStateWithoutIds

Returns

void


recalculateOffset

recalculateOffset(): void

Returns

void


recalculateOffsetImmediately

recalculateOffsetImmediately(): void

Returns

void


setData

setData(value): void

Parameters

NameType
valueany

Returns

void


setIsConnectionEnabled

setIsConnectionEnabled(value): void

Parameters

NameType
valueundefined | null | boolean

Returns

void


setLabel

setLabel(value): void

Parameters

NameType
valueundefined | null | string

Returns

void


setLinkDirection

setLinkDirection(value): void

Parameters

NameType
valueundefined | null | "left" | "right" | "up" | "down" | "left-down" | "left-up" | "right-down" | "right-up"

Returns

void


setOffsetFromNodeCenter

setOffsetFromNodeCenter(value): void

Parameters

NameType
valueundefined | null | number

Returns

void


setOffsetFromOrigin

setOffsetFromOrigin(value): void

Parameters

NameType
valueundefined | null | Point

Returns

void


setPosition

setPosition(value): void

Parameters

NameType
valueundefined | null | "left-top" | "right-top" | "right-bottom" | "left-bottom" | "left-center" | "top-left" | "top-center" | "top-right" | "right-center" | "bottom-left" | "bottom-center" | "bottom-right" | "diagonal-left-top" | "diagonal-right-top" | "diagonal-right-bottom" | "diagonal-left-bottom"

Returns

void


setType

setType(value): void

Parameters

NameType
valueundefined | null | string

Returns

void


update

update(state?): void

Update only those properties presented in state parameter

Parameters

NameType
state?IPortStateWithoutIds

Returns

void