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

Responsive resizing #55

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Conversation

davidhoksza
Copy link

I implemented scaling of ProtVista so that it can be used as a responsive component with a varying width (which I needed in one project). In the example.html, one can find how it can be used either with fixed or dynamic width.

All the SVGs now take 100% width of their parent elements and when the component changes its size, scales in the individual components (BasicViewer, CategoryViewer, viewport) change accordingly and update of the position and length of all the elements is triggered.

To have SVGs 100% of the space right of categories names, I enclosed the rows into a div with the display set to table. So category names and tracks are now distinct cells of one row. This enables dynamic resize of the SVGs when the component changes its size.

@xwatkins
Copy link
Contributor

Many thanks, we have been planning on adding this functionality for a while now! I will review your PR in the next few days.
Also, just to let you know, we have also started work on a native web component implementation of this tool. As we want to make each custom element responsive, we might re-use some of the strategies from your PR if that's ok.

@davidhoksza
Copy link
Author

davidhoksza commented Oct 17, 2017

Sure, no problem with re-using the code.

@j-andrews7
Copy link

Is there any chance of this still being added? It would be very helpful, even if labels and such get messed up at thinner widths.

@davidhoksza
Copy link
Author

I think Xavier is working on a new component-based version of ProtVista which is quite impressive (but maybe not fully functional, yet?). But if you want to stick with this one, I am maintaining this "scaling" branch because I need it for MolArt

@j-andrews7
Copy link

@davidhoksza Yeah, I looked into the components, but the all-in-one approach is enticing. I will use your branch then, thanks!

@xwatkins
Copy link
Contributor

xwatkins commented Aug 1, 2018

Hi @j-andrews7! Yes, please use @davidhoksza's branch as this is now only in basic maintenance. The new component-based version is not quite ready as we have been busy with other projects but will also include a "all-in-one" version for simplicity (we're currently aiming for the first release in Autumn).

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

Successfully merging this pull request may close these issues.

4 participants