All examples By author By category About

emepyc

different labels in the same tree

TnT tree example showing how to render different labels in the same tree. The example first defines two different label renderers (two instances of tnt.tree.label.text). One to render internal labels taking the text from its branch length node property, and placing the labels in the upper left side of the node. The second to render leaf labels containing the name property of the node (default property) and placing them at the right of the node (default position). A third renderer (a general tnt.tree.label) uses the display and transform methods of one or the other depending on the node's type (leaf or not). This last label renderer is the one passed to the tree visualization.