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

Detecting when a Genoverse instance is ready #22

Closed
AntonPetrov opened this issue Oct 15, 2014 · 3 comments
Closed

Detecting when a Genoverse instance is ready #22

AntonPetrov opened this issue Oct 15, 2014 · 3 comments

Comments

@AntonPetrov
Copy link

Currently Genoverse initialisation is highly asynchronous, and as far as I know there is no way of detecting when a newly created Genoverse instance is ready for further instructions like browser.zoomOut() or browser.moveTo().

This would be particularly useful when a Genoverse browser is created dynamically or when a browser needs to be controlled by some external UI elements.

Any advice on how to manage situations like this?

@simonbrent
Copy link
Contributor

Hi Anton, my apologies for the ridiculous delay in answering this question!

The answer (if you still care) is that you shouldn't need to detect if it is "ready". Once you've done new Genoverse({..}), you can move around or zoom immediately, and track data will be loaded for your new region once you do this. You do not have to wait for the tracks to load in the initial region before moving away from it.

If you are creating a browser dynamically, you should just set chr, start and end in the config to be what you want, and then you wouldn't have to worry about moving straight away.

@AntonPetrov
Copy link
Author

Hi Simon,

Thanks for your reply. I do still care, although I am working on something else now and don't quite remember all the details.

I do remember, however, that in practice if you do

browser = new Genoverse({start=X, end=Y, chr=Z, etc});
browser.zoomOut();

sometimes it would load the desired location and then zoom out (which is what I want) and sometimes it would zoom out on the default region and then navigate to the new region specified in the config. The scenario depends on how fast the REST API serves up the annotations.

Maybe this isn't the case anymore, but it was at this time: 867c886

Feel free to close this issue for now if you like, but I am going to update it if I run into this problem again.

@simonbrent
Copy link
Contributor

Hi Anton,

I cannot currently replicate this with the current code, so I will close it for 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