A class that accepts a collection of objects from the TreeBuilder to build INodes from.
Inheritance Hierarchy
Remarks
It manages the structural aspects of the graph creation, while the associated nodeCreator is responsible for the properties of the created items.
Type Parameters
TDataItem
- The type of the data items in the source.
Members
Show:
Constructors
Parameters
- nodeCreator: NodeCreator<TDataItem>
- The creator that is used to create the nodes of this source.
- parentEdgeCreator: EdgeCreator<TDataItem>
- The creator that is used to create the edges of this source.
- idProvider?: function(TDataItem, any): any
- An optional function that yields an id for each element of the associated data collection in the TreeBuilder.
Properties
Gets or sets a provider that yields an id for each element of the associated data collection in the GraphBuilder.
Gets or sets a provider that yields an id for each element of the associated data collection in the GraphBuilder.
conversionfinal
Gets or sets the NodeCreator<TDataItem> for this source, which can be used to adjust the creation behavior.
Gets or sets the NodeCreator<TDataItem> for this source, which can be used to adjust the creation behavior.
final
Gets or sets the NodeCreator<TDataItem> for this source which can be used to adjust the creation behavior of the edges between child nodes and their parents.
Gets or sets the NodeCreator<TDataItem> for this source which can be used to adjust the creation behavior of the edges between child nodes and their parents.
final
See Also
Developer's Guide
Gets or sets a provider that yields a parent id for each element of the associated data collection in the GraphBuilder.
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
Methods
addChildNodesSource
<TChildDataItem> (childDataProvider: function(TDataItem): any, nodesSource: TreeNodesSource<TChildDataItem>)Binds a collection of child data items to the given nodesSource.
addChildNodesSource
<TChildDataItem> (childDataProvider: function(TDataItem): any, nodesSource: TreeNodesSource<TChildDataItem>)Binds a collection of child data items to the given
nodesSource.final
Parameters
- childDataProvider: function(TDataItem): any
- A function that yields a child data item for each element of the associated data collection in the TreeBuilder.
- nodesSource: TreeNodesSource<TChildDataItem>
- The child node source to which the child data is bound.
createChildNodesSource
<TChildDataItem> (childDataProvider: function(TDataItem): any, idProvider?: function(TChildDataItem, any): any): TreeNodesSource<TChildDataItem>Registers a collection of child data items functioning as child entities for the NodeCreator<TChildDataItem> of the returned TreeNodesSource<TChildDataItem>.
createChildNodesSource
<TChildDataItem> (childDataProvider: function(TDataItem): any, idProvider?: function(TChildDataItem, any): any): TreeNodesSource<TChildDataItem>Registers a collection of child data items functioning as child entities for the NodeCreator<TChildDataItem> of the returned TreeNodesSource<TChildDataItem>.
The node defaults and edge defaults of this newly created source cascade with the defaults of this source.
final
Parameters
- childDataProvider: function(TDataItem): any
- A function that yields a child data item for each element of the associated data collection in the TreeBuilder.
- idProvider?: function(TChildDataItem, any): any
- An optional function that yields an id for each element of the associated data collection in the TreeBuilder.
Return Value
- TreeNodesSource<TChildDataItem>
- A TreeNodesSource<TDataItem> with the child data added.
Optionally obtains the id for the parent or null given each data item for which a node is created.
Optionally obtains the id for the parent or
null given each data item for which a node is created.This implementation uses the parentIdProvider 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
- The id of another node or
nullin case the node should be put in the root of the hierarchy.