[Gmod-ajax] Reading selected region with jquery from embedded jbrowse?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] Reading selected region with jquery from embedded jbrowse?

Marcel
Hi,

Probably a newby question, but is it possible to read the current selected region from an embedded JBrowse (version 1.11.4) instance with javascript/jQuery?

Marcel

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Reading selected region with jquery from embedded jbrowse?

Colin
You can get a handle to the browser variable using stuff that has been discussed recently on the mailing list (just saying because it's the only reason i know it :)

Then you can use the browser object to get the visible region with browser.view.visibleRegion(). See code sample.


=== example code ===
//code sample

$("#myiframe").load(function()
{
    // hook into browser to get variables
    var browser=document.
getElementById('frame').contentWindow.JBrowse;
    browser.afterMilestone('completely initialized', function() {
        alert('Finished loading');
        var region=browser.view.visibleRegion();
        console.log(region.ref+" "+region.start+" "+region.end);
    });
});
$("#myiframe").attr('src','http://your-site.com/jbrowse/');




On Thu, Jun 19, 2014 at 9:32 AM, Marcel Kerkveld <[hidden email]> wrote:
Hi,

Probably a newby question, but is it possible to read the current selected region from an embedded JBrowse (version 1.11.4) instance with javascript/jQuery?

Marcel

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax