phylotree.js icon indicating copy to clipboard operation
phylotree.js copied to clipboard

SVG size not updated on zoom

Open 524D opened this issue 3 years ago • 2 comments

When zoom is enabled, the tree size can be zoomed but the picture remains clipped to the original limits. This is probably because the size of the SVG container is not updated. Updating the container size would make zooming much more useful. I have tested this by setting 'zoom': true in the phylotree.hyphy.org sample.

524D avatar Sep 28 '21 17:09 524D

Hi @524D,

Most examples of d3.zoom do not increase the container size. This behavior could prove erratic on fixed-width websites. Have you considered using your operating system's zoom feature?

Best, Steven

stevenweaver avatar Sep 29 '21 22:09 stevenweaver

Hi @stevenweaver ,

Thanks for your answer!

I'm not competent in D3 programming so I don't know how zooming works there. However, on a fixed-width website I think a user would expect that scroll bars pop up when zooming beyond the available size (e.g. by embedding the SVG in an "overflow=auto" style block element).

I'm using Phylotree in an electron app, where the tree is shown as part of a normal desktop application. Sometimes the trees in this app only have 6 leaves, those small trees just look nicer and can be examined better when zooming in. If there is another way to increase the size that would also help of course. Currently, without zooming, the tree is displayed quite small (left-right-spacing/top-bottom-spacing="fixed-step") or very spread-out with thin edges and small fonts (*-spacing = "fit-to-size").

Zooming in this case is not meant for accessibility/poor vision, so I don't think the OS zoom feature is something many users would want to use.

Best, Rob

524D avatar Sep 30 '21 09:09 524D