Skip to content

Add genomicLocation to the "trackclick" event#1987

Merged
jrobinso merged 2 commits intoigvteam:masterfrom
milandomazet:add_genomiclocation_popup_event
May 22, 2025
Merged

Add genomicLocation to the "trackclick" event#1987
jrobinso merged 2 commits intoigvteam:masterfrom
milandomazet:add_genomiclocation_popup_event

Conversation

@milandomazet
Copy link
Contributor

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.

@jrobinso jrobinso requested a review from Copilot May 22, 2025 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A small enhancement to expose the exact click position in the trackclick event and correct the event return type.

  • Passes clickState.genomicLocation as an optional third argument to trackclick.
  • Aligns the EventReturn type to accept string values alongside boolean.

@jrobinso
Copy link
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.

@jrobinso jrobinso merged commit 33fb709 into igvteam:master May 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants