Skip to main content

Class: NodeState

Constructors

constructor

new NodeState(rootStore, id, state?)

Parameters

NameType
rootStoreRootStore
idstring
state?INodeStateWithoutId

Accessors

componentDefinition

get componentDefinition(): VisualComponentState<INodeVisualComponentProps<INodeComponentSettings>, INodeComponentSettings>

Returns

VisualComponentState<INodeVisualComponentProps<INodeComponentSettings>, INodeComponentSettings>


connectedExternalPorts

get connectedExternalPorts(): Dictionary<PortState[]>

Returns

Dictionary<PortState[]>


get connectedLinks(): LinkState[]

Returns

LinkState[]


data

get data(): any

Returns

any


hovered

get hovered(): boolean

Returns

boolean

set hovered(value): void

Parameters

NameType
valueboolean

Returns

void


id

get id(): string

Returns

string


isDragActive

get isDragActive(): boolean

Returns

boolean

set isDragActive(value): void

Parameters

NameType
valueboolean

Returns

void


isDragEnabled

get isDragEnabled(): boolean

Returns

boolean


isSelectionEnabled

get isSelectionEnabled(): boolean

Returns

boolean


label

get label(): undefined | string

Returns

undefined | string


ports

get ports(): ReadonlyMap<string, PortState>

Returns

ReadonlyMap<string, PortState>


position

get position(): Point

Returns

Point


ref

get ref(): HtmlElementRefState

Returns

HtmlElementRefState


selected

get selected(): boolean

Returns

boolean

set selected(value): void

Parameters

NameType
valueboolean

Returns

void


transformString

get transformString(): string

Returns

string


type

get type(): string

Returns

string

Methods

addPort

addPort(port): SuccessOrErrorResult<PortState, undefined>

Parameters

NameType
portIPortState

Returns

SuccessOrErrorResult<PortState, undefined>


export

export(): INodeExport

Returns

INodeExport


getPort

getPort(portId): undefined | PortState

Parameters

NameType
portIdstring

Returns

undefined | PortState


getPortOrThrowException

getPortOrThrowException(portId): PortState

Parameters

NameType
portIdstring

Returns

PortState


import

import(newState?): void

Parameters

NameType
newState?INodeStateWithoutId

Returns

void


moveBy

moveBy(vector, ignoreSnapping?): undefined | Point

Parameters

NameTypeDefault valueDescription
vectorPointundefinedvector to move node by
ignoreSnappingbooleanfalsedo not take into account snapping to grid

Returns

undefined | Point

remainder in case snap to grid is turned on. For example if vector would be [3,9], node current position [10,10] and snap [5,5], the node position would be set to [10,15] and remainder equals [3,4]


recalculatePortsOffset

recalculatePortsOffset(): void

Returns

void


removePort

removePort(portId): boolean

Parameters

NameType
portIdstring

Returns

boolean


setData

setData(value?): undefined | PropertyChange<any>

Parameters

NameType
value?any

Returns

undefined | PropertyChange<any>


setIsDragEnabled

setIsDragEnabled(value): undefined | PropertyChange<undefined | boolean>

Parameters

NameType
valueundefined | null | boolean

Returns

undefined | PropertyChange<undefined | boolean>


setIsSelectionEnabled

setIsSelectionEnabled(value): undefined | PropertyChange<undefined | boolean>

Parameters

NameType
valueundefined | null | boolean

Returns

undefined | PropertyChange<undefined | boolean>


setLabel

setLabel(value?): undefined | PropertyChange<undefined | string>

Parameters

NameType
value?null | string

Returns

undefined | PropertyChange<undefined | string>


setPorts

setPorts(nodePorts?): void

Parameters

NameType
nodePorts?IPortState[]

Returns

void


setPosition

setPosition(newPosition, ignoreSnapping?): undefined | PropertyChange<Point>

Parameters

NameTypeDefault valueDescription
newPositionPointundefinednew position
ignoreSnappingbooleanfalsedo not take into account snapping to grid

Returns

undefined | PropertyChange<Point>

undefined if position did not change


setType

setType(value): undefined | PropertyChange<undefined | string>

Parameters

NameType
valueundefined | null | string

Returns

undefined | PropertyChange<undefined | string>