A class that accepts a collection of objects from the AdjacencyGraphBuilder to build INodes from.
Remarks
Type Parameters
- TDataItem
- The type of the data items in the source.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.binding.AdjacencyNodesSource
See Also
Constructors
AdjacencyNodesSource
(nodeCreator: NodeCreator<TDataItem>, idProvider?: function(TDataItem, Object):Object)Creates a new source with the given nodeCreator
.
Parameters
A map of options to pass to the method.
- nodeCreator - NodeCreator<TDataItem>
- The creator that is used to create the nodes of this source.
- idProvider - function(TDataItem, Object):Object
- An optional function that yields an id for each element of the associated data collection in the AdjacencyGraphBuilder.
Signature Details
function(dataItem: TDataItem, canonicalId: any) : any
A callback that provides an unique identifier for thedataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Properties
Gets or sets a provider that yields an id for each element of the associated data collection in the GraphBuilder.
Signature Details
function(dataItem: TDataItem, canonicalId: any) : any
dataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Gets or sets the NodeCreator<TDataItem> for this source which can be used to adjust the creation behavior.
Gets or sets a provider that yields a parent id for each element of the associated data collection in the GraphBuilder.
Remarks
Signature Details
function(dataItem: TDataItem) : any
TValue
for the given dataItem
.Parameters
- dataItem - TDataItem
- The data item for which a value shall be provided.
Returns
- any
Methods
addInEdgesSource
<TEdgeDataItem,TPredecessorDataItem>(edgeDataProvider: function(TDataItem):Object, sourceDataProvider: function(TEdgeDataItem):TPredecessorDataItem, sourceNodesSource: AdjacencyNodesSource<TPredecessorDataItem>, edgeCreator: EdgeCreator<TEdgeDataItem>)Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
- TPredecessorDataItem
- The type of the predecessor data items.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- sourceDataProvider - function(TEdgeDataItem):TPredecessorDataItem
- A function that yields the source data item for each edge data item provided by
edgeDataProvider
.Signature Details
function(dataItem: TEdgeDataItem) : TPredecessorDataItem
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TEdgeDataItem
- The data item for which a value shall be provided.
Returns
- TPredecessorDataItem
- sourceNodesSource - AdjacencyNodesSource<TPredecessorDataItem>
- The nodes source for the source data items.
- edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
addInEdgesSourceToId
<TEdgeDataItem>(edgeDataProvider: function(TDataItem):Object, sourceIdProvider: function(TEdgeDataItem):Object, edgeCreator: EdgeCreator<TEdgeDataItem>)Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- sourceIdProvider - function(TEdgeDataItem):Object
- A function that yields the source node id for each edge data item provided by
edgeDataProvider
. - edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
addOutEdgesSource
<TEdgeDataItem,TSuccessorDataItem>(edgeDataProvider: function(TDataItem):Object, targetDataProvider: function(TEdgeDataItem):TSuccessorDataItem, targetNodesSource: AdjacencyNodesSource<TSuccessorDataItem>, edgeCreator: EdgeCreator<TEdgeDataItem>)Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
- TSuccessorDataItem
- The type of the successor data items.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- targetDataProvider - function(TEdgeDataItem):TSuccessorDataItem
- A function that yields the target data item for each edge data item provided by
edgeDataProvider
.Signature Details
function(dataItem: TEdgeDataItem) : TSuccessorDataItem
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TEdgeDataItem
- The data item for which a value shall be provided.
Returns
- TSuccessorDataItem
- targetNodesSource - AdjacencyNodesSource<TSuccessorDataItem>
- The nodes source for the target data items.
- edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
addOutEdgesSourceToId
<TEdgeDataItem>(edgeDataProvider: function(TDataItem):Object, targetIdProvider: function(TEdgeDataItem):Object, edgeCreator: EdgeCreator<TEdgeDataItem>)Registers a provider for outgoing edge data items from which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- targetIdProvider - function(TEdgeDataItem):Object
- A function that yields the target node id for each edge data item provided by
edgeDataProvider
. - edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
addPredecessorIds
(predecessorIdsProvider: function(TDataItem):IEnumerable<Object>, edgeCreator: EdgeCreator<TDataItem>)Registers a provider for source node ids to which edges are created using the provided edgeCreator
.
Remarks
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
.
Parameters
A map of options to pass to the method.
- predecessorIdsProvider - function(TDataItem):IEnumerable<Object>
- A function that yields the source node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Signature Details
function(dataItem: TDataItem) : IEnumerable<Object>
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TDataItem
- The data item for which a value shall be provided.
Returns
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
addPredecessorsSource
<TPredecessorDataItem>(predecessorsProvider: function(TDataItem):Object, predecessorNodesSource: AdjacencyNodesSource<TPredecessorDataItem>, edgeCreator: EdgeCreator<TDataItem>)Registers a provider for node data items associated with a predecessorNodesSource
to which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TPredecessorDataItem
- The type of the predecessor data items.
Parameters
A map of options to pass to the method.
- predecessorsProvider - function(TDataItem):Object
- A function that yields the predecessor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- predecessorNodesSource - AdjacencyNodesSource<TPredecessorDataItem>
- The nodes source for the predecessor data items.
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
addSuccessorIds
(successorIdsProvider: function(TDataItem):IEnumerable<Object>, edgeCreator: EdgeCreator<TDataItem>)Registers a provider for target node ids to which edges are created using the provided edgeCreator
.
Remarks
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
.
Parameters
A map of options to pass to the method.
- successorIdsProvider - function(TDataItem):IEnumerable<Object>
- A function that yields the target node ids for each node data item associated with this AdjacencyNodesSource<TDataItem>.
Signature Details
function(dataItem: TDataItem) : IEnumerable<Object>
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TDataItem
- The data item for which a value shall be provided.
Returns
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
addSuccessorsSource
<TSuccessorDataItem>(successorsProvider: function(TDataItem):Object, successorNodesSource: AdjacencyNodesSource<TSuccessorDataItem>, edgeCreator: EdgeCreator<TDataItem>)Registers a provider for node data items associated with a successorNodesSource
to which edges are created using the provided edgeCreator
.
Remarks
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
.
Type Parameters
- TSuccessorDataItem
- The type of the successor data items.
Parameters
A map of options to pass to the method.
- successorsProvider - function(TDataItem):Object
- A function that yields the successor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- successorNodesSource - AdjacencyNodesSource<TSuccessorDataItem>
- The nodes source for the successor data items.
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
createInEdgesSource
<TEdgeDataItem,TPredecessorDataItem>(edgeDataProvider: function(TDataItem):Object, sourceDataProvider: function(TEdgeDataItem):TPredecessorDataItem, edgeCreator: EdgeCreator<TEdgeDataItem>, sourceIdProvider?: function(TPredecessorDataItem, Object):Object) : AdjacencyNodesSource<TPredecessorDataItem>Registers a provider for outgoing edge data items whose sourceDataProvider
function as node objects for the returned AdjacencyNodesSource<TDataItem>.
Remarks
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 defaults of this newly created source cascade with the defaults of this source.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
- TPredecessorDataItem
- The type of the predecessor data items in the source.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- sourceDataProvider - function(TEdgeDataItem):TPredecessorDataItem
- A function that yields the source node data items for each edge data item provided by
edgeDataProvider
.Signature Details
function(dataItem: TEdgeDataItem) : TPredecessorDataItem
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TEdgeDataItem
- The data item for which a value shall be provided.
Returns
- TPredecessorDataItem
- edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
- sourceIdProvider - function(TPredecessorDataItem, Object):Object
- An optional function that yields an id for each source node data item.
Signature Details
function(dataItem: TPredecessorDataItem, canonicalId: any) : any
A callback that provides an unique identifier for thedataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Returns
- ↪AdjacencyNodesSource<TPredecessorDataItem>
- A new AdjacencyNodesSource<TDataItem> for the node data items returned by
sourceDataProvider
.
createOutEdgesSource
<TEdgeDataItem,TSuccessorDataItem>(edgeDataProvider: function(TDataItem):Object, targetDataProvider: function(TEdgeDataItem):TSuccessorDataItem, edgeCreator: EdgeCreator<TEdgeDataItem>, targetIdProvider?: function(TSuccessorDataItem, Object):Object) : AdjacencyNodesSource<TSuccessorDataItem>Registers a provider for outgoing edge data items whose targetDataProvider
function as node objects for the returned AdjacencyNodesSource<TDataItem>.
Remarks
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 defaults of this newly created source cascade with the defaults of this source.
Type Parameters
- TEdgeDataItem
- The type of the edge data items.
- TSuccessorDataItem
- The type of the successor data items in the source.
Parameters
A map of options to pass to the method.
- edgeDataProvider - function(TDataItem):Object
- A function that yields the edge data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- targetDataProvider - function(TEdgeDataItem):TSuccessorDataItem
- A function that yields the target node data items for each edge data item provided by
edgeDataProvider
.Signature Details
function(dataItem: TEdgeDataItem) : TSuccessorDataItem
A callback that provides an instance of typeTValue
for the givendataItem
.Parameters
- dataItem - TEdgeDataItem
- The data item for which a value shall be provided.
Returns
- TSuccessorDataItem
- edgeCreator - EdgeCreator<TEdgeDataItem>
- The creator that is used to create the edges.
- targetIdProvider - function(TSuccessorDataItem, Object):Object
- An optional function that yields an id for each target node data item.
Signature Details
function(dataItem: TSuccessorDataItem, canonicalId: any) : any
A callback that provides an unique identifier for thedataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Returns
- ↪AdjacencyNodesSource<TSuccessorDataItem>
- A new AdjacencyNodesSource<TDataItem> for the node data items returned by
targetDataProvider
.
createPredecessorsSource
<TPredecessorDataItem>(predecessorsProvider: function(TDataItem):Object, edgeCreator: EdgeCreator<TDataItem>, idProvider?: function(TPredecessorDataItem, Object):Object) : AdjacencyNodesSource<TPredecessorDataItem>Registers a provider for node data items functioning as node objects for the returned AdjacencyNodesSource<TDataItem>.
Remarks
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 defaults of this newly created source cascade with the defaults of this source.
Type Parameters
- TPredecessorDataItem
- The type of the predecessor data items in the source.
Parameters
A map of options to pass to the method.
- predecessorsProvider - function(TDataItem):Object
- A function that yields the predecessor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
- idProvider - function(TPredecessorDataItem, Object):Object
- An optional function that yields an id for each source node data item.
Signature Details
function(dataItem: TPredecessorDataItem, canonicalId: any) : any
A callback that provides an unique identifier for thedataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Returns
- ↪AdjacencyNodesSource<TPredecessorDataItem>
- A new AdjacencyNodesSource<TDataItem> for the node data items returned by
predecessorsProvider
.
createSuccessorsSource
<TSuccessorDataItem>(successorsProvider: function(TDataItem):Object, edgeCreator: EdgeCreator<TDataItem>, idProvider?: function(TSuccessorDataItem, Object):Object) : AdjacencyNodesSource<TSuccessorDataItem>Registers a provider for node data items functioning as node objects for the returned AdjacencyNodesSource<TDataItem>.
Remarks
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 defaults of this newly created source cascade with the defaults of this source.
Type Parameters
- TSuccessorDataItem
- The type of the successor data items in the source.
Parameters
A map of options to pass to the method.
- successorsProvider - function(TDataItem):Object
- A function that yields the successor data items for each node data item associated with this AdjacencyNodesSource<TDataItem>.
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges.
- idProvider - function(TSuccessorDataItem, Object):Object
- An optional function that yields an id for each target node data item.
Signature Details
function(dataItem: TSuccessorDataItem, canonicalId: any) : any
A callback that provides an unique identifier for thedataItem
.id provider are used in NodesSource.idProvider, EdgesSource.idProvider and LabelsSource.idProvider to identify the created nodes, edges and labels and avoid duplicate creation of items with the same ID.
The ID can also be used by parentIdProvider and sourceIdProvider and targetIdProvider to resolve the parent, source, or target nodes.
The ID is further used to identify nodes, edges, and labels during updateGraph.
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.
Returns
- any
Returns
- ↪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.
Remarks
Parameters
A map of options to pass to the method.
- dataItem - TDataItem
- A single data item from the associated data collection in the GraphBuilder.
Returns
- ↪any
- The id of another node or
null
in case the node should be put in the root of the hierarchy.