Skip to content

Commit

Permalink
default_layouts.py: Fix showing the distance for leaves too.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordibc committed Nov 6, 2023
1 parent ae0ac4c commit 0750647
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ete4/smartview/renderer/layouts/default_layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ def _get_layout_branch_attr(attr, pos, name=None,
padding_y=padding_y)

def layout_fn(node):
if not node.is_leaf and (node.dist is None or node.dist > 0):
node.add_face(branch_attr_face, position=pos, column=0)
node.add_face(branch_attr_face, position=pos, column=0,
collapsed_only=True)
# Skip adding faces in the following cases:
if (attr not in node.props or # missing property
node.dist == 0 or # no space for drawing
node.is_leaf and attr == 'support'): # should be 1
return # do not add faces

node.add_face(branch_attr_face, position=pos, column=0)
node.add_face(branch_attr_face, position=pos, column=0,
collapsed_only=True)

return layout_fn


Expand Down

0 comments on commit 0750647

Please sign in to comment.