veg / phylotree.js

Interactive viewer of phylogenetic trees
http://phylotree.hyphy.org
MIT License
168 stars 72 forks source link

Display support values #397

Closed davidemms closed 2 years ago

davidemms commented 2 years ago

Hi

Does phylotree.js currently offer a way to display support values? If not, is there any way I'd be able to make changes to support it and do you have any suggestions for where I'd need to look?

Many thanks David

stevenweaver commented 2 years ago

Dear @davidemms,

Please take a look at https://observablehq.com/@stevenweaver/internal-node-labels-with-phylotree and see if this will meet your requirements.

Specifically, please see internal-names option in configuration parameters.

renderedTree = tree.render({
  height:height, 
  width:width,
  'left-right-spacing': 'fit-to-size', 
  'align-tips':true,
  'internal-names': true,
  'node-styler': colorNodesByName
});

Please note there was a bug with internal node labels that was resolved in v1.0.10.

Best, Steven

spond commented 2 years ago

Dear @stevenweaver and @davidemms,

I made a few small changes to Steven's excellent example.

  1. Do not right-align node names
  2. Hide root label.

See https://observablehq.com/@spond/internal-node-labels-with-phylotree

Best, Sergei

davidemms commented 2 years ago

Hi Steven and Sergei

Thanks very much to both of you for your help, that worked perfectly.

Best wishes David