From 665e1ea90ffb5767dd19a1d1ca240652ab2b2a9d Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 12 Apr 2019 10:36:04 -0500 Subject: - Improved Interval Analyst table appearance in mapping results - Made the text on the "Forgot Password" page more simple and less cluttered - Added line to index page about RANGE search function - Fixed bar chart on trait page so that it sets the bottom margin depending upon the longest sample name length --- .../marker_regression/display_mapping_results.py | 4 +- .../wqflask/static/new/javascript/show_trait.js | 100 ++++++++++++--------- wqflask/wqflask/templates/index_page.html | 3 + wqflask/wqflask/templates/index_page_orig.html | 3 + wqflask/wqflask/templates/mapping_results.html | 10 +++ .../templates/new_security/forgot_password.html | 12 +-- 6 files changed, 79 insertions(+), 53 deletions(-) diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 11231032..1ce0e725 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -2155,8 +2155,8 @@ class DisplayMappingResults(object): humanStartString = humanChr = humanStartDisplay = "--" geneDescription = theGO["GeneDescription"] - if len(geneDescription) > 26: - geneDescription = geneDescription[:26]+"..." + if len(geneDescription) > 70: + geneDescription = geneDescription[:70]+"..." if theGO["snpDensity"] < 0.000001: snpDensityStr = "0" diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 56f62090..31f59a13 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -829,6 +829,23 @@ get_sample_names = function(sample_list) { })(); }; +get_bar_bottom_margin = function(sample_list){ + bottom_margin = 80 + max_length = 0 + sample_names = get_sample_names(sample_list) + for (i=0; i < sample_names.length; i++){ + if (sample_names[i].length > max_length) { + max_length = sample_names[i].length + } + } + + if (max_length > 6){ + bottom_margin += 9*(max_length - 6) + } + + return bottom_margin; +} + root.stats_group = 'samples_primary'; if (Object.keys(js_data.sample_group_types).length > 1) { @@ -906,6 +923,49 @@ get_bar_range = function(sample_list){ root.chart_range = get_bar_range(sample_lists[0]) +if (js_data.num_values < 256) { + bar_chart_width = 25 * get_sample_vals(sample_lists[0]).length + + //ZS: Set bottom margin dependent on longest sample name length, since those can get long + bottom_margin = get_bar_bottom_margin(sample_lists[0]) + + root.bar_layout = { + xaxis: { + titlefont: { + size: 16 + }, + showline: true, + ticklen: 4, + tickfont: { + size: 16 + } + }, + yaxis: { + range: root.chart_range, + titlefont: { + size: 16 + }, + showline: true, + ticklen: 4, + tickfont: { + size: 16 + } + }, + width: bar_chart_width, + height: 600, + margin: { + l: 50, + r: 30, + t: 30, + b: bottom_margin + } + }; + + $('.bar_chart_tab').click(function() { + update_bar_chart(); + }); +} + total_sample_count = 0 for (i = 0, i < sample_lists.length; i++;) { total_sample_count += get_sample_vals(sample_lists[i]).length @@ -964,46 +1024,6 @@ $('.histogram_samples_group').change(function() { return update_histogram(); }); -if (js_data.num_values < 256) { - bar_chart_width = 25 * get_sample_vals(sample_lists[0]).length - - root.bar_layout = { - xaxis: { - titlefont: { - size: 16 - }, - showline: true, - ticklen: 4, - tickfont: { - size: 16 - } - }, - yaxis: { - range: root.chart_range, - titlefont: { - size: 16 - }, - showline: true, - ticklen: 4, - tickfont: { - size: 16 - } - }, - width: bar_chart_width, - height: 600, - margin: { - l: 50, - r: 30, - t: 30, - b: 80 - } - }; - - $('.bar_chart_tab').click(function() { - update_bar_chart(); - }); -} - root.box_layout = { xaxis: { showline: true, diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html index a22708ab..0116245d 100644 --- a/wqflask/wqflask/templates/index_page.html +++ b/wqflask/wqflask/templates/index_page.html @@ -143,6 +143,9 @@ highly expressed genes (15 to 16 log2 units) AND with peak LRS linkage between 23 and 46. +