A registry that can be used to store IMapper<K,V> implementations by tag.
Remarks
Related Reading in the Developer's Guide
IMapperRegistry
is described in the section Associating Data with Graph Elements.Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.IMapperRegistry
See Also
Properties
Gets an enumerable over all tags that have been used to register mapper implementations with this interface.
Methods
Registers a mapper for the given tag.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The key type for the mapper.
- V
- The value type for the mapper.
Parameters
A map of options to pass to the method.
- keyType - Class
- The key type for the mapper.
- valueType - Class
- The value type for the mapper.
- tag - Object
- The tag to use.
- mapper - IMapper<K,V>
- The mapper to register.
See Also
createConstantMapper
<K,V>(keyType: Class, valueType: Class, tag: Object, constant: V) : IMapper<K,V>Creates a read-only IMapper<K,V> implementation and adds it to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- keyType - Class
- valueType - Class
- tag - Object
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<K,V>
- The newly created mapper instance.
See Also
Creates a simple read-only IMapper<K,V> implementation with key type INode and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates a simple read-only IMapper<K,V> implementation with key type IEdge and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates a simple read-only IMapper<K,V> implementation with key type ILabel and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
- constant - V
- The value to yield during IMapper<K,V> reads.
Returns
- ↪IMapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.createDelegateMapper
<K,V>(keyType: Class, valueType: Class, tag: Object, getter: function(K):V) : IMapper<K,V>Creates a delegate-based read-only IMapper<K,V> implementation and adds it to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- keyType - Class
- valueType - Class
- tag - Object
- The tag.
- getter - function(K):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Signature Details
function(key: K) : V
A delegate that mimics the get access.Parameters
- key - K
- The key of the mapping.
Returns
- V
- The value or a suitable default that is associated with
key
.
Returns
- ↪IMapper<K,V>
- The newly created mapper instance.
See Also
Creates a delegate-based read-only IMapper<K,V> implementation with key type INode and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
- getter - function(INode):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates a delegate-based read-only IMapper<K,V> implementation with key type IEdge and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
- getter - function(IEdge):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates a delegate-based read-only IMapper<K,V> implementation with key type ILabel and adds it to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
- getter - function(ILabel):V
- The getter delegate to which IMapper<K,V> reads will be delegated.
Returns
- ↪IMapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates and adds a new Mapper<K,V> to the registry
using the provided tag
.
Remarks
tag
, it will be replaced.Type Parameters
- K
- The type of the keys of the mapper.
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
Returns
- ↪Mapper<K,V>
- The newly created mapper instance.
See Also
Creates and adds a new Mapper<K,V> with key type INode to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - NodeDpKey<V>
- The tag.
Returns
- ↪Mapper<INode,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates and adds a new Mapper<K,V> with key type ILabel to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - ILabelLayoutDpKey<V>
- The tag.
Returns
- ↪Mapper<ILabel,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Creates and adds a new Mapper<K,V> with key type IEdge to the registry
using the provided tag
.
Remarks
tag
. If there already was a mapper for tag
, it will be replaced.Type Parameters
- V
- The type of the values of the mapper.
Parameters
A map of options to pass to the method.
- tag - EdgeDpKey<V>
- The tag.
Returns
- ↪Mapper<IEdge,V>
- The newly created mapper instance.
See Also
Class.ensure(LayoutExecutor)
More information.Returns a mapper that has previously been registered with this instance for the given tag.
Type Parameters
- K
- The key type for the mapper.
- V
- The value type for the mapper.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag to use to look up the mapper.
Returns
- ↪IMapper<K,V>
- The previously registered instance or
null
.
See Also
Gets the mapper meta data for the mapper that is registered using the tag
.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag.
Returns
- ↪MapperMetadata
- The meta data or
null
if there is no such mapper registered for the given tag.
Sets the mapper meta data for the mapper that has been registered using the provided tag
.
Parameters
A map of options to pass to the method.
- tag - Object
- The tag.
- metadata - MapperMetadata
- The meta data to store with the mapper.