diff --git a/mdb/files/templates/files/file_upload.html b/mdb/files/templates/files/file_upload.html index 4292047..d648f3e 100644 --- a/mdb/files/templates/files/file_upload.html +++ b/mdb/files/templates/files/file_upload.html @@ -99,9 +99,11 @@ --> - +
-
@@ -189,18 +191,9 @@
diff --git a/mdb/libs/static/js/spectra_search.js b/mdb/libs/static/js/spectra_search.js index 6956fe7..8a63b32 100644 --- a/mdb/libs/static/js/spectra_search.js +++ b/mdb/libs/static/js/spectra_search.js @@ -84,10 +84,6 @@ function toggleNavSearch(e) { e.preventDefault(); e.stopPropagation(); - d3.select('#dendro-viz').selectAll('*').remove(); - d3.select('#svg-histo').selectAll('*').remove(); - d3.select('#spectra-viz').selectAll('*').remove(); - $('#nav-search-source a').removeClass('active'); $(this).addClass('active'); @@ -99,6 +95,16 @@ function toggleNavSearch(e) { var n = $(this).attr('id').split('-')[1]; // e.g. "nss-1" $('#nss-card-' + n).css('display', 'block'); + if (n != 3) { // hides result tab + $('#nss-3').css('display', 'none'); + d3.select('#dendro-viz').selectAll('*').remove(); + d3.select('#svg-histo').selectAll('*').remove(); + d3.select('#spectra-viz').selectAll('*').remove(); + $('#col-right').css('display', 'none'); + $('#container-dendro').css('display', 'none'); + } else if (n == 3) { + //~ $('#col-right').css('display', ''); + } return false; } function toggleUploadOpts(e) { @@ -280,8 +286,6 @@ window.addEventListener('DOMContentLoaded', (event) => { } } } - - // post-load styling }); @@ -739,13 +743,13 @@ socket.onmessage = function(e) { var t = $('#file-listing2').DataTable({ data: data.data.results, columns: [ - {data: 'id', title: 'Spectra ID'}, - {data: 'strain_id', title: 'Strain ID'}, - {data: 'strain_id__strain_id', title: 'Strain Name'}, + //~ {data: 'id', title: 'Spectra ID'}, + //~ {data: 'strain_id', title: 'Strain ID'}, + {data: 'strain_id__strain_id', title: 'Unknown Strain Name'}, {data: 'id', title: 'Top scores (Strain Name, Genus / Species)', render: function(data, type) { // e.g. top-scores-8373 - return '
'; //width: 500px;white-space: pre-line; + return '
'; //width: 500px;white-space: pre-line; } }, {data: 'id', title: '', @@ -788,10 +792,7 @@ socket.onmessage = function(e) { for (var i=0; i<5; i++) { if (x[i]) output.push(x[i]); - //~ } catch(e) {} } - //~ console.log('output',output); - //~ console.log('here1'); var t = $('#top-scores-'+data.data.spectra1).DataTable({ data: output, paging: false, @@ -803,11 +804,14 @@ socket.onmessage = function(e) { {data: 'strain', title: ''}, {data: 'genus', title: ''}, {data: 'species', title: ''}, - ] + ], + 'headerCallback': function( thead, data, start, end, display ) { + thead.remove(); + //$(thead).find('th').eq(0).html( 'Displaying '+(end-start)+' records' ); + } }); t.order([0, 'desc']) // reorders in correct direction .draw(); - //~ console.log('here'); } return; @@ -835,12 +839,14 @@ function singleScore(id) { $('#nss-card-2').css('display', 'none'); $('#nss-card-3').css('display', 'block'); + $('#col-right').css('display', ''); + var t = $('#data-table').DataTable({ data: data.scores, destroy: true, // https://datatables.net/manual/tech-notes/3 columns: [ {data: 'score', title: 'Score'}, - {data: 'id', title: 'Spectra ID'}, + //~ {data: 'id', title: 'Spectra ID'}, {data: 'strain', title: 'Strain Name', render: function(data, type) { return '' diff --git a/mdb/spectra_search/templates/spectra_search/basic_search.html b/mdb/spectra_search/templates/spectra_search/basic_search.html index 63218bf..6352db1 100755 --- a/mdb/spectra_search/templates/spectra_search/basic_search.html +++ b/mdb/spectra_search/templates/spectra_search/basic_search.html @@ -109,9 +109,9 @@ --> - +
-
@@ -342,13 +342,13 @@ Task: Calculating cosine similarity measure...
- +