From 05acf00467b9338072cde7556dc7b0ca130242c9 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Sat, 1 May 2021 01:14:30 +0300 Subject: add default values for empt columns --- .../wqflask/templates/test_correlation_page.html | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/wqflask/wqflask/templates/test_correlation_page.html b/wqflask/wqflask/templates/test_correlation_page.html index 40d9836c..be9ec226 100644 --- a/wqflask/wqflask/templates/test_correlation_page.html +++ b/wqflask/wqflask/templates/test_correlation_page.html @@ -45,6 +45,7 @@

Correlation Results for Dataset_name against trait_name for the top all Results

+

Toggle Columns

@@ -60,6 +61,8 @@ Sample r Sample p(r) N + Tissue rho + Lit rho @@ -85,8 +88,10 @@ // document.querySelector(".content").innerHTML =correlationResults // parse the data let counter = 0; + let corr_type = "tissue"; correlationResults =correlationResults.map((trait_object)=>{ let trait_name = Object.keys(trait_object)[0] + let new_dict = { "index":counter, "trait_name":trait_name, @@ -94,7 +99,9 @@ } counter++; return new_dict; - }) + }) + +console.log(correlationResults) @@ -102,13 +109,15 @@ $(document).ready(function() { let table = $('#example').DataTable( { "data": correlationResults, - "columns": [ - {"data":null,"width":"25px"}, + "columns": [ + {"data":corr_type=="sample"?null:"fd","width":"25px"}, { "data": "index","width":"120px","title":"Index" }, { "data": "trait_name","title":"TraitName"}, - { "data": "corr_coeffient"}, - { "data": "p_value"}, - { "data": "num_overlap"} + { "data": "corr_coeffient","defaultContent": "--"}, + { "data": "p_value","defaultContent":"--"}, + { "data": "num_overlap","defaultContent":"--"}, + {"data":"tissue_corr","defaultContent":"--","title":"Tissue rho"}, + {"data":"lit_corr","defaultContent":"--","title":"Lit rho"} ], "columnDefs": [ { -- cgit v1.2.3