Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Switch from jQuery UI to Bootstrap #68

Closed
fedarko opened this issue Aug 12, 2016 · 6 comments
Closed

Switch from jQuery UI to Bootstrap #68

fedarko opened this issue Aug 12, 2016 · 6 comments

Comments

@fedarko
Copy link
Owner

fedarko commented Aug 12, 2016

This won't be a "cure-all," but it should make the site look nicer on a wider variety of devices. Bootstrap is designed with mobile-first functionality, so a lot of stuff (e.g. control groups, tooltips, dialogs, ...) will look pretty in both mobile and desktop browsers.

Not only will this make designing for mobile a lot easier, it'll also make the tool look a lot nicer in general: Bootstrap is more recent than jQuery UI in many respects, and it definitely provides a more aesthetically pleasing out-of-the-box experience for users.

The only downsides to this:

  • Not sure about Bootstrap support for draggable dialogs, which we currently use from jQuery UI. However, 1) it's not like those jQuery dialogs are draggable on mobile so it seems fair to not have dragging functionality altogether, and 2) jQuery UI and Bootstrap are compatible (and both rely on jQuery) so if we really want we can keep the jQuery UI dialogs and replace its other features.
  • Not sure about Bootstrap support for spinners (input box with up/down buttons that can scale to certain limits; we use this for the connected component selector, with a "min" of 1 and a "max" of whatever the number of connected components in the assembly graph is). However, like above, we can use jQuery UI for this (or just get by with a Bootstrap solution; the spinner's behavior isn't really that important, although it is certainly nice).
  • Time taken in replacing jQuery stuff with Bootstrap stuff (shouldn't be that bad; a few hours at most, I'm guessing)
@fedarko fedarko added this to the Full mobile support milestone Aug 12, 2016
@fedarko fedarko self-assigned this Aug 12, 2016
@fedarko
Copy link
Owner Author

fedarko commented Aug 12, 2016

http://www.zingdesign.com/5-reasons-not-to-use-twitter-bootstrap/

Straight out of the box, Twitter Bootstrap includes CSS weighing in at 126KB and 29KB of JavaScript. If you do want to use all of the sweet functionality baked into Twitter Bootstrap, you should have a good think about resource loading times. Of course for some this may not be an issue, but here in New Zealand the internet has to be pumped all the way across the Pacific ocean, and by the time it gets here it is slow and tired.

I... I can't actually tell if this is a joke or not.

fedarko added a commit that referenced this issue Aug 12, 2016
This should definitely help out people on mobile devices/other
systems that take a while to load .db files.

As a strange aside, it seems that sometimes (particularly on my
phone) the indeterminate progress bar animation doesn't show.
Fortunately this still shows *something*, so it's not that bad.
But I should probably look into fixing it (although #68 should
help with that sort of problem, I'm guessing, since jQuery UI isn't
really designed for mobile devices).
@fedarko
Copy link
Owner Author

fedarko commented Aug 12, 2016

Another motivation here: we can use Bootstrap's nice-looking, inoffensive, easy-to-use tooltips, as opposed to jQuery UI's large and oftentimes intrusive tooltips. Not only would this improve existing functionality within the AsmViz viewer, this would also allow us to easily add dynamic help buttons to dialogs/etc. that show the user information in context. Sort of like what WEB BLAST and Bandage do.

@fedarko
Copy link
Owner Author

fedarko commented Jan 17, 2017

Ok, so I've gotten most of the various UI elements (sans dialogs) replaced with Bootstrap. One issue, though, is that disabling buttons/etc is a bit more complex in Bootstrap than in jQuery UI, so that'll necessitate a bit of time going through stuff tomorrow. (I've managed to get everything properly disabled on initialization, I believe -- now it's a matter of selectively enabling certain things properly, and supporting toggling enabled/disabled status).

After getting the enabled stuff sorted out, I need to go through the JS and HTML code and sort out old jQuery UI non-dialog references (replacing them with Bootstrap stuff). I'd consider this step "done" when the viewer tool works as it did before, with no errors. At this point, I'll commit the changes that I've made (keeping both jQuery UI and Bootstrap for the time being).

After that, I'd like to replace all dialogs with inline or otherwise Bootstrap equivalent things. Then I'll remove jQuery UI and mark this issue as done.

@fedarko
Copy link
Owner Author

fedarko commented Jan 17, 2017

Well, the viewer mostly works for now (you can load/view components as before) -- some of the controls are still disabled, so I need to fix that. But the functionality is definitely close.

@fedarko
Copy link
Owner Author

fedarko commented Jan 18, 2017

Spent today working on control panel sizing stuff + switching some last things over to Bootstrap (again, sans dialogs). On the docket:

  • Go through each element and determine when it should be enabled, disabled, etc -- and implement that accordingly, replacing old jQuery UI disabling/enabling (which was via the .button() function). The places in the code where this is done should be mostly the same as before, unless I change anything in particular (e.g. rotation button group). I might need to create a few helper functions for this, to make easily disabling/enabling an arbitrary bootstrap button/text area/etc based on ID easier.
  • Implement onChange listener stuff for the new rotation button group. Alternatively, just only have rotation influence the next "drawing" of a graph. This should be really really similar to what we had before.
  • Implement collapse button name detection for the collapsing code, since that uses the button name to determine which operation is undertaken. Alternatively, just create two buttons: collapseAll and uncollapseAll, which may be easier and might actually make more sense from a UI perspective.
  • Commit changes thus far: at this point, full functionality is available.
  • Determine a suitable replacement for each dialog (inline stuff or Bootstrap dialogs, or some other solution). Implement & commit accordingly.
  • Once all dialogs have been converted away from jQuery UI, remove jQuery UI from the project.

@fedarko
Copy link
Owner Author

fedarko commented Jan 19, 2017

Enabling/disabling and the collapse button stuff is all taken care of. Just have to implement onChange for rotation.

fedarko added a commit that referenced this issue Jan 19, 2017
Beginning to implement Bootstrap kind of broke a lot of things at
first, so I took a while to go through the code and ensure all
functionality remained the same before committing the changes here.
(Hence the large size of this commit, sorry.)

Major changes:

-All UI elements that aren't dialogs or within dialogs have been
switched from jQuery UI to Bootstrap.

-Switched the #controls and #cy divs to be absolutely positioned
using em units, which should scale better to smaller screens and
should help us with doing things like...

-Added a "controls toggler" that removes the controls div and
frees up more space for the Cytoscape.js graph.

-Moved fitting buttons to be present on top of the actual
Cytoscape.js graph display (using absolute positioning and
z-indices in CSS). I'm pretty happy with these buttons now,
and I might make some other buttons (collapsing, searching?)
present on the display in the future (although it's really nice
to be able to display lots of information inline in the controls
div now).

-Added the glyphicons fonts (those are used in Bootstrap).

-Created css/, js/, and fonts/ directories within the viewer/
folder (to more easily distinguish types of files).

-Made the controls div blue, because it looks nice. ...Probably going
to change that in the future.
fedarko added a commit that referenced this issue Jan 21, 2017
This looks nice, and it works well with the process of exploring the
graph (seeing the numbers indicating different types of selected
elements change is somewhat helpful).

One thing here: I changed things so that contigs (nodes in LastGraph
and GFA assembly graphs) have their length indicated in nt, while
scaffolds (nodes in BAMBUS 3 GML assembly graphs) have their
length indicated in bp. I'm fairly sure this is correct, but I'm
leaving #107 open for the time being so I can 1) add this to
the README and 2) double-check that this is, in fact, correct.

There's a lot of issues we could focus on next. #145 and #142, #143
(and once #142 and #143 are done, #68) are all fairly simple and
shouldn't take too long (knock on wood); #71, #80, and #90 are all
super high priority and should be done as soon as possible,
although they'll take a fairly substantial amount of work.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant