Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
merenlin wants to merge 17 commits into plotly:master from merenlin:dendrogram
Closed
(追記)
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
3d6dbb9
Added Dendrogram class and tests
merenlin Jul 28, 2015
2d9b88c
Added a small validator
merenlin Aug 4, 2015
819e41e
updates after renaming
merenlin Aug 4, 2015
3781906
Moved dendrogram tests to optional
merenlin Aug 12, 2015
31efa33
Protected scipy imports
merenlin Aug 12, 2015
02beb6c
Fixed typos, docstring and return value
merenlin Aug 12, 2015
bfd3cca
Typo
merenlin Aug 12, 2015
ff98cb7
Fixing default colors mapping
merenlin Aug 15, 2015
4afc8c9
Minor styling changes and fixes
merenlin Aug 15, 2015
57e15bd
pep8 and docsrings
merenlin Aug 15, 2015
b7d3d31
pep8 in tests
merenlin Aug 15, 2015
44cdece
Styling and imports
merenlin Aug 28, 2015
16c74c1
Cleanup of labels, axis and tests
merenlin Sep 1, 2015
ebff53e
Added more tests and fixed axis reference
merenlin Sep 1, 2015
0de0349
another fix for axis confusion
merenlin Sep 1, 2015
20fc40c
Added colorscale test
merenlin Sep 4, 2015
88842b1
cow comments
merenlin Sep 4, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor styling changes and fixes
  • Loading branch information
merenlin committed Aug 15, 2015
commit 4afc8c99c6a4b1e6585a37ecacc439bfed4027d5
24 changes: 12 additions & 12 deletions plotly/tools.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2932,8 +2932,8 @@ class _Dendrogram(FigureFactory):
py.iplot( fig, filename='Dendro', validate=False )'''

Copy link
Contributor

@theengineear theengineear Aug 24, 2015

Choose a reason for hiding this comment

The 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, \
Copy link
Contributor

@theengineear theengineear Aug 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄 (style tip) the \ for a line break while inside parentheses is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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' ):
Copy link
Contributor

@theengineear theengineear Aug 24, 2015

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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,
Expand All @@ -3018,29 +3018,29 @@ def set_axis_layout(self, axis_key):
'showline': True,
}

if self.labels != None:
if len(self.labels) != 0:
Copy link
Contributor

@theengineear theengineear Aug 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄 if self.labels:? (追記ここまで)

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)
Expand Down

AltStyle によって変換されたページ (->オリジナル) /