Step 3 of 10: Labels

What to do with all these labels?

A common problem with phylogenetic visualization is what to do when a tree is viewed at a low magnification.

Most programs tend to "solve" the problem by doing one of the following:

  1. Shrinking the node labels to the point that they are unreadable, or
  2. keep the text at a reasonable size, but overlapping the labels—again resulting in unreadable text.
While option (a) at least has the advantage of preserving a sense of scale, it is still far from optimal: drawing node labels with an unreadable font size is useless to the user, who should be able to get at least at least some information from the labels at all times! Otherwise, why should we bother drawing them in the first place?

In an attempt to yield a workable solution to this issue, PhyloWidget includes the concept of a minimum text size. This setting lets the user specify how small the node labels should be allowed to get; when the minimum text size is set to zero, we are following strategy (a) from above, and when set to a normal size, we are approximating strategy (b). However, there is always one importance between PhyloWidget an strategy (b): we use a process we call competetive occlusion to ensure that only one label is ever drawn in a given amount of space.

Label occlusion: tidying up your tree

Try zooming in and out of the tree shown on your left with one of the following settings for the minimum text size: It may not be entirely clear what determines whether a given node is occluded or shown. But, keeping in mind that each node in this tree is labeled according to its branch distance to the root node, try doing the same zooming with a shuffled version of the same tree: Got it yet? PhyloWidget's competetive occlusion algorithm does the following:
  1. Sorts the nodes based on their distance to the root
  2. Greedily assigns spaces to this sorted list of nodes
As a result, nodes which are "closer" to the root in terms of branch length are generally more likely to be shown. The biological justification for this occlusion process is that, at a low zoom level, we are probably more interested in seeing those species which diverged from the common ancestor at the earliest point in time, rather than those which diverged later on.

Of course, PhyloWidget's configuration lets you reverse the sorting rule which governs the occlusion behavior:

Do you agree with our decision on how to occlude node labels? Let us know if not!

Created with Processing.