Class: PortState
Constructors
constructor
• new PortState(rootStore
, node
, id
, state?
)
Parameters
Name | Type |
---|---|
rootStore | RootStore |
node | NodeState |
id | string |
state? | IPortStateWithoutIds |
Accessors
componentDefinition
• get
componentDefinition(): VisualComponentState
<IPortVisualComponentProps
<any
>, any
>
Returns
VisualComponentState
<IPortVisualComponentProps
<any
>, any
>
connectedLinks
• get
connectedLinks(): LinkState
[]
Returns
connectedPorts
• get
connectedPorts(): PortState
[]
Returns
data
• get
data(): any
Returns
any
dragging
• get
dragging(): boolean
Returns
boolean
• set
dragging(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
fullId
• get
fullId(): string
Returns
string
hovered
• get
hovered(): boolean
Returns
boolean
• set
hovered(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
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
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
type
• get
type(): string
Returns
string
validForConnection
• get
validForConnection(): boolean
Returns
boolean
• set
validForConnection(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Methods
export
▸ export(): IPortExport
Returns
import
▸ import(state?
): void
Update all properties. If some property missing in state
parameter, the default one will be used.
Parameters
Name | Type |
---|---|
state? | IPortStateWithoutIds |
Returns
void
recalculateOffset
▸ recalculateOffset(): void
Returns
void
recalculateOffsetImmediately
▸ recalculateOffsetImmediately(): void
Returns
void
setData
▸ setData(value
): void
Parameters
Name | Type |
---|---|
value | any |
Returns
void
setIsConnectionEnabled
▸ setIsConnectionEnabled(value
): void
Parameters
Name | Type |
---|---|
value | undefined | null | boolean |
Returns
void
setLabel
▸ setLabel(value
): void
Parameters
Name | Type |
---|---|
value | undefined | null | string |
Returns
void
setLinkDirection
▸ setLinkDirection(value
): void
Parameters
Name | Type |
---|---|
value | undefined | null | "left" | "right" | "up" | "down" | "left-down" | "left-up" | "right-down" | "right-up" |
Returns
void
setOffsetFromNodeCenter
▸ setOffsetFromNodeCenter(value
): void
Parameters
Name | Type |
---|---|
value | undefined | null | number |
Returns
void
setOffsetFromOrigin
▸ setOffsetFromOrigin(value
): void
Parameters
Name | Type |
---|---|
value | undefined | null | Point |
Returns
void
setPosition
▸ setPosition(value
): void
Parameters
Name | Type |
---|---|
value | undefined | 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
Name | Type |
---|---|
value | undefined | null | string |
Returns
void
update
▸ update(state?
): void
Update only those properties presented in state
parameter
Parameters
Name | Type |
---|---|
state? | IPortStateWithoutIds |
Returns
void