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:
- Shrinking the node labels to the point that they are unreadable, or
- keep the text at a reasonable size, but overlapping the labels—again resulting in unreadable text.
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:- Sorts the nodes based on their distance to the root
- Greedily assigns spaces to this sorted list of nodes
Of course, PhyloWidget's configuration lets you reverse the sorting rule which governs the occlusion behavior:
- Favor nodes: close to root (default), distant from root