From de58be0b8620032261f1f4699856994a4ee164d7 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 2 Nov 2016 21:54:41 +0000 Subject: Added toggleable short and long labels to correlation matrix Fixed issue where I forgot to remove a parameter from jsonable_table_row in trait.py --- wqflask/base/trait.py | 2 +- .../static/new/javascript/create_corr_matrix.js | 22 ++++++++++++++++++ wqflask/wqflask/templates/correlation_matrix.html | 26 ++++++++++++++++++---- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 8788d983..11a91d1d 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -120,7 +120,7 @@ class GeneralTrait(object): else: return dict() - def jsonable_table_row(self, index, search_type): + def jsonable_table_row(self, index): """Return a list suitable for json and intended to be displayed in a table Actual turning into json doesn't happen here though""" diff --git a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js index a34fc408..44ed3c81 100644 --- a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js +++ b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js @@ -56,4 +56,26 @@ $('.corr_cell').each( function () { else { $(this).css('background-color', 'white') } +}); + +$('#short_labels').click( function (){ + $('.shortName').each( function() { + if ($(this).css("display") == "none"){ + $(this).css("display", "block"); + } + else { + $(this).css("display", "none"); + } + }); +}); + +$('#long_labels').click( function (){ + $('.verboseName').each( function() { + if ($(this).css("display") == "none"){ + $(this).css("display", "block"); + } + else { + $(this).css("display", "none"); + } + }); }); \ No newline at end of file diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index d847614a..cd2aa35e 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -12,11 +12,12 @@ {{ header("Correlation Matrix") }} +
{% if lowest_overlap < 8 %}
Caution: This matrix of correlations contains some cells with small sample sizes of fewer than 8.
{% endif %} - +
@@ -26,12 +27,26 @@ {% for trait in traits %} - + {% endfor %} {% for trait in traits %} - + {% for result in corr_results[loop.index-1] %} {% if result[0].name == trait.name %} @@ -43,7 +58,9 @@ {% endfor %}
P e a r s o n     r Trait{{ loop.index }} + Trait{{ loop.index }} +
Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }} + Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }} + + + n
{{ result[2] }}
- +
+ +
@@ -79,6 +96,7 @@ +
{% endblock %} -- cgit v1.2.3