Skip to main content

Class: NodesStore

Constructors

constructor

new NodesStore(rootStore)

Parameters

NameType
rootStoreRootStore

Accessors

nodes

get nodes(): ReadonlyMap<string, NodeState>

Returns

ReadonlyMap<string, NodeState>

Methods

addNode

addNode(node, rewriteIfExists?): SuccessOrErrorResult<NodeState, INodeState>

Parameters

NameTypeDefault value
nodeINodeStateundefined
rewriteIfExistsbooleanfalse

Returns

SuccessOrErrorResult<NodeState, INodeState>


addNodes

addNodes(nodes, rewriteIfExists?): SuccessOrErrorResult<NodeState, INodeState>[]

Parameters

NameTypeDefault value
nodesINodeState[]undefined
rewriteIfExistsbooleanfalse

Returns

SuccessOrErrorResult<NodeState, INodeState>[]


export

export(): INodeExport[]

Returns

INodeExport[]


getNode

getNode(nodeId): undefined | NodeState

Parameters

NameType
nodeIdstring

Returns

undefined | NodeState


getNodesBoundingBox

getNodesBoundingBox(): BoundingBox

Returns

BoundingBox

Values are calculated without zoom taking into account, that is, the same as zoom would be '1'


import

import(newNodes?): void

Parameters

NameType
newNodes?INodeState[]

Returns

void


removeNode

removeNode(nodeId): undefined | INodeExport

Parameters

NameType
nodeIdstring

Returns

undefined | INodeExport


removeNodes

removeNodes(nodeIds): SuccessOrErrorResult<INodeExport, string>[]

Parameters

NameType
nodeIdsstring[]

Returns

SuccessOrErrorResult<INodeExport, string>[]