This class provides the result of hierarchical clustering algorithms by means of a binary tree structure.
Remarks
The dendrogram is created using the agglomerative strategy (i.e., a bottom-up approach) based on the following steps:
- At the beginning (i.e., at level
0
), each node belongs to its own cluster. At this point, each node of the original graph (the one that will be clustered) is mapped to one of the dendrogram nodes that represent a leaf node (i.e., a node with no children). - At each step, pairs of clusters are merged while moving up to the hierarchy. In this case, a new dendrogram node is created and the corresponding dissimilarity value between the two merged clusters can be obtained using getDissimilarityValue. The dissimilarity values are monotone increasing starting from zero which corresponds to the leaf nodes of the dendrogram.
- The algorithm continues until all nodes belong to the same cluster. At this point, the root of the dendrogram is reached and can be obtained using method root.
The dendrogram is a binary tree that is directed from the root to the leaves. This means that one can iterate the dendrogram starting with the root node, moving on to its children, then moving on to their children and so on.
From each node of the dendrogram, it is possible to retrieve the set of nodes of the original graph that belong to this dendrogram node using getClusterNodes. This method returns an array of YNodeLists that contain the nodes of all clusters that are merged when this dendrogram node was created. For example, say that clusters C1 = {v1, v2}
and C2 = {v3, v4}
are merged, where {v1, v2, v3, v4}
are nodes of the original graph. Say that dendrogram node u
is created by this merging. Then, the cluster nodes of u
will be returned as two YNodeLists where the first contains nodes v1, v2
and the second v3, v4
.
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.Dendrogram
See Also
null
.Properties
Gets the root node of the dendrogram.
Remarks
Methods
Returns a YNodeList that contains the child nodes of the given parent node.
Returns an array of YNodeLists that contain the nodes of the original graph that are associated with the given dendrogram node.
Remarks
C1 = {v1, v2}
and C2 = {v3, v4}
are merged, where {v1, v2, v3, v4}
are nodes of the original graph. Say that dendrogram node u
is created by this merging. Then, the cluster nodes of u
will be returned as two YNodeLists where the first contains nodes v1, v2
and the second v3, v4
.Parameters
A map of options to pass to the method.
- node - YNode
- the given dendrogram node
Returns
- ↪YNodeList[]
- an array of YNodeLists that contain the nodes of the original graph that are associated with the given dendrogram node
Returns the dissimilarity value associated with the given node of the dendrogram.
Returns the level of the given node of the dendrogram.
Returns the node of the dendrogram that belongs to the given level index.
Remarks
null
.Parameters
A map of options to pass to the method.
- level - number
- the given level index
Returns
- ↪YNode
- the node of the dendrogram that belongs to the given level index or
null
if there exists no level with the given index.
Throws
- Exception({ name: 'ArgumentError' })
- if the given level is negative or greater than the node count minus one.
Returns the node of original graph that is mapped with the given leaf node of the dendrogram.
Parameters
A map of options to pass to the method.
- node - YNode
- the given leaf node
Returns
- ↪YNode
- the node of original graph that is mapped with the given leaf node or
null
if the given node is an inner dendrogram node
null
if the given node is not a leaf node.Returns whether or not the given dendrogram node is a leaf node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- a dendrogram node
Returns
- ↪boolean
true
if the given node is a leaf node,false
otherwise