Skip to content

Commit 7c3aaf4

Browse files
committed
added if None line for distfun
1 parent b045ba9 commit 7c3aaf4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plotly/tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6208,7 +6208,8 @@ def create_dendrogram(X, orientation="bottom", labels=None,
62086208
if len(s) != 2:
62096209
exceptions.PlotlyError("X should be 2-dimensional array.")
62106210

6211-
distfun = scs.distance.pdist
6211+
if distfun is None:
6212+
distfun = scs.distance.pdist
62126213

62136214
dendrogram = _Dendrogram(X, orientation, labels, colorscale,
62146215
distfun=distfun, linkagefun=linkagefun)
@@ -7160,7 +7161,9 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
71607161
self.sign[self.yaxis] = 1
71617162
else:
71627163
self.sign[self.yaxis] = -1
7163-
distfun = scs.distance.pdist
7164+
7165+
if distfun is None:
7166+
distfun = scs.distance.pdist
71647167

71657168
(dd_traces, xvals, yvals,
71667169
ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale, distfun, linkagefun)

0 commit comments

Comments
 (0)