veidenberg / wasabi

Wasabi is a web-based tool for evolutionary sequence analysis. Homepage: http://wasabiapp.org
GNU Affero General Public License v3.0
16 stars 7 forks source link

Scale bar for branch lenghts #11

Closed a1an77 closed 6 years ago

a1an77 commented 6 years ago

The tree shows the different branch lengths but there is no scale bar at which the user can get an idea of the actual meaning of the visualized branch lengths. A scale bar would greatly improve usability of the tool.

a1an77 commented 6 years ago

I tried using the showScaleBar parameter in jsphylosvg but it seems a bit too rudimentary (label crosses the tree in my case). I think the best option would be to show the bar under the tree (same level as the horizontal scrollbar for the sequence area) in its own div.

a1an77 commented 6 years ago

It looks like there is a problem causing the scale bar label to be drawn in the wrong svg (svg2).

a1an77 commented 6 years ago

I've now modified the scale bar in jsphylosvg to be dynamically computed (showScaleBar = "auto") and restricted to at most 80px before percent scaling to try to avoid overlap with the tree. Not the best solution but still better than no scale bar at all.

veidenberg commented 6 years ago

There is no place on the tree canvas or length limit that would prevent scalebar overlap with any tree. I resolved the issue by drawing the scalebar below the tree, outside of the canvas. The scalebar will resize with the tree and can be enabled/disabled from the settings dialog.

a1an77 commented 6 years ago

That is definitely the best solution. I can't find the option in the dialog in the online demo, is it maybe out of sync? Is the scale bar dynamically computed (meaning its value will change accordingly to actual branch lengths to keep it within a defined length limit, hence avoiding very long or very short bars)?

veidenberg commented 6 years ago

The toggle is in tree settings (tools->settings->arrow with “tree leaf labels”). Scale bar takes the length of the largest decimal unit (10/1/0.1/..) that fits the tree e.g. the tree length unit.