tntvis / tnt

Visualization of trees and track based annotations
Apache License 2.0
6 stars 2 forks source link

color inner nodes according to evolutionary event #4

Open fabsta opened 10 years ago

fabsta commented 10 years ago

inner nodes should be colored according to speciation / duplication / gene_split event

fabsta commented 10 years ago

done. I added a node_color to tree_vis. Now nodes can be colored e.g. var node_event_color =function(d) { if (d.events && d.events.type && d.events.type === 'speciation') { return 'green'; } else if (d.events && d.events.type && d.events.type === 'duplication') { return 'red'; } else { return 'orange'; } };

emepyc commented 10 years ago

After the change foreground_color is only used for links, so I have changed it to link_color. It would also be nice if the color is recomputed dynamically (on update), so different schemas can be used in the same tree.