-
Notifications
You must be signed in to change notification settings - Fork 63
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
Create concept of global hovered state #4013
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4013 +/- ##
=======================================
Coverage 63.67% 63.67%
=======================================
Files 1026 1026
Lines 30232 30245 +13
Branches 7197 7198 +1
=======================================
+ Hits 19249 19260 +11
- Misses 10818 10820 +2
Partials 165 165
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
xref #2458 |
9920f98
to
4e28fb2
Compare
cc97e6b
to
29e54fa
Compare
i think this should be good to go, but one thing I'll randomly note after attending icn3d tutorial from ncbi is they have very sophisticated notions of "selections". sort of tangential to this pr concerning hover, but i found it interesting as it does enable various workflows in their app |
This creates an object session.hovered, similar to session.selected
The hovered state is rapidly updated by all onMouseMove events from LinearGenomeView, and includes hoveredPosition (result of pxToBp of the current mouseover x coordinate) and hoveredFeature which is the result of searching through
view.tracks.find(t=>t.displays[0].featureUnderMouse)
This hover state is updated in a single place, which reduces the need to wire the code through many track types.
The "downside" is that it is always performing that views.tracks.find call instead of some more targeted session.setHovered right at the point-of-setting the
featureUnderMouse
but that seems like a hypothetical concern in terms of performanceAny track type that wishes to opt in should make the top level display have the featureUnderMouse getter (displays with subviews like alignments display can "lift this state up")
This hover state can be observed by potential applications like the msaview and protein view and to translate the genome hoveredPosition to protein coordinates
Possible enhancements could include 'sub-feature mouseovers' so that the plugin would be aware of the exact exon being mouse-overed, etc.
Interested in feedback