- CItemMapping<TItem, TValue>
Remarks
Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties mapper<TItem, TValue>, mapperFunction<TItem, TValue> and constant<TItem, TValue> should be set on each instance.
This class supports LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> implementations and does not usually have to be instantiated by client code explicitly. Instances of this class are properties of concrete LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> implementations.
Functions, IMapper<K, V>s and constant values are automatically converted to ItemMapping<TItem, TValue>s. For example:
// Constant
new HierarchicalLayoutData({
sourceGroupIds: groupId,
})
// Delegate
new HierarchicalLayoutData({
sourceGroupIds: (edge: IEdge) => edge.tag.sourceGroupId,
})
// Mapper
new HierarchicalLayoutData({ sourceGroupIds: new Mapper() })
// or a JavaScript Map
new HierarchicalLayoutData({ sourceGroupIds: new Map() })Furthermore, the conversion supports a parameter object to initialize the properties. For example:
// Create a new ItemMapping from a JavaScript Map and initialize its 'mapper' with the new Map.
// This also works for the different properties as well.
new HierarchicalLayoutData({
sourceGroupIds: new Map(),
})
// Or, instead of providing the specific property, the 'includes' key can be used
new HierarchicalLayoutData({
sourceGroupIds: {
includes: new Map(),
},
})This class cannot be instantiated
Type Parameters
TItem
- The type of the items that are mapped.
TValue
- The type of the values the items are mapped to.
See Also
Developer's Guide
Members
Properties
See Also
Developer's Guide
See Also
Developer's Guide
Function Details
- key: TItem
- The key of the mapping.
- TValue
- The value or a suitable default that is associated with
key.
See Also
Developer's Guide