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

Create concept of global hovered state #4013

Merged
merged 4 commits into from
Oct 27, 2023
Merged

Create concept of global hovered state #4013

merged 4 commits into from
Oct 27, 2023

Conversation

cmdcolin
Copy link
Collaborator

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 performance

  • Any 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

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 24, 2023
@cmdcolin
Copy link
Collaborator Author

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #4013 (29e54fa) into main (479e97e) will increase coverage by 0.00%.
The diff coverage is 91.66%.

❗ Current head 29e54fa differs from pull request most recent head 824c5b0. Consider uploading reports for the commit 824c5b0 to get more accurate results

@@           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           
Files Coverage Δ
packages/core/util/types/index.ts 62.38% <ø> (ø)
packages/product-core/src/Session/BaseSession.ts 80.64% <100.00%> (+1.33%) ⬆️
plugins/svg/src/SvgFeatureRenderer/configSchema.ts 50.00% <ø> (ø)
...c/LinearGenomeView/components/LinearGenomeView.tsx 91.11% <90.00%> (-0.32%) ⬇️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Oct 24, 2023
@cmdcolin
Copy link
Collaborator Author

xref #2458

@cmdcolin cmdcolin force-pushed the set_hovered branch 3 times, most recently from 9920f98 to 4e28fb2 Compare October 25, 2023 05:52
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 25, 2023

some early results show that this PR can be leveraged to get the desired "hover over genome, get position in msaview" type behavior

image

@cmdcolin cmdcolin force-pushed the set_hovered branch 2 times, most recently from cc97e6b to 29e54fa Compare October 26, 2023 16:06
@cmdcolin
Copy link
Collaborator Author

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

@cmdcolin cmdcolin merged commit 7806999 into main Oct 27, 2023
10 of 11 checks passed
@cmdcolin cmdcolin deleted the set_hovered branch October 27, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant