Closed pjvandehaar closed 7 years ago
In PheWeb, I'm generating tooltips based on the list of fields defined in my parser, even though each trait might have different fields actually present. So, I make a big template like:
{{#if rsid}}<b>{{rsid}}</b><br>{{/if}} {{#if pvalue}}pvalue: {{pvalue|scinotation}}{{/if}} {{#if beta}}beta: {{beta}}{{#if sebeta}} ({{sebeta}}){{/if}}{{/if}}
But this won't show pvalue or beta if they are 0. (I know, pval oughtn't be zero, but I didn't make the data.)
pvalue
beta
0
I could just do
LocusZoom.TransformationFunctions.add("truthy_or_0", x => (x || x === 0))
and then replace the above template with
{{#if rsid|truthy_or_0}}<b>{{rsid}}</b><br>{{/if}} {{#if pvalue|truthy_or_0}}pvalue: {{pvalue|scinotation}}{{/if}} {{#if beta|truthy_or_0}}beta: {{beta}}{{#if sebeta|truthy_or_0}} ({{sebeta}}){{/if}}{{/if}}
but I suspect that almost all users would prefer to treat 0 as truthy.
I think the travis setup is broken.
In PheWeb, I'm generating tooltips based on the list of fields defined in my parser, even though each trait might have different fields actually present. So, I make a big template like:
But this won't show
pvalue
orbeta
if they are0
. (I know, pval oughtn't be zero, but I didn't make the data.)I could just do
and then replace the above template with
but I suspect that almost all users would prefer to treat 0 as truthy.