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

Feature Request: Events for track adding and ROI changes #1661

Open
simoncole opened this issue Jul 7, 2023 · 2 comments
Open

Feature Request: Events for track adding and ROI changes #1661

simoncole opened this issue Jul 7, 2023 · 2 comments

Comments

@simoncole
Copy link

Hi IGV team,

Recently I’ve come upon the need to have browser events for when a user adds a new track and when a user modifies a ROI. I’m wondering if some code for these events already exists, and if so it would be fantastic if you could expose these events in the public API here. If not, do you think you could point me to a spot in the code that I could look at to possibly work on adding these events to our fork?

thanks for making a great tool,
Simon

@jrobinso
Copy link
Contributor

jrobinso commented Jul 7, 2023

Are you creating a custom app using the API? You should be calling browser.loadTrack(config) so you already know when the user adds a track. There are no igv.js menus for a user to directly load a track. So I'm confused on this one, how is the user adding a track?

For ROIs, users can add a new one, delete a user-added ROI, or edit the description.

Adding and deleting ROIs can be caught in the addFeature and removeFeature functions of class ROISet. (roi/ROISet.js). Editing a description is a bit of a hack, we are using the generic feature.name property, setting it directly from a menu. You can catch that in the menu event listener in roi/ROIMenu, line 58 in the current code base

const value = this.browser.inputDialog.input.value || ''
feature.name = value.trim()

@simoncole
Copy link
Author

Hey thanks for the timely response,

Yes that will should be a good solution for the tracks, not sure how I didn't think of that one. Thanks for the note on the ROIs I should have what I need there now.

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

No branches or pull requests

2 participants