524D / compareMS2

Compare samples by MS2 spectra
MIT License
3 stars 0 forks source link

Adding zoom controls for tree #7

Open magnuspalmblad opened 3 years ago

magnuspalmblad commented 3 years ago

While the tree updates correctly and vertical scroll bar provides access to the entire tree, it would be nice to be able to have zoom controls to display the full tree and zoom into an individual branch. Other tools, such as MEGA, keep the label font size constant, but drops some labels when the text would overlap. I think compareMS2 could have a similar behavior. Text that is too small to read is not very useful anyway. And even when only some leaf nodes are labeled, they help identify the (major) branches.

Specifically, we would like controls for: zoom in zoom out restore to default fit to window (optional)

magnuspalmblad commented 3 years ago

I did notice there is a general zoom function through the mouse or touchpad, which also scales the font, but additional zoom controls that do not change the font but rather omits every other, or 2/3, or 3/4, ... labels would be a nice complement.

524D commented 3 years ago

The phylotree javascript library doesn't directly support zooming while keeping the font size constant. Also, the library doesn't update the scale when zooming. The only option seems to be implement zoom by changing the size of the SVG area and redrawing the tree.

magnuspalmblad commented 3 years ago

OK, so perhaps we can give this lower priority for now, even though the only option you suggest sounds reasonable. In a first instance, we could just change the size of the SVG. In the second, we could look into omitting some of the labels when they start to overlap.