Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add cursor support #218

Merged
merged 7 commits into from
Aug 14, 2020
Merged

Conversation

amanpatel
Copy link
Contributor

This PR aims to add basic cursor feature for chromosomes. The skeleton of the implementation follows the way brush.js is setup (since this is a very similar feature).

Notes:

  1. Haven't added tests.
  2. Just like brush feature does not make sense with rotation, the cursor feature does not make sense with rotation. So I've left that as-is.
  3. Brush || Cursor - You can either have brush support OR cursor support. But not both.
  4. I need some guidance on chromosome height code for the cursor (line 41 of cursor.js)

@coveralls
Copy link

coveralls commented Jul 12, 2020

Coverage Status

Coverage decreased (-1.3%) to 89.538% when pulling bae110d on amanpatel:feature/add-cursor-support into b4c33f0 on eweitz:master.

- Added a new global function "ideogram.setCursorPosition" which works if you are using cursor support.

- It would be nice to check for validattion of the position.

- Also since `dist` files are versioned, I'm comitting the changes.
…e position of the curosr as well as the genomic coordinate used. There seems to be a magic number around 6 that makes the cursor work very closely to how the brush works.
@eweitz eweitz changed the title Feature/add cursor support Add cursor support Aug 14, 2020
@eweitz eweitz merged commit d6fadbd into eweitz:master Aug 14, 2020
@eweitz
Copy link
Owner

eweitz commented Aug 14, 2020

@amanpatel, looks good -- thanks! What name and email should I add to AUTHORS?

I merged this as-is. Usually I wouldn't do so for a non-trivial change without tests. But I lean towards this new cursor feature being combined into the brush feature, perhaps as a re-branded "selection" feature.

For example, UCSC Genome Browser and NCBI Genome Data Viewer both support select-on-click in their chromosome graphic. However, they use the click's cursor position as the mid-point for a new range selection, rather than a point selection as done in this PR.

@eweitz eweitz mentioned this pull request Aug 18, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants