Skip to content

Leaf color

Overview

Leaf colors will change the colors of leaf labels. Similar to branch colors, multiple datasets can be uploaded to a tree, but only one can be shown at a time.

(not all datasets support these modifiers) Supported Key-Value pairs for leaf colors:

Key (case insensitive) Value Description
!Groups or !LegendText comma separated text Legend texts; for example 'group_a,group_b,group_c'
!LegendStyle or !Style rect or circle or star shapes to be plotted before the legend texts; default = rect
!LegendColors or !Colors comma separated color codes or names colors to be applied to the shapes specified by LegendStyle; for example 'red,green,yellow' ; note the number of colors should match the number of legend fields
!Title or !Legend text title of the legend; default = name of the dataset
!ShowLegends 0 or 1 0 : hide legends; 1 : show legends
!opacity float number between 0 to 1 opacity of the dataset

the data

Data are usually tab-delimited three-column texts, with the third column optional. Let me use the tree below to illustrate the usage of the data:

(chicken,((mouse,rat),(chimp,human)));
Example

Example 1

  • first column: the location the first column dictates where the data to be plotted. It usually contains the name of a leaf node, or two leaf names separated by a ','.
chicken
mouse,human
  • second column: color to be applied

For example:

chicken	green
mouse,human	blue
  • third column: optional commands to change the default behavior of current line By default, the color will only apply to the specified leaf label; for example:
## leaf color
human	red

By adding a third column, the default behavior can be changed. Here is a list of choices of this column:

Option (case insensitive) Description
ad apply color to all descendants
prefix apply color to all branches connecting leaf nodes whose name starts with the string specified by the first column
suffix apply color to all branches connecting leaf nodes whose name ends with the string specified by the first column
anywhere apply color to all branches connecting leaf nodes whose name contains the string specified by the first column
toroot apply color to all branches connecting the leaf node and parent nodes all the way to the root

See examples below.

Example

Example 1, 'ad'

Placeholder

## leaf color
human,mouse	pink	ad

Example

Example 2, 'prefix':

Placeholder

## leaf color
ch	yellow	prefix
Example

Example 3, 'suffix':

Placeholder

## leaf color
n	blue	suffix
Example

Example 3, 'anywhere':

Placeholder

## leaf color
m	purple	anywhere

Add leaf color to a collapsed tree

Evolview supports collapsing at internal nodes; collapsed nodes are treated as leaf nodes. It is therefore very straightforward to add leaf color to a collapsed tree. See here for more information.