Skip to content

Commit

Permalink
Adding tool compatibility glyphs to gwas, stability, heritability pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-preble committed Feb 10, 2025
1 parent 10533f3 commit 9dfa122
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
34 changes: 32 additions & 2 deletions js/source/entries/toolcompatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -56,4 +59,31 @@ jQuery(document).ready(function() {
substituteCompatibilities(analysis_abbr);
});
});
});
});

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);
});
4 changes: 2 additions & 2 deletions lib/SGN/Controller/AJAX/HTMLSelect.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ sub get_datasets_select :Path('/ajax/html/select/datasets') Args(0) {
'genotyping_protocols' => 'nd_protocol_ids_2_protocols'
);

my $html = '<table class="table table-bordered table-hover" id="html-select-dataset-table-'.$num.'"><thead><tr><th>Select</th><th>Dataset Name</th><th>Contents</th></tr></thead><tbody>';
my $html = '<table class="table table-bordered table-hover" id="html-select-dataset-table-'.$num.'"><thead><tr><th>Select</th><th>Dataset Name</th><th>Contents</th><th>Compatibility</th></tr></thead><tbody>';
foreach my $ds (@datasets) {
$html .= '<tr><td><input type="checkbox" name="'.$checkbox_name.'" value="'.$ds->{id}.'"></td><td><a href="/dataset/'.$ds->{id}.'">'.$ds->{name}.'</a></td><td>';

Expand Down Expand Up @@ -1744,7 +1744,7 @@ sub get_datasets_select :Path('/ajax/html/select/datasets') Args(0) {
$html .= "</td></div>";
}
$html .= "</tr></tbody></table>";
$html .= '</td></tr>';
$html .= '</td><td><p id="compatibility_glyph_'.$ds->{id}.'">Working...</p></td></tr>';
}

$html .= "</tbody></table>";
Expand Down
2 changes: 1 addition & 1 deletion mason/tools/heritability/index.mas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</%perl>


<& '/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'] &>

<script src="https://cdn.jsdelivr.net/npm/vega@4"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script>
Expand Down
2 changes: 1 addition & 1 deletion mason/tools/solgwas/index.mas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</%perl>


<& '/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'] &>

<script src="https://cdn.jsdelivr.net/npm/vega@4"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script>
Expand Down
4 changes: 2 additions & 2 deletions mason/tools/stability/index.mas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</%perl>


<& '/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'] &>


<script src="https://cdn.jsdelivr.net/npm/vega@3.3.1"></script>
Expand All @@ -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=>'<a class="btn btn-link pull-right" href="/help/solgwas" target="_blank">Help <span class="glyphicon glyphicon-question-sign"></span></a>' &>
<&| /page/info_section.mas, id=>"input_dataset_section", title=>"Select Input Data", collapsible=>1, collapsed=>0, subtitle=>'<a class="btn btn-link pull-right" href="/help/stability" target="_blank">Help <span class="glyphicon glyphicon-question-sign"></span></a>' &>
<input type="hidden" name="outformat" value="0" />
<div class="form-group form-inline">
<label for="dataset_select">Available Datasets: </label><div id="dataset_select"></div>
Expand Down

0 comments on commit 9dfa122

Please sign in to comment.