ebi-uniprot / ProtVista

A BioJS viewer for protein sequence features
Apache License 2.0
49 stars 17 forks source link

allow users to set width? (or responsive to container width)? #48

Open sillitoe opened 7 years ago

sillitoe commented 7 years ago

Thanks for all the work on this project - especially for allowing the flexibility for custom data sources.

I couldn't find anything in the docs about resizing - looks like the width is hard-coded (to 760px).

Would it be possible to specify width on init (or allow the component to stretch to the container)?

In fact, it might be even nicer to allow for a responsive width based on the container element (with redraw on page resize)?

Best,

Ian

ljgarcia commented 7 years ago

We did think about it at some point but decided against it. A responsive width could leave us with not enough room for labels and features so we will probably not go for it. Adding the width as an instantiation option could work, with a minimum fixed. Will take a look. Would something like this work for you?

You mentioned the flexibility for custom data sources, we would be interested in learning more about your experience with it.

Regards,

sillitoe commented 7 years ago

Yes thanks - explicitly setting the width on init would be good.

I suppose it would be possible for the user to manually recreate the app on resize if they really wanted (though less efficient than providing the ability for an internal width reset and redraw).

My plan is to add an alternative set of domain annotations as a custom track - the docs look good, I'll let you know if I get stuck.

Also looking at customising the CSS a little - I can refactor any changes into a "theme" file to show how people can provide their own tweaks if that sounds useful.

ljgarcia commented 7 years ago

The CSS theme sounds nice, thanks. We will take a look to the width option.