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

Zooming function #7

Open
Georgva opened this issue Sep 24, 2020 · 3 comments
Open

Zooming function #7

Georgva opened this issue Sep 24, 2020 · 3 comments

Comments

@Georgva
Copy link

Georgva commented Sep 24, 2020

Hi there,

first of all, this is a great library!

I wanted to know if there is a possibility to provide a zooming function?
I would like to use your library for the creation of trees for single cells.
Since there are always a lot of them but I would like to see them without being too small/ colliding, so zooming and perhaps a dragging function would be great!

Since I am new to this topic I don't know how fast such a thing is implemented, still I would be glad to hear from you

@jtmccr1
Copy link
Collaborator

jtmccr1 commented Sep 24, 2020

I'm happy you've found it useful.

I don't have much experience with d3.zoom and drag, but I had hoped that it would be relatively straightforward to add d3 zoom to a figure. I haven't been able to get it working, but I'm not sure yet if that's a problem with my d3 zoom code or indicative of a conflict somewhere deeper. I'd like to take another look when I get chance, but I'm not sure when that will be.

In the meantime, the is a 'rectangularZoomedLayout' that can take a tree node and returns a layout function that only displays the child clades. I have used it to zoom in on clades of big trees before. It might meet your needs. There's an example on how it works here: https://observablehq.com/@jtmccr1/zoom-layout-example.

@Georgva
Copy link
Author

Georgva commented Sep 26, 2020

Wow, thank you so much!

I am writing at my bachelor thesis and dont have much time left ;)

But maybe I have the time to include it. Thanks!

@rambaut
Copy link
Owner

rambaut commented Sep 26, 2020

For Zooming/Scrolling on a webpage the simple solution is to increase the vertical dimensions of the tree inside a

with a constrained size and scrollbars.

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

3 participants