A class that accepts a collection of objects from the GraphBuilder to build IEdges 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.EdgesSource
See Also
Constructors
EdgesSource
(edgeCreator: EdgeCreator<TDataItem>, sourceIdProvider: function(TDataItem):Object, targetIdProvider: function(TDataItem):Object, idProvider?: function(TDataItem, Object):Object)Creates a new source with the given edgeCreator
.
Parameters
A map of options to pass to the method.
- edgeCreator - EdgeCreator<TDataItem>
- The creator that is used to create the edges of this source.
- sourceIdProvider - function(TDataItem):Object
- A function that yields a source node id for each element of the associated data collection in the GraphBuilder.
- targetIdProvider - function(TDataItem):Object
- A function that yields a target node id for each element of the associated data collection in the GraphBuilder.
- idProvider - function(TDataItem, Object):Object
- An optional function that yields an id for each element of the associated data collection in the GraphBuilder.
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 the EdgeCreator<TDataItem> for this source which can be used to adjust the creation behavior.
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 the provider that yields a source node id for each element of the associated data collection in the GraphBuilder.
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
See Also
Gets the provider that yields a target node id for each element of the associated data collection in the GraphBuilder.
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
See Also
Methods
Obtains the source node id for each data item for which an edge 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 source node id to which the sourceIdProvider resolves with the data item.
Obtains the target node id for each data item for which an edge 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 target node id to which the targetIdProvider resolves with the data item.