From 92b587824a5d2bc42aab3f4be64f76113e5334eb Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 6 Mar 2019 13:11:09 -0600 Subject: Cofactor option for correlation scatterplot was broken; it should be fixed now Added title to basic stats table and made link for Interquartile Range more obvious Removed pointless "Delete Collection" button from correlation results page --- .../new/javascript/get_traits_from_collection.js | 57 ++++++++++++++++++++-- .../wqflask/static/new/javascript/show_trait.js | 8 ++- wqflask/wqflask/templates/corr_scatterplot.html | 4 +- wqflask/wqflask/templates/correlation_page.html | 5 -- wqflask/wqflask/templates/gsearch_gene.html | 1 + wqflask/wqflask/templates/gsearch_pheno.html | 9 +--- wqflask/wqflask/templates/show_trait.html | 2 +- 7 files changed, 66 insertions(+), 20 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js index 207b271b..bed3eb9e 100644 --- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js @@ -10,6 +10,57 @@ this_trait_data = null; selected_traits = {}; +$('#collections_list').attr("style", "width: 100%;"); +$('#trait_table').dataTable( { + "drawCallback": function( settings ) { + $('#trait_table tr').click(function(event) { + if (event.target.type !== 'checkbox') { + $(':checkbox', this).trigger('click'); + } + }); + }, + "columns": [ + { "type": "natural", "width": "3%" }, + { "type": "natural", "width": "8%" }, + { "type": "natural", "width": "20%" }, + { "type": "natural", "width": "25%" }, + { "type": "natural", "width": "25%" }, + { "type": "natural", "width": "15%" } + ], + "columnDefs": [ { + "targets": 0, + "orderable": false + } ], + "order": [[1, "asc" ]], + "sDom": "RZtr", + "iDisplayLength": -1, + "autoWidth": true, + "bDeferRender": true, + "bSortClasses": false, + "paging": false, + "orderClasses": true +} ); + +$('#collection_table').dataTable( { + "createdRow": function ( row, data, index ) { + if ($('td', row).eq(1).text().length > 40) { + $('td', row).eq(1).text($('td', row).eq(2).text().substring(0, 40)); + $('td', row).eq(1).text($('td', row).eq(2).text() + '...') + } + if ($('td', row).eq(3).text().length > 50) { + $('td', row).eq(3).text($('td', row).eq(4).text().substring(0, 50)); + $('td', row).eq(3).text($('td', row).eq(4).text() + '...') + } + }, + "order": [[0, "asc" ]], + "sDom": "ZRtr", + "iDisplayLength": -1, + "autoWidth": true, + "bSortClasses": false, + "paging": false, + "orderClasses": true +} ); + collection_click = function() { var this_collection_url; //console.log("Clicking on:", $(this)); @@ -199,6 +250,7 @@ populate_cofactor_info = function(trait_info) { get_trait_data = function(trait_data, textStatus, jqXHR) { var sample, samples, this_trait_vals, trait_sample_data, vals, _i, _len; trait_sample_data = trait_data[1]; + console.log("IN GET TRAIT DATA") if ( $('input[name=allsamples]').length ) { samples = $('input[name=allsamples]').val().split(" "); } else { @@ -320,11 +372,11 @@ process_traits = function(trait_data, textStatus, jqXHR) { if ($('#scatterplot2').length){ the_html += " Please click the row of the trait you wish to select as a cofactor."; } - the_html += ""; + the_html += "
"; if ($('.corr_compute').length){ the_html += ""; } else { - the_html += ""; + the_html += ""; } the_html += ""; for (_i = 0, _len = trait_data.length; _i < _len; _i++) { @@ -336,7 +388,6 @@ process_traits = function(trait_data, textStatus, jqXHR) { the_html += ""; the_html += ""; the_html += ""; - the_html += ""; } the_html += ""; the_html += "
RecordData SetDescriptionMean
RecordData SetDescriptionMean
RecordData SetDescription
" + trait.name + "" + trait.dataset + "" + trait.description + "" + (trait.mean || ' ') + "
"; diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index f49ef063..89197a01 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -67,7 +67,7 @@ Stat_Table_Rows.push( digits: 3 }, { vn: "interquartile", - pretty: "Interquartile Range", + pretty: "Interquartile Range", url: "http://www.genenetwork.org/glossary.html#Interquartile", digits: 3 }, { @@ -319,7 +319,11 @@ redraw_prob_plot = function() { make_table = function() { var header, key, row, row_line, table, the_id, the_rows, value, _i, _len, _ref, _ref1; - header = "Statistic"; + if (js_data.trait_symbol != null) { + header = "Trait: " + js_data.trait_id + " - " + js_data.trait_symbol + "Statistic"; + } else { + header = "Trait: " + js_data.trait_id + "Statistic"; + } _ref = js_data.sample_group_types; for (key in _ref) { if (!__hasProp.call(_ref, key)) continue; diff --git a/wqflask/wqflask/templates/corr_scatterplot.html b/wqflask/wqflask/templates/corr_scatterplot.html index e3d90e30..8816f0b5 100644 --- a/wqflask/wqflask/templates/corr_scatterplot.html +++ b/wqflask/wqflask/templates/corr_scatterplot.html @@ -323,7 +323,9 @@ - + + + {% endblock %} diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index 427dacc9..80c5e945 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -68,11 +68,6 @@ - - -
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index ebebd044..ede673cd 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -44,6 +44,7 @@ {% block js %} + diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 96a5d71a..581d0f7d 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -44,6 +44,7 @@ {% block js %} + @@ -79,14 +80,6 @@ console.time("Creating table"); $('#trait_table').DataTable( { - 'drawCallback': function( settings ) { - $('#trait_table tr').click(function(event) { - if (event.target.type !== 'checkbox') { - $(':checkbox', this).trigger('click'); - } - }); - $('.trait_checkbox:checkbox').on("change", change_buttons); - }, "createdRow": function ( row, data, index ) { $('td', row).eq(0).attr("style", "text-align: center; padding: 4px 10px 2px 10px;"); $('td', row).eq(1).attr("align", "right"); diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index e4feb817..6ab7d635 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -22,7 +22,7 @@ {% endif %}
-
-- cgit v1.2.3