Skip to content

Leaf background color

Overview

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

Here is an example:

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
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 background color
mouse	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 the leaf labels of all descendants
prefix apply color to all leaf labels that start with the string specified by the first column
suffix apply color to all leaf labels that end with the string specified by the first column
anywhere apply color to leaf labels that contain the string specified by the first column

See examples below.

Example

Example 1, 'ad'

Placeholder

## leaf background color
human,mouse	lightblue	ad
Example

Example 2, 'prefix':

Placeholder

## leaf background color
mouse,human	grey	ad
ch	yellow	prefix
Example

Example 3, 'suffix':

Placeholder

## leaf background color
chicken,human	grey	ad
n	blue	suffix

Add leaf background 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 background color to a collapsed tree. See here for more information.