C

EdgesSource<TDataItem>

A class that accepts a collection of objects from the GraphBuilder to build IEdges from.
Inheritance Hierarchy

Remarks

It manages the structural aspects of the graph creation, while the associated edgeCreator<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 edgeCreator.

Parameters

edgeCreator: EdgeCreator<TDataItem>
The creator that is used to create the edges of this source.
sourceIdProvider: function(TDataItem): any
conversion
A function that yields a source node id for each element of the associated data collection in the GraphBuilder.
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(TDataItem): any
conversion
A function that yields a target node id for each element of the associated data collection in the GraphBuilder.
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
idProvider?: function(TDataItem, any): any
conversion
An optional function that yields an id for each element of the associated data collection in the GraphBuilder.
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 the EdgeCreator<TDataItem> for this source, which can be used to adjust the creation behavior.
final
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 the provider that yields a source node id for each element of the associated data collection in the GraphBuilder.
readonlyfinal
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
Gets the provider that yields a target node id for each element of the associated data collection in the GraphBuilder.
readonlyfinal
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

Obtains the source node id for each data item for which an edge is created.
This implementation uses the sourceIdProvider<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 source node id to which the sourceIdProvider<TDataItem> resolves with the data item.
Obtains the target node id for each data item for which an edge is created.
This implementation uses the targetIdProvider<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 target node id to which the targetIdProvider<TDataItem> resolves with the data item.