diff options
author | zsloan | 2019-03-06 13:11:09 -0600 |
---|---|---|
committer | zsloan | 2019-03-06 13:11:09 -0600 |
commit | 92b587824a5d2bc42aab3f4be64f76113e5334eb (patch) | |
tree | 905c076c355b08a3d50e311667c578b3fe08c8f6 /wqflask | |
parent | 678e9aca5011644131701ec1d494ad754ddd7d56 (diff) | |
download | genenetwork2-92b587824a5d2bc42aab3f4be64f76113e5334eb.tar.gz |
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
Diffstat (limited to 'wqflask')
7 files changed, 66 insertions, 20 deletions
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 += "<table class='table table-hover'>"; + the_html += "<table id='collection_table' class='table table-hover'>"; if ($('.corr_compute').length){ the_html += "<thead><tr><th></th><th>Record</th><th>Data Set</th><th>Description</th><th>Mean</th></tr></thead>"; } else { - the_html += "<thead><tr><th>Record</th><th>Data Set</th><th>Description</th><th>Mean</th></tr></thead>"; + the_html += "<thead><tr><th>Record</th><th>Data Set</th><th>Description</th></tr></thead>"; } the_html += "<tbody>"; for (_i = 0, _len = trait_data.length; _i < _len; _i++) { @@ -336,7 +388,6 @@ process_traits = function(trait_data, textStatus, jqXHR) { the_html += "<td class='trait'>" + trait.name + "</td>"; the_html += "<td class='dataset'>" + trait.dataset + "</td>"; the_html += "<td>" + trait.description + "</td>"; - the_html += "<td>" + (trait.mean || ' ') + "</td></tr>"; } the_html += "</tbody>"; the_html += "</table>"; 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: "<font color='blue'>Interquartile Range</font>", 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 = "<thead><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; + if (js_data.trait_symbol != null) { + header = "<thead><tr><th style=\"text-align: center;\" colspan=\"100%\">Trait: " + js_data.trait_id + " - " + js_data.trait_symbol + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; + } else { + header = "<thead><tr><th style=\"text-align: center;\" colspan=\"100%\">Trait: " + js_data.trait_id + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; + } _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 @@ <script language="javascript" type="text/javascript" src="/static/new/js_external/d3-tip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jscolor.js"></script> <script language="javascript" type="text/javascript" src="/static/new/javascript/panelutil.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> + <!--<script language="javascript" type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script>--> <script type="text/javascript" src="/static/new/js_external/plotly-latest.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/javascript/draw_corr_scatterplot.js"></script> {% 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 @@ <button id="send_to_bnw" class="btn btn-primary submit_special" data-url="/bnw_page" title="Bayesian Network" > BNW </button> - - <button id="delete" class="btn btn-danger submit_special" style="margin-left: 15px;" data-url="/collections/delete" title="Delete this collection" > - Delete Collection - </button> - </form> </div> <div> 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 %} <script language="javascript" type="text/javascript" src="/static/new/js_external/md5.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> 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 %} <script language="javascript" type="text/javascript" src="/static/new/js_external/md5.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> @@ -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 %} </div> - <form method="post" action="/corr_compute" target="_blank" name="trait_page" id="trait_data_form" + <form method="post" action="" target="_blank" name="trait_page" id="trait_data_form" class="form-horizontal"> <div id="hidden_inputs"> <input type="hidden" name="trait_hmac" value="{{ data_hmac('{}:{}'.format(this_trait.name, dataset.name)) }}"> |