-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Dendrogram class #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dendrogram class #274
Changes from 1 commit
3d6dbb9
2d9b88c
819e41e
3781906
31efa33
02beb6c
bfd3cca
ff98cb7
4afc8c9
57e15bd
b7d3d31
44cdece
16c74c1
ebff53e
0de0349
20fc40c
88842b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2932,8 +2932,8 @@ class _Dendrogram(FigureFactory): | |
| py.iplot( fig, filename='Dendro', validate=False )''' | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🐄 Just some unnecessary whitespace :) |
||
| def __init__(self, X, orientation='bottom', labels=None, colorscale=None, \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🐄 (style tip) the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 44cdece |
||
| width=700, height=700, xaxis='xaxis', yaxis='yaxis' ): | ||
| ''' Draw a 2d dendrogram tree | ||
| width="100%", height="100%", xaxis='xaxis', yaxis='yaxis' ): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ''' Draw a 2d dendrogram tree | ||
| X: Heatmap matrix as array of arrays | ||
| orientation: 'top', 'right', 'bottom', or 'left' | ||
| labels: List of axis category labels | ||
|
|
@@ -3009,7 +3009,7 @@ def set_axis_layout(self, axis_key): | |
|
|
||
| axis_defaults = { | ||
| 'type': 'linear', | ||
| 'ticks': 'inside', | ||
| 'ticks': 'outside', | ||
| 'mirror': 'allticks', | ||
| 'rangemode': 'tozero', | ||
| 'showticklabels': True, | ||
|
|
@@ -3018,29 +3018,29 @@ def set_axis_layout(self, axis_key): | |
| 'showline': True, | ||
| } | ||
|
|
||
| if self.labels != None: | ||
| if len(self.labels) != 0: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
nvm, looks like it wouldn't actually raise an error otherwise. i think i see why you did that. |
||
| axis_key_labels = self.xaxis | ||
| if self.orientation in ['left','right']: | ||
| if self.orientation in ['left','right']: | ||
| axis_key_labels = self.yaxis | ||
| if axis_key_labels not in self.layout: | ||
| self.layout[axis_key_labels] = {} | ||
| self.layout[axis_key_labels]['tickvals'] = [ea*self.sign[axis_key] for ea in self.zero_vals] | ||
| self.layout[axis_key_labels]['ticktext'] = self.labels | ||
| self.layout[axis_key_labels]['tickmode'] = 'array' | ||
|
|
||
| self.layout[axis_key].update(axis_defaults) | ||
| self.layout[axis_key].update(axis_defaults) | ||
|
|
||
| return self.layout[axis_key] | ||
|
|
||
| def set_figure_layout(self, width, height): | ||
| def set_figure_layout(self, width, height): | ||
| ''' Sets and returns default layout object for dendrogram figure ''' | ||
|
|
||
| self.layout.update({ | ||
| 'showlegend':False, | ||
| 'autoscale':False, | ||
| 'hovermode':'closest', | ||
| 'width':width, | ||
| 'width':height | ||
| 'showlegend':False, | ||
| 'autoscale':False, | ||
| 'hovermode':'closest', | ||
| 'width':width, | ||
| 'width': height | ||
| }) | ||
|
|
||
| self.set_axis_layout(self.xaxis) | ||
|
|
||