Skip to content

Commit 4afc8c9

Browse files
committed
Minor styling changes and fixes
1 parent ff98cb7 commit 4afc8c9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

plotly/tools.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,8 +2932,8 @@ class _Dendrogram(FigureFactory):
29322932
py.iplot( fig, filename='Dendro', validate=False )'''
29332933

29342934
def __init__(self, X, orientation='bottom', labels=None, colorscale=None, \
2935-
width=700, height=700, xaxis='xaxis', yaxis='yaxis' ):
2936-
''' Draw a 2d dendrogram tree
2935+
width="100%", height="100%", xaxis='xaxis', yaxis='yaxis' ):
2936+
''' Draw a 2d dendrogram tree
29372937
X: Heatmap matrix as array of arrays
29382938
orientation: 'top', 'right', 'bottom', or 'left'
29392939
labels: List of axis category labels
@@ -3009,7 +3009,7 @@ def set_axis_layout(self, axis_key):
30093009

30103010
axis_defaults = {
30113011
'type': 'linear',
3012-
'ticks': 'inside',
3012+
'ticks': 'outside',
30133013
'mirror': 'allticks',
30143014
'rangemode': 'tozero',
30153015
'showticklabels': True,
@@ -3018,29 +3018,29 @@ def set_axis_layout(self, axis_key):
30183018
'showline': True,
30193019
}
30203020

3021-
if self.labels != None:
3021+
if len(self.labels) != 0:
30223022
axis_key_labels = self.xaxis
3023-
if self.orientation in ['left','right']:
3023+
if self.orientation in ['left', 'right']:
30243024
axis_key_labels = self.yaxis
30253025
if axis_key_labels not in self.layout:
30263026
self.layout[axis_key_labels] = {}
30273027
self.layout[axis_key_labels]['tickvals'] = [ea*self.sign[axis_key] for ea in self.zero_vals]
30283028
self.layout[axis_key_labels]['ticktext'] = self.labels
30293029
self.layout[axis_key_labels]['tickmode'] = 'array'
30303030

3031-
self.layout[axis_key].update( axis_defaults )
3031+
self.layout[axis_key].update(axis_defaults)
30323032

30333033
return self.layout[axis_key]
30343034

3035-
def set_figure_layout( self, width, height ):
3035+
def set_figure_layout(self, width, height):
30363036
''' Sets and returns default layout object for dendrogram figure '''
30373037

30383038
self.layout.update({
3039-
'showlegend':False,
3040-
'autoscale':False,
3041-
'hovermode':'closest',
3042-
'width':width,
3043-
'width':height
3039+
'showlegend': False,
3040+
'autoscale': False,
3041+
'hovermode': 'closest',
3042+
'width': width,
3043+
'width': height
30443044
})
30453045

30463046
self.set_axis_layout(self.xaxis)

0 commit comments

Comments
 (0)