Skip to content

Commit

Permalink
Merge pull request #1302 from nextstrain/tree-behind-legend
Browse files Browse the repository at this point in the history
Legend no longer obscures branches/tips.
  • Loading branch information
jameshadfield authored Mar 10, 2021
2 parents 1069d30 + 049a14d commit e880ea2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/tree/phyloTree/layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ export const mapToScreen = function mapToScreen() {
right: this.params.margins.right,
top: this.params.margins.top,
bottom: this.params.margins.bottom};
if (this.layout==="rect" || this.layout==="unrooted") {
// legend is 12px, but 6px is enough to prevent tips being obscured
tmpMargins.top += 6;
}
const inViewTerminalNodes = this.nodes.filter((d) => d.terminal).filter((d) => d.inView);
if (inViewTerminalNodes.length < this.params.tipLabelBreakL1) {

Expand Down

0 comments on commit e880ea2

Please sign in to comment.