diff options
author | zsloan | 2015-09-25 16:41:03 +0000 |
---|---|---|
committer | zsloan | 2015-09-25 16:41:03 +0000 |
commit | f4733114121b2f55bfcbd093ab2728f86860c9cd (patch) | |
tree | e3309d63e965bafe6cba93a4afe02a4327dcfc7c | |
parent | 048bbf7e4ee49fece9652dad401f40b6a865e1a9 (diff) | |
download | genenetwork2-f4733114121b2f55bfcbd093ab2728f86860c9cd.tar.gz |
Made the basic statistics table look nicer and got rid of the foo column if only one sample group
-rwxr-xr-x | wqflask/wqflask/show_trait/show_trait.py | 9 | ||||
-rwxr-xr-x | wqflask/wqflask/static/new/javascript/show_trait.js | 5 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/show_trait.html | 47 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/show_trait_statistics_new.html | 7 |
4 files changed, 53 insertions, 15 deletions
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index e83437ab..850c99a7 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -139,9 +139,12 @@ class ShowTrait(object): self.temp_uuid = uuid.uuid4() self.sample_group_types = OrderedDict() - self.sample_group_types['samples_primary'] = self.dataset.group.name + " Only" - self.sample_group_types['samples_other'] = "Non-" + self.dataset.group.name - self.sample_group_types['samples_all'] = "All Cases" + if len(self.sample_groups) > 1: + self.sample_group_types['samples_primary'] = self.dataset.group.name + " Only" + self.sample_group_types['samples_other'] = "Non-" + self.dataset.group.name + self.sample_group_types['samples_all'] = "All Cases" + else: + self.sample_group_types['samples_primary'] = self.dataset.group.name sample_lists = [group.sample_list for group in self.sample_groups] print("sample_lists is:", pf(sample_lists)) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 302d5ec4..1dd54e3a 100755 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -179,13 +179,10 @@ for (key in _ref) { if (!__hasProp.call(_ref, key)) continue; value = _ref[key]; - console.log("aa key:", key); - console.log("aa value:", value); the_id = process_id("column", key); header += "<th id=\"" + the_id + "\">" + value + "</th>"; } header += "</thead>"; - console.log("windex header is:", header); the_rows = "<tbody>"; for (_i = 0, _len = Stat_Table_Rows.length; _i < _len; _i++) { row = Stat_Table_Rows[_i]; @@ -201,9 +198,7 @@ for (key in _ref1) { if (!__hasProp.call(_ref1, key)) continue; value = _ref1[key]; - console.log("apple key:", key); the_id = process_id(key, row.vn); - console.log("the_id:", the_id); row_line += "<td id=\"" + the_id + "\">foo</td>"; } row_line += "</tr>"; diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index c5921ccf..a86a149d 100755 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -212,7 +212,7 @@ "buttons": [ 'csv' ], - "sDom": "RZBtir", + "sDom": "RZBtr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, @@ -240,7 +240,7 @@ "buttons": [ 'csv' ], - "sDom": "RZBtir", + "sDom": "RZBtr", "iDisplayLength": -1, "autoWidth": false, "bLengthChange": true, @@ -254,7 +254,48 @@ "paging": false } ); {% endif %} - + + console.log("SAMPLE GROUP TYPES:", js_data.sample_group_types) + if (Object.keys(js_data.sample_group_types).length > 1) { + $('#stats_table').DataTable( { + "columns": [ + { "bSortable": false }, + { "bSortable": false }, + { "bSortable": false }, + { "bSortable": false } + ], + "sDom": "RZtr", + "iDisplayLength": -1, + "autoWidth": false, + "bLengthChange": true, + "bDeferRender": true, + "bSortClasses": false, + "colResize": { + "tableWidthFixed": false + }, + "paging": false + } ); + } + else { + $('#stats_table').DataTable( { + "columns": [ + { "bSortable": false }, + { "bSortable": false } + ], + "sDom": "RZtr", + "iDisplayLength": -1, + "autoWidth": false, + "bLengthChange": true, + "bDeferRender": true, + "bSortClasses": false, + "colResize": { + "tableWidthFixed": false + }, + "paging": false + } ); + + } + var slider = document.getElementById('p_range_slider'); noUiSlider.create(slider, { start: [-1.0, 1.0], diff --git a/wqflask/wqflask/templates/show_trait_statistics_new.html b/wqflask/wqflask/templates/show_trait_statistics_new.html index b7323ba3..1c269fda 100755 --- a/wqflask/wqflask/templates/show_trait_statistics_new.html +++ b/wqflask/wqflask/templates/show_trait_statistics_new.html @@ -24,10 +24,9 @@ <div class="tab-content"> <div class="tab-pane active" id="stats_tab"> <div style="padding: 20px" class="form-horizontal"> - <div class="well"> - <h3>Stats</h3> - <table id="stats_table" class="table table-hover"></table> - </div> + + <table id="stats_table" style="width: 300px; float: left;" class="table table-hover"></table> + </div> </div> <div class="tab-pane" id="histogram_tab"> |