[Gmod-ajax] adding items to the main track menu

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

[Gmod-ajax] adding items to the main track menu

Jillian Rowe
Hello,

I am wondering if there is a way to add an item to the main track.

For instance, when I click on the Track Name there is a small arrow, and
then there is a menu that has the main jbrowse functions, "About this
track", "Pin to Top", "Save data", so on and so forth. I would like to
add something to that. Is this possible?

Best,
Jillian

------------------------------------------------------------------------------
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: adding items to the main track menu

Colin
Hi Jillian,
I think one way that you might do this would be to "subclass" one of
the track types and then override the _trackMenuOptions function.


If you look at the jbrowse codebase, you will see that several
existing track types add options to the menu this way (ie
WiggleBase.js adds the "Change track height" option to the regular
menu).

If you are familiar with dojo classes then this idea of subclassing
the track might make sense, but if it is not clear then let me know
and I can sketch up an example.


-Colin

On Mon, Aug 18, 2014 at 7:20 AM, Jillian Rowe
<[hidden email]> wrote:

> Hello,
>
> I am wondering if there is a way to add an item to the main track.
>
> For instance, when I click on the Track Name there is a small arrow, and
> then there is a menu that has the main jbrowse functions, "About this
> track", "Pin to Top", "Save data", so on and so forth. I would like to
> add something to that. Is this possible?
>
> Best,
> Jillian
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-ajax mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-ajax

------------------------------------------------------------------------------
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: adding items to the main track menu

Ke Jiang
Hi, Collin,

I'm also interested in customizing that menu, can you put up a rough example if possible?

Thanks!

Ke


On Mon, Aug 18, 2014 at 1:46 PM, Colin <[hidden email]> wrote:
Hi Jillian,
I think one way that you might do this would be to "subclass" one of
the track types and then override the _trackMenuOptions function.


If you look at the jbrowse codebase, you will see that several
existing track types add options to the menu this way (ie
WiggleBase.js adds the "Change track height" option to the regular
menu).

If you are familiar with dojo classes then this idea of subclassing
the track might make sense, but if it is not clear then let me know
and I can sketch up an example.


-Colin

On Mon, Aug 18, 2014 at 7:20 AM, Jillian Rowe
<[hidden email]> wrote:
> Hello,
>
> I am wondering if there is a way to add an item to the main track.
>
> For instance, when I click on the Track Name there is a small arrow, and
> then there is a menu that has the main jbrowse functions, "About this
> track", "Pin to Top", "Save data", so on and so forth. I would like to
> add something to that. Is this possible?
>
> Best,
> Jillian
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-ajax mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-ajax

------------------------------------------------------------------------------
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



--
Ke Jiang, Ph.D. 
Post-doctoral Fellow
Delbruck Laboratory
Cold Spring Harbor Laboratory
Cold Spring Harbor, NY 11724


------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: adding items to the main track menu

Jillian Rowe
Hi Colin,

I will try to send along some code in a bit, but a functional example would be that a track comes from a study and has several publications associated with it. So one menu option would be "Here are the entries on Pubmed/whereever". Another example is that some of the scientists have a webserver that utilizes 1K Genome snps and can tell you which snps are personal/family snps in your data, or whatever. The point is that there is an outside web source associated with the entire track, and not just a single feature of the track.

Best,
Jillian

P.S. I've really enjoyed being a part of this mailing list. Its one of the better ones in terms of community support and responsiveness. I've never worked with a tool that is as easily customized as JBrowse. ;)  I am taking maternity leave from the end of this week until Dec 1, so good luck everyone!

P.P.S. I wrote a few weeks ago about embedding JBrowse in a bootstrap framework. The way to go about it is to use an iframe tag, where the content of the iframe is just the usual index.html given.

This is 100% from a stack overflow topic on embedding an iframe in the bootstrap css framework.

 <style>body { margin: 0px; } .embed-container { position: relative; padding-bottom: 100%; height: 0; overflow: hidden; max-width: 100%; min-height: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>


<div class='embed-container'><iframe src="[% c.uri_for('/browser', c.req.params)%]" style='border:0;'></iframe></div>

Where '/browser' is your url for the index.html, and I use the c.req.params in order to pass parameters like location and tracks from the main page to the embedded iframe.

On 08/18/2014 09:15 PM, Ke Jiang wrote:
Hi, Collin,

I'm also interested in customizing that menu, can you put up a rough example if possible?

Thanks!

Ke


On Mon, Aug 18, 2014 at 1:46 PM, Colin <[hidden email]> wrote:
Hi Jillian,
I think one way that you might do this would be to "subclass" one of
the track types and then override the _trackMenuOptions function.


If you look at the jbrowse codebase, you will see that several
existing track types add options to the menu this way (ie
WiggleBase.js adds the "Change track height" option to the regular
menu).

If you are familiar with dojo classes then this idea of subclassing
the track might make sense, but if it is not clear then let me know
and I can sketch up an example.


-Colin

On Mon, Aug 18, 2014 at 7:20 AM, Jillian Rowe
<[hidden email]> wrote:
> Hello,
>
> I am wondering if there is a way to add an item to the main track.
>
> For instance, when I click on the Track Name there is a small arrow, and
> then there is a menu that has the main jbrowse functions, "About this
> track", "Pin to Top", "Save data", so on and so forth. I would like to
> add something to that. Is this possible?
>
> Best,
> Jillian
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-ajax mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-ajax

------------------------------------------------------------------------------
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



--
Ke Jiang, Ph.D. 
Post-doctoral Fellow
Delbruck Laboratory
Cold Spring Harbor Laboratory
Cold Spring Harbor, NY 11724



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: adding items to the main track menu

Jillian Rowe
Ok, so I can see how to do it from the WiggleBase.js (thanks!), but I can't see how I would pull in the extra options from the track config itself, which is what I was going for.




On 08/19/2014 10:37 AM, Jillian Rowe wrote:
Hi Colin,

I will try to send along some code in a bit, but a functional example would be that a track comes from a study and has several publications associated with it. So one menu option would be "Here are the entries on Pubmed/whereever". Another example is that some of the scientists have a webserver that utilizes 1K Genome snps and can tell you which snps are personal/family snps in your data, or whatever. The point is that there is an outside web source associated with the entire track, and not just a single feature of the track.

Best,
Jillian

P.S. I've really enjoyed being a part of this mailing list. Its one of the better ones in terms of community support and responsiveness. I've never worked with a tool that is as easily customized as JBrowse. ;)  I am taking maternity leave from the end of this week until Dec 1, so good luck everyone!

P.P.S. I wrote a few weeks ago about embedding JBrowse in a bootstrap framework. The way to go about it is to use an iframe tag, where the content of the iframe is just the usual index.html given.

This is 100% from a stack overflow topic on embedding an iframe in the bootstrap css framework.

 <style>body { margin: 0px; } .embed-container { position: relative; padding-bottom: 100%; height: 0; overflow: hidden; max-width: 100%; min-height: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>


<div class='embed-container'><iframe src="[% c.uri_for('/browser', c.req.params)%]" style='border:0;'></iframe></div>

Where '/browser' is your url for the index.html, and I use the c.req.params in order to pass parameters like location and tracks from the main page to the embedded iframe.

On 08/18/2014 09:15 PM, Ke Jiang wrote:
Hi, Collin,

I'm also interested in customizing that menu, can you put up a rough example if possible?

Thanks!

Ke


On Mon, Aug 18, 2014 at 1:46 PM, Colin <[hidden email]> wrote:
Hi Jillian,
I think one way that you might do this would be to "subclass" one of
the track types and then override the _trackMenuOptions function.


If you look at the jbrowse codebase, you will see that several
existing track types add options to the menu this way (ie
WiggleBase.js adds the "Change track height" option to the regular
menu).

If you are familiar with dojo classes then this idea of subclassing
the track might make sense, but if it is not clear then let me know
and I can sketch up an example.


-Colin

On Mon, Aug 18, 2014 at 7:20 AM, Jillian Rowe
<[hidden email]> wrote:
> Hello,
>
> I am wondering if there is a way to add an item to the main track.
>
> For instance, when I click on the Track Name there is a small arrow, and
> then there is a menu that has the main jbrowse functions, "About this
> track", "Pin to Top", "Save data", so on and so forth. I would like to
> add something to that. Is this possible?
>
> Best,
> Jillian
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gmod-ajax mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-ajax

------------------------------------------------------------------------------
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



--
Ke Jiang, Ph.D. 
Post-doctoral Fellow
Delbruck Laboratory
Cold Spring Harbor Laboratory
Cold Spring Harbor, NY 11724




------------------------------------------------------------------------------


_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax