OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
91 stars 20 forks source link

Tidy up tree colouring styles #695

Open jrosindell opened 10 months ago

jrosindell commented 10 months ago

I'm setting up an issue to contain thoughts on development of colourings of the tree. This is following some ideas suggested by @wolfmanstout for letting extinction risk colourings percolate up the tree branches using the already pre calculated summary data on interior nodes about this.

Issues that came up were interaction between this and other kinds of information that we've thought about showing in the branch colouring (e.g. highlights, common ancestors, polytomies). Also the hacky solution for colour blind friendly accessibility in which every colour scheme has a colour blind counterpart that counts as just an independent colour scheme only with _CBL appended to name.

I like to begin describing things in terms of the ultimate solution see what people think, then scale back from there with a step by step development plan. To that end I think....

  1. There are two kinds of colour scheme, a colour scheme for leaves and a colour scheme for branches.
  2. Every colour scheme must have a colour blind friendly mode baked into it
  3. The tree settings allows the user (or tour controller) to choose a colour scheme for leaves and a colour scheme for the branches.
  4. It's OK to combine any leaf colour scheme with any branch colour scheme BUT it's never allowed to have two or more different colour scheme loaded on the branches at the same time, nor is it allowed to have two or more colour schemes loaded on the leaves.
  5. The polytomy colouring with light and dark grey will be one possible colour scheme of the branches. The averaged extinction risk of branches will be another possible colour scheme for branches (Thanks to @wolfmanstout for doing some work on this one). Any highlights for common ancestor mode would be a third which is specific to what's put in the search. Other ideas (like periods of geological history), number of descendent species are easy to imagine and could be implemented in future.
  6. A new 'layers' button allows users to choose a colouring for leaves and another for branches. The UX around that is what enables users to see a popup with the colour gradient or key etc. The layers UX will be designed as a future project.

A cut back intermediate step to this end would be to divorce leaf and branch colourings in the colour scheme code, let there be a plain branch colouring that's set by the common ancestor feature, and retain the same UX as we have now, hiding from users that when they select a colour scheme they are in fact selecting a pair of independent things.

jrosindell commented 10 months ago

A few related issues to reference here....

davidebbo commented 10 months ago

Does the term 'branches' here include interior nodes, or could that be treated as a third concept with its separate scheme? i.e. leaves vs interior nodes vs branches.

We should also keep the Extinct Species project in mind, to make sure we end up with a meaningful color scheme for that scenario. In particular:

jrosindell commented 10 months ago

Good thoughts @davidebbo - actually I too wondered about nodes as a third scheme but didn't want to over complicate things.... In many cases we'll just consider nodes as being like branches. I think it's a good idea to bear nodes in mind though.

With regards to extinct species.... I think they are somehow part of the fundamental tree topology and should be reflected as such in addition to any colouring options. The colours may be switched off whilst the fundamental topology is baked in. We have this already https://www.onezoom.org/life/@Dinornis_robustus=208456 and used a circle rather than a leaf for it. I quite like this difference as a leaf is more synonymous with life somehow. Another (not implemented) idea would be to shorten the branches but a small but perceptible amount if leading to an extinct species.

Love the idea of geological period of extinction for the leaves.... this would actually go hand in hand with a colour scheme showing geological period on branches - if the branches terminate early then it's naturally that they flood the leaf with that colour rather than the present day colour.

For the average extinction risk scheme put forward by @wolfmanstout I think you would discount extinct species i.e. they don't contribute to the average - just as is done for data deficient and not evaluated species.

Most wild idea (researcher hat on now) use mappings to probabilities of extinction within a given timeframe and calculate for each branch the probability of losing all living descendants hence parts of the tree near the tips will be coloured based on endangerment to that branch.

davidebbo commented 10 months ago

I feel that there are two very different categories of extinctions, that call for different handling:

  1. Recent extinctions, caused by human activity: they tend to be closely related to extant species, and there should be a heavy focus on preservation. Here, a risk based coloring approach makes a lot of sense.
  2. Ancient extensions, like the (non-avian) dinosaurs. They are super interesting in their own way, but preservation is not in the picture. Here, it makes more sense to focus on emphasizing the geological period.

This ties into the discussion in https://github.com/OneZoom/tree-build/issues/43, and on whether we want these to join the main tree or be kept separate.

wolfmanstout commented 10 months ago

Most wild idea (researcher hat on now) use mappings to probabilities of extinction within a given timeframe and calculate for each branch the probability of losing all living descendants hence parts of the tree near the tips will be coloured based on endangerment to that branch.

Yeah, this was basically what I had in mind as the scientific justification for coloring branches based on the averages of their non-extinct child nodes (in addition to the aesthetic and navigability value). In practice, the actual risk of extinction of a branch is likely to be lower than the average of the leaves (depending on how independent the extinction of each leaf is). But I think an average color is intuitive enough and will provide a good spread of colors so we aren't colouring most branches green (which isn't exactly helping with the message of extinction risk).