[Gmod-ajax] VCF Callbacks feature.get()

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

[Gmod-ajax] VCF Callbacks feature.get()

Sofia Robb
Hi,

When I use feature.get() within a function called from style->color it works. But when I use outside the style block, i get this error :

"Uncaught TypeError: feature.get is not a function" 


I am trying to write a function to add the SNPeff Impact to the description. Here is what I have so far, I am trying to use feature.get('ann') to retrieve the SNPeff attribute


in my tracksList.json:

 "fmtDetailValue_description" :  "function(feature){return ({getImpact})(feature);}",


in functions.conf: 

getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }

Thank you again and again,
Sofia



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: VCF Callbacks feature.get()

Colin
I think feature is the second argument to fmtDetailValue type functions


function(name, feature) { return ({getImpact})(feature);}


-Colin

On Tue, Feb 21, 2017 at 3:51 PM, Sofia Robb <[hidden email]> wrote:
Hi,

When I use feature.get() within a function called from style->color it works. But when I use outside the style block, i get this error :

"Uncaught TypeError: feature.get is not a function" 


I am trying to write a function to add the SNPeff Impact to the description. Here is what I have so far, I am trying to use feature.get('ann') to retrieve the SNPeff attribute


in my tracksList.json:

 "fmtDetailValue_description" :  "function(feature){return ({getImpact})(feature);}",


in functions.conf: 

getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }

Thank you again and again,
Sofia



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: VCF Callbacks feature.get()

Sofia Robb
Yes! I needed (name,feature). I am learning...

So how can I access attributes?

"fmtDetailValue_description" :  "function(name,feature){return ({getImpact})(feature);}",


Ok, now it seems that both feature.get('ann') and  feature.get('ANN')  are not returning anything. (not sure which is correct)

with this function my description is blank:
getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }


I know the function is working because if I return a hardcoded string it works
with this function my description is says 'ann'
getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return 'ann';
  }


On Tue, Feb 21, 2017 at 1:59 PM, Colin <[hidden email]> wrote:
I think feature is the second argument to fmtDetailValue type functions


function(name, feature) { return ({getImpact})(feature);}


-Colin

On Tue, Feb 21, 2017 at 3:51 PM, Sofia Robb <[hidden email]> wrote:
Hi,

When I use feature.get() within a function called from style->color it works. But when I use outside the style block, i get this error :

"Uncaught TypeError: feature.get is not a function" 


I am trying to write a function to add the SNPeff Impact to the description. Here is what I have so far, I am trying to use feature.get('ann') to retrieve the SNPeff attribute


in my tracksList.json:

 "fmtDetailValue_description" :  "function(feature){return ({getImpact})(feature);}",


in functions.conf: 

getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }

Thank you again and again,
Sofia



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: VCF Callbacks feature.get()

Sofia Robb
Ok! I can retrieve the SNPeff annotation using 'ANN'. yeah! 



On Tue, Feb 21, 2017 at 2:25 PM, Sofia Robb <[hidden email]> wrote:
Yes! I needed (name,feature). I am learning...

So how can I access attributes?

"fmtDetailValue_description" :  "function(name,feature){return ({getImpact})(feature);}",


Ok, now it seems that both feature.get('ann') and  feature.get('ANN')  are not returning anything. (not sure which is correct)

with this function my description is blank:
getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }


I know the function is working because if I return a hardcoded string it works
with this function my description is says 'ann'
getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return 'ann';
  }


On Tue, Feb 21, 2017 at 1:59 PM, Colin <[hidden email]> wrote:
I think feature is the second argument to fmtDetailValue type functions


function(name, feature) { return ({getImpact})(feature);}


-Colin

On Tue, Feb 21, 2017 at 3:51 PM, Sofia Robb <[hidden email]> wrote:
Hi,

When I use feature.get() within a function called from style->color it works. But when I use outside the style block, i get this error :

"Uncaught TypeError: feature.get is not a function" 


I am trying to write a function to add the SNPeff Impact to the description. Here is what I have so far, I am trying to use feature.get('ann') to retrieve the SNPeff attribute


in my tracksList.json:

 "fmtDetailValue_description" :  "function(feature){return ({getImpact})(feature);}",


in functions.conf: 

getImpact  = function( feature ) {
    var ann = feature.get('ann');
    return ann;
  }

Thank you again and again,
Sofia



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax