Commit 2b59533b authored by Julien Wollbrett's avatar Julien Wollbrett

solve bug to sort by species number #218

parent e92a9511
......@@ -69,9 +69,13 @@ $( document ).ready( function(){
{ responsivePriority: 2, targets: 3 }, // Gene count with presence of expression
{ type: 'gene-number', targets: 3 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 4 }, // Gene count with absence of expression
{ type: 'gene-number', targets: 4 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 5 }, // Gene count with no data
{ type: 'gene-number', targets: 5 }, // sort using the gene-number type
{ responsivePriority: 3, targets: 6 }, // Species count with presence of expression
{ type: 'species-number', targets: 6 },// sort using the species-number type
{ responsivePriority: 3, targets: 7 }, // Species count with absence of expression
{ type: 'species-number', targets: 7 },// sort using the species-number type
{ responsivePriority: 2, targets: 8 } // Details
],
columns: [ // sorting definition
......@@ -125,7 +129,9 @@ $( document ).ready( function(){
{ responsivePriority: 2, targets: 3 }, // Gene count with presence of expression
{ type: 'gene-number', targets: 3 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 4 }, // Gene count with absence of expression
{ type: 'gene-number', targets: 4 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 5 }, // Gene count with no data
{ type: 'gene-number', targets: 5 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 6 } // Details
],
columns: [ // sorting definition
......
_geneNumberSort=function(e,n,r){var t=/^(.*) gene/;return(e=null!==(e=e.replace(",",".").match(t))?parseFloat(e[0]):r)<(n=null!==(n=n.replace(",",".").match(t))?parseFloat(n[0]):r)?-1:e>n?1:0},jQuery.extend(jQuery.fn.dataTableExt.oSort,{"scientific-pre":function(e){return parseFloat(e)},"scientific-asc":function(e,n){return e<n?-1:e>n?1:0},"scientific-desc":function(e,n){return e<n?1:e>n?-1:0},"gene-number-asc":function(e,n){return _geneNumberSort(e,n,Number.POSITIVE_INFINITY)},"gene-number-desc":function(e,n){return-1*_geneNumberSort(e,n,Number.NEGATIVE_INFINITY)}});
\ No newline at end of file
_speciesOrGeneNumberSort=function(e,r,n,c){var s="";if("gene"==n)s=/^(.*) gene/;else{if("species"!=n)throw"unrecognized type"+n;s=/^(.*) species/}return(e=null!==(e=e.replace(",",".").match(s))?parseFloat(e[0]):c)<(r=null!==(r=r.replace(",",".").match(s))?parseFloat(r[0]):c)?-1:e>r?1:0},jQuery.extend(jQuery.fn.dataTableExt.oSort,{"scientific-pre":function(e){return parseFloat(e)},"scientific-asc":function(e,r){return e<r?-1:e>r?1:0},"scientific-desc":function(e,r){return e<r?1:e>r?-1:0},"species-number-asc":function(e,r){return _speciesOrGeneNumberSort(e,r,"species",Number.POSITIVE_INFINITY)},"species-number-desc":function(e,r){return-1*_speciesOrGeneNumberSort(e,r,"species",Number.NEGATIVE_INFINITY)},"gene-number-asc":function(e,r){return _speciesOrGeneNumberSort(e,r,"gene",Number.POSITIVE_INFINITY)},"gene-number-desc":function(e,r){return-1*_speciesOrGeneNumberSort(e,r,"gene",Number.NEGATIVE_INFINITY)}});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment