Remarks
Type Parameters
TDataItem
- The type of the data items in the source.
Members
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): anyconversion
- An optional function that yields an id for each element of the associated data collection in the TreeBuilder.A callback that provides an unique identifier for the
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.
Return Value- any
Properties
Gets or sets a provider that yields an id for each element of the associated data collection in the GraphBuilder.
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.
- 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.
- any
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 of the edges between child nodes and their parents.
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.
TValue for the given dataItem.- dataItem: TDataItem
- The data item for which a value shall be provided.
- any
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>)nodesSource.Parameters
- childDataProvider: function(TDataItem): anyconversion
- A function that yields a child data item for each element of the associated data collection in the TreeBuilder.A callback that provides an instance of type
TValuefor the givendataItem.Parameters- dataItem: TDataItem
- The data item for which a value shall be provided.
Return Value- any
- 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>Parameters
- childDataProvider: function(TDataItem): anyconversion
- A function that yields a child data item for each element of the associated data collection in the TreeBuilder.A callback that provides an instance of type
TValuefor the givendataItem.Parameters- dataItem: TDataItem
- The data item for which a value shall be provided.
Return Value- any
- idProvider?: function(TChildDataItem, any): anyconversion
- An optional function that yields an id for each element of the associated data collection in the TreeBuilder.A callback that provides an unique identifier for the
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: TChildDataItem
- 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
- 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.
null given each data item for which a node is created.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.