Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Change to click behavior of tracks when displayMode is set to "collapsed" #544
We've noticed that feature tracks set to displayMode "collapsed" retain any mouse click events. The trouble with this situation is that features are overlapping in this displayMode. Any click event that registers is merely the one associated with the feature rendered with the highest Z-level, and it is also unclear from a dense track which feature is represented.
My proposed solution is to remove all normal click events when in the "collapsed" state. This was easy to do on a test v1.11.5 dev build, but adding to _attachMouseOverEvents() in View/Track/CanvasFeatures.js where it already removes mouseover and mouseout events. This small change handles the transition from "collapsed" to "normal" or "compact" very well so far.
I would also like to attach a new click event to trigger a switch to "compact" displayMode (analogous to how the UCSC browser associates any click on a "dense" track to an expansion to "packed" state). I'm not sure how best to do this, though. The simplest approach would be be to add this to _attachMouseOverEvents() for "collapsed" displayMode as well, but the lines that follow only attach a normally expected event if none exists. Am I on the right track with this?
Comments and suggestions appreciated!
Yes, adding a configuration option to turn on new behavior like this is always good.
A good example of why we need this would be this track:
Too many features to display, so we're planning to collapse such tracks in an upcoming release to clean up the default display for each organism. But then, we end up with an overabundance of overlapping features and unclear targets for click events. Also, there is high potential for end user confusion. Folks not very familiar with JBrowse or genome browsers in general won't know what to do with a collapsed data track, since you have to hover over a track label before the menu is obvious.
Regular click events for most tracks are added by View/Track/BlockBased.js. I'd need to hijack that to add a function similar to the track menu displayMode switch. I will see how that goes.
I seem to recall that in desktop apollo that clicking on a collapsed
Also things are the opposite strands should be in separate stacks. (i.e.
On Thu, Dec 4, 2014 at 6:31 PM, Richard D. Hayes firstname.lastname@example.org
Hey @nauer , currently it is completely turned off in collapsed mode the moment. I had tested code for optionally enabling it but I can't find it right now (my screenshot shows the intended behavior though: it is collapsed but still has mouseover labels). It is not too complicated so if I get a chance I'll follow up
Yes, thanks for bringing this back up. Colin, I'd like to build on your
Richard D. Hayes, Ph.D.
On Tue, Jul 7, 2015 at 12:27 PM, Norbert Auer email@example.com