An interface that determines the distance between two nodes of a graph.
Inheritance Hierarchy
INodeDistanceProvider
Remarks
It is used by the hierarchical clustering algorithm in order to determine the distance between any two nodes of a graph.
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.INodeDistanceProvider
See Also
GroupAlgorithm.hierarchicalClustering(Graph,number,INodeMap,INodeDistanceProvider,Linkage),
GroupAlgorithm.hierarchicalClustering(Graph,INodeMap,INodeDistanceProvider,Linkage,number),
GroupAlgorithm.hierarchicalClustering(Graph,INodeDistanceProvider,Linkage)
Methods
Returns the distance between two given nodes of a graph.
Remarks
Implementations of this method have to guarantee that the returned value is greater or equal to zero. Furthermore, the distances between two nodes have to be symmetric, i.e., the distance between node
n1
and n2
is equal to the distance between node n2
and n1
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
Returns
- ↪number
- the distance between the two given nodes
Static Methods
Creates an implementation of the interface INodeDistanceProvider by using the given function as implementation for its getDistance method.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- getDistance - function(YNode, YNode):number
- A function for INodeDistanceProvider's single abstract method getDistance.
Returns
- ↪INodeDistanceProvider
- An instance of the INodeDistanceProvider interface based on the given function.