@@ -33,8 +33,10 @@ def create_dendrogram(X, orientation="bottom", labels=None,
3333 :param (str) orientation: 'top', 'right', 'bottom', or 'left'
3434 :param (list) labels: List of axis category labels(observation labels)
3535 :param (list) colorscale: Optional colorscale for dendrogram tree
36- :param (function) distfun: Function to compute the pairwise distance from the observations
37- :param (function) linkagefun: Function to compute the linkage matrix from the pairwise distances
36+ :param (function) distfun: Function to compute the pairwise distance from
37+ the observations
38+ :param (function) linkagefun: Function to compute the linkage matrix from
39+ the pairwise distances
3840
3941 clusters
4042
@@ -106,7 +108,8 @@ class _Dendrogram(object):
106108
107109 def __init__ (self , X , orientation = 'bottom' , labels = None , colorscale = None ,
108110 width = "100%" , height = "100%" , xaxis = 'xaxis' , yaxis = 'yaxis' ,
109- distfun = None , linkagefun = lambda x : sch .linkage (x , 'complete' )):
111+ distfun = None ,
112+ linkagefun = lambda x : sch .linkage (x , 'complete' )):
110113 self .orientation = orientation
111114 self .labels = labels
112115 self .xaxis = xaxis
@@ -130,7 +133,9 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
130133 distfun = scs .distance .pdist
131134
132135 (dd_traces , xvals , yvals ,
133- ordered_labels , leaves ) = self .get_dendrogram_traces (X , colorscale , distfun , linkagefun )
136+ ordered_labels , leaves ) = self .get_dendrogram_traces (X , colorscale ,
137+ distfun ,
138+ linkagefun )
134139
135140 self .labels = ordered_labels
136141 self .leaves = leaves
@@ -245,8 +250,10 @@ def get_dendrogram_traces(self, X, colorscale, distfun, linkagefun):
245250
246251 :param (ndarray) X: Matrix of observations as array of arrays
247252 :param (list) colorscale: Color scale for dendrogram tree clusters
248- :param (function) distfun: Function to compute the pairwise distance from the observations
249- :param (function) linkagefun: Function to compute the linkage matrix from the pairwise distances
253+ :param (function) distfun: Function to compute the pairwise distance
254+ from the observations
255+ :param (function) linkagefun: Function to compute the linkage matrix
256+ from the pairwise distances
250257 :rtype (tuple): Contains all the traces in the following order:
251258 (a) trace_list: List of Plotly trace objects for dendrogram tree
252259 (b) icoord: All X points of the dendrogram tree as array of arrays
0 commit comments