Add genomicLocation to the "trackclick" event#1987
Merged
jrobinso merged 2 commits intoigvteam:masterfrom May 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
A small enhancement to expose the exact click position in the trackclick event and correct the event return type.
- Passes
clickState.genomicLocationas an optional third argument totrackclick. - Aligns the
EventReturntype to accept string values alongside boolean.
Contributor
|
Looks fine, but keep in mind that unless zoomed in a single pixel can span many bases, so what you get for genomicLocation does not in general imply a particular base was "clicked" on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! A small PR aimed at the trackclick event and data available in the handler: genomicLocation has been added to the event handler for the trackclick event.
The reasoning behind this was mainly aimed at the bigwig tracks which can have a location range in the popup even though we click on a single location (a bigwig file can have ranges in it for example 100-200 23). I thought it might be useful having the exact location where the user clicked as this might be used in the handler itself. The new field was added as optional so we do not raise typing issues with current implementations users of igv.js might have. We could add the whole clickState as well but it seems to me that it would be an overkill.
Another fix I did while working on the above is related to the EvenReturn type for trackclick event. For this one I guess it was only boolean at some point and was not changed once string was allowed in the popup function.
As always, feel free to reject this one if you don't find this change useful.