From 9dfa122d93a69fbbb28f8106add1b689f9fde252 Mon Sep 17 00:00:00 2001 From: ryan-preble Date: Mon, 10 Feb 2025 16:28:49 -0500 Subject: [PATCH] Adding tool compatibility glyphs to gwas, stability, heritability pages --- js/source/entries/toolcompatibility.js | 34 ++++++++++++++++++++++++-- lib/SGN/Controller/AJAX/HTMLSelect.pm | 4 +-- mason/tools/heritability/index.mas | 2 +- mason/tools/solgwas/index.mas | 2 +- mason/tools/stability/index.mas | 4 +-- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/js/source/entries/toolcompatibility.js b/js/source/entries/toolcompatibility.js index 1ff67d9873..91fc1e2048 100644 --- a/js/source/entries/toolcompatibility.js +++ b/js/source/entries/toolcompatibility.js @@ -4,7 +4,10 @@ const abbreviations = { 'pca' : 'Population Structure', 'cluster' : 'Clustering', 'kinship' : 'Kinship & Inbreeding', - 'corr' : 'Correlation' + 'corr' : 'Correlation', + 'SolGWAS' : 'GWAS', + 'Heritability' : 'Heritability', + 'Stability' : 'Stability' } function substituteCompatibilities(abbreviation) { @@ -56,4 +59,31 @@ jQuery(document).ready(function() { substituteCompatibilities(analysis_abbr); }); }); -}); \ No newline at end of file +}); + +jQuery(document).ready(function() { + + async function sleep_before_draw(ms) { + await new Promise(resolve => setTimeout(resolve, ms)); + + jQuery('[id^=html-select-dataset-table-]').each(function(index,element){ + var table_id = element.id; + var title = jQuery('#pagetitle_h3').text(); + var table = jQuery(`#${table_id}`); + + substituteCompatibilities(title); + + table.on('draw.dt', function() { + substituteCompatibilities(title); + }); + }); + } + + sleep_before_draw(1000); + sleep_before_draw(2000); + sleep_before_draw(3500); + sleep_before_draw(5000); + sleep_before_draw(7500); + sleep_before_draw(10000); + sleep_before_draw(15000); +}); diff --git a/lib/SGN/Controller/AJAX/HTMLSelect.pm b/lib/SGN/Controller/AJAX/HTMLSelect.pm index 83dacb3138..74f2b4aaad 100644 --- a/lib/SGN/Controller/AJAX/HTMLSelect.pm +++ b/lib/SGN/Controller/AJAX/HTMLSelect.pm @@ -1712,7 +1712,7 @@ sub get_datasets_select :Path('/ajax/html/select/datasets') Args(0) { 'genotyping_protocols' => 'nd_protocol_ids_2_protocols' ); - my $html = ''; + my $html = '
SelectDataset NameContents
'; foreach my $ds (@datasets) { $html .= '"; } $html .= "
SelectDataset NameContentsCompatibility
'.$ds->{name}.''; @@ -1744,7 +1744,7 @@ sub get_datasets_select :Path('/ajax/html/select/datasets') Args(0) { $html .= "
"; - $html .= ''; + $html .= '

Working...

'; } $html .= ""; diff --git a/mason/tools/heritability/index.mas b/mason/tools/heritability/index.mas index 4f1c60702f..70d90eb970 100644 --- a/mason/tools/heritability/index.mas +++ b/mason/tools/heritability/index.mas @@ -12,7 +12,7 @@ -<& '/util/import_javascript.mas', classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> +<& '/util/import_javascript.mas', entries => ["toolcompatibility"], classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> diff --git a/mason/tools/solgwas/index.mas b/mason/tools/solgwas/index.mas index 49329166cf..5831d7935e 100644 --- a/mason/tools/solgwas/index.mas +++ b/mason/tools/solgwas/index.mas @@ -13,7 +13,7 @@ -<& '/util/import_javascript.mas', classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> +<& '/util/import_javascript.mas', entries => ["toolcompatibility"], classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> diff --git a/mason/tools/stability/index.mas b/mason/tools/stability/index.mas index 998b940d25..b0beb8dff0 100644 --- a/mason/tools/stability/index.mas +++ b/mason/tools/stability/index.mas @@ -13,7 +13,7 @@ -<& '/util/import_javascript.mas', classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> +<& '/util/import_javascript.mas', entries => ["toolcompatibility"], classes => ['jquery', 'jqueryui', 'CXGN.Login', 'd3.d3v4Min.js', 'CXGN.BreedersToolbox.HTMLSelect'] &> @@ -26,7 +26,7 @@ <& /page/page_title.mas, title=>"Stability" &> -<&| /page/info_section.mas, id=>"input_dataset_section", title=>"Select Input Data", collapsible=>1, collapsed=>0, subtitle=>'Help ' &> +<&| /page/info_section.mas, id=>"input_dataset_section", title=>"Select Input Data", collapsible=>1, collapsed=>0, subtitle=>'Help ' &>