Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG size not updated on zoom #400

Open
524D opened this issue Sep 28, 2021 · 2 comments
Open

SVG size not updated on zoom #400

524D opened this issue Sep 28, 2021 · 2 comments

Comments

@524D
Copy link

524D commented Sep 28, 2021

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.

@stevenweaver
Copy link
Member

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

@524D
Copy link
Author

524D commented Sep 30, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants