C

AdjacencyNodesSource<TDataItem>

A class that accepts a collection of objects from the AdjacencyGraphBuilder to build INodes from.
Inheritance Hierarchy

Remarks

It manages the structural aspects of the graph creation, while the associated nodeCreator<TDataItem> is responsible for the properties of the created items.

Type Parameters

TDataItem

The type of the data items in the source.

Members

Show:

Constructors

Creates a new source with the given nodeCreator.

Parameters

nodeCreator: NodeCreator<TDataItem>
The creator that is used to create the nodes of this source.
idProvider?: function(TDataItem, any): any
conversion
An optional function that yields an id for each element of the associated data collection in the AdjacencyGraphBuilder.
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any

Properties

Gets or sets a provider that yields an id for each element of the associated data collection in the GraphBuilder.
conversionfinal
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any
Gets or sets the NodeCreator<TDataItem> for this source, which can be used to adjust the creation behavior.
final
Gets or sets a provider that yields a parent id for each element of the associated data collection in the GraphBuilder.
While this is optional, it is required to specify a parent/child node grouping relationship.
conversionfinal
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any

Methods

Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The sourceDataProvider takes such an edge data item and provides the corresponding source node data item.

The edge items function as edge objects for the edgeCreator.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

TPredecessorDataItem

The type of the predecessor data items.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
sourceDataProvider: function(TEdgeDataItem): TPredecessorDataItem
conversion
A function that yields the source data item for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
TPredecessorDataItem
sourceNodesSource: AdjacencyNodesSource<TPredecessorDataItem>
The nodes source for the source data items.
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The sourceIdProvider takes such an edge data item and provides the corresponding source node id.

The edge items function as edge objects for the edgeCreator.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
sourceIdProvider: function(TEdgeDataItem): any
conversion
A function that yields the source node id for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
any
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The targetDataProvider takes such an edge data item and provides the corresponding target node data item.

The edge items function as edge objects for the edgeCreator.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

TSuccessorDataItem

The type of the successor data items.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
targetDataProvider: function(TEdgeDataItem): TSuccessorDataItem
conversion
A function that yields the target data item for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
TSuccessorDataItem
targetNodesSource: AdjacencyNodesSource<TSuccessorDataItem>
The nodes source for the target data items.
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The targetIdProvider takes such an edge data item and provides the corresponding target node id.

The edge items function as edge objects for the edgeCreator.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
targetIdProvider: function(TEdgeDataItem): any
conversion
A function that yields the target node id for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
any
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
Registers a provider for source node ids to which edges are created using the provided edgeCreator.

The predecessorIdsProvider provides a collection of source node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

final

Parameters

predecessorIdsProvider: function(TDataItem): IEnumerable<any>
conversion
A function that yields the source node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
IEnumerable<any>
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
Registers a provider for node data items associated with a predecessorNodesSource to which edges are created using the provided edgeCreator.

The predecessorsProvider provides a collection of source node data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

final

Type Parameters

TPredecessorDataItem

The type of the predecessor data items.

Parameters

predecessorsProvider: function(TDataItem): any
conversion
A function that yields the predecessor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
predecessorNodesSource: AdjacencyNodesSource<TPredecessorDataItem>
The nodes source for the predecessor data items.
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
Registers a provider for target node ids to which edges are created using the provided edgeCreator.

The successorIdsProvider provides a collection of target node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

final

Parameters

successorIdsProvider: function(TDataItem): IEnumerable<any>
conversion
A function that yields the target node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
IEnumerable<any>
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
Registers a provider for node data items associated with a successorNodesSource to which edges are created using the provided edgeCreator.

The successorsProvider provides a collection of target node data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

final

Type Parameters

TSuccessorDataItem

The type of the successor data items.

Parameters

successorsProvider: function(TDataItem): any
conversion
A function that yields the successor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
successorNodesSource: AdjacencyNodesSource<TSuccessorDataItem>
The nodes source for the successor data items.
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
Registers a provider for outgoing edge data items whose sourceDataProvider function as node objects for the returned AdjacencyNodesSource<TDataItem>.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The sourceDataProvider takes such an edge data item and provides the corresponding source node data item.

The edge items function as edge objects for the edgeCreator.

The node NodeCreator.defaults<TDataItem> of this newly created source cascade with the defaults of this source.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

TPredecessorDataItem

The type of the predecessor data items in the source.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
sourceDataProvider: function(TEdgeDataItem): TPredecessorDataItem
conversion
A function that yields the source node data items for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
TPredecessorDataItem
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
sourceIdProvider?: function(TPredecessorDataItem, any): any
conversion
An optional function that yields an id for each source node data item.
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TPredecessorDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any

Return Value

AdjacencyNodesSource<TPredecessorDataItem>
A new AdjacencyNodesSource<TDataItem> for the node data items returned by sourceDataProvider.
Registers a provider for outgoing edge data items whose targetDataProvider function as node objects for the returned AdjacencyNodesSource<TDataItem>.

The edgeDataProvider provides a collection of outgoing edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>. The targetDataProvider takes such an edge data item and provides the corresponding target node data item.

The edge items function as edge objects for the edgeCreator.

The node NodeCreator.defaults<TDataItem> of this newly created source cascade with the defaults of this source.

final

Type Parameters

TEdgeDataItem

The type of the edge data items.

TSuccessorDataItem

The type of the successor data items in the source.

Parameters

edgeDataProvider: function(TDataItem): any
conversion
A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
targetDataProvider: function(TEdgeDataItem): TSuccessorDataItem
conversion
A function that yields the target node data items for each edge data item provided by edgeDataProvider.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TEdgeDataItem
The data item for which a value shall be provided.
Return Value
TSuccessorDataItem
edgeCreator: EdgeCreator<TEdgeDataItem>
The creator that is used to create the edges.
targetIdProvider?: function(TSuccessorDataItem, any): any
conversion
An optional function that yields an id for each target node data item.
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TSuccessorDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any

Return Value

AdjacencyNodesSource<TSuccessorDataItem>
A new AdjacencyNodesSource<TDataItem> for the node data items returned by targetDataProvider.
Registers a provider for node data items functioning as node objects for the returned AdjacencyNodesSource<TDataItem>.

The predecessorsProvider provides a collection of source node data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

The node NodeCreator.defaults<TDataItem> of this newly created source cascade with the defaults of this source.

final

Type Parameters

TPredecessorDataItem

The type of the predecessor data items in the source.

Parameters

predecessorsProvider: function(TDataItem): any
conversion
A function that yields the predecessor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
idProvider?: function(TPredecessorDataItem, any): any
conversion
An optional function that yields an id for each source node data item.
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TPredecessorDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any

Return Value

AdjacencyNodesSource<TPredecessorDataItem>
A new AdjacencyNodesSource<TDataItem> for the node data items returned by predecessorsProvider.
Registers a provider for node data items functioning as node objects for the returned AdjacencyNodesSource<TDataItem>.

The successorsProvider provides a collection of target node data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.

The node items of this source function as data items for the edgeCreator.

The node NodeCreator.defaults<TDataItem> of this newly created source cascade with the defaults of this source.

final

Type Parameters

TSuccessorDataItem

The type of the successor data items in the source.

Parameters

successorsProvider: function(TDataItem): any
conversion
A function that yields the successor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Function Details
A callback that provides an instance of type TValue for the given dataItem.
Parameters
dataItem: TDataItem
The data item for which a value shall be provided.
Return Value
any
edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges.
idProvider?: function(TSuccessorDataItem, any): any
conversion
An optional function that yields an id for each target node data item.
Function Details
A callback that provides an unique identifier for the dataItem.
Parameters
dataItem: TSuccessorDataItem
The value that will be passed in.
canonicalId: any
The original canonical id of the value. For data arrays and iterables this is the index into the collection. For Maps and data objects this is the key associated with a value.
Return Value
any

Return Value

AdjacencyNodesSource<TSuccessorDataItem>
A new AdjacencyNodesSource<TDataItem> for the node data items returned by successorsProvider.
Optionally obtains the id for the parent or null given each data item for which a node is created.
This implementation uses the parentIdProvider<TDataItem> to obtain the value from the data item.
protected

Parameters

dataItem: TDataItem
A single data item from the associated data collection in the GraphBuilder.

Return Value

any | null
The id of another node or null in case the node should be put in the root of the hierarchy.

See Also

API
parentIdProvider