aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/static/new/javascript/partial_correlations.js
blob: 5de1204c498d610124c31917c402676db908b560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function selected_traits() {
    traits = $("#trait_table input:checked").map(function() {
      return $(this).attr("data-trait-info");
    }).get();
    if (traits.length == 0){
      num_traits = $("#trait_table input").length
      if (num_traits <= 100){
        traits = $("#trait_table input").map(function() {
          return $(this).attr("data-trait-info");
        }).get();
      }
    }
    return traits
}

$("#partial-correlations").on("click", function() {
    // Submit the form to the `partial_correlations` endpoint
    url = $(this).data("url")
    traits = selected_traits();
    $("#trait_list").val(traits.reduce(function(acc, str) {
	return acc.concat(";;;".concat(str));
    }));
    $("input[name=tool_used]").val("Partial Correlation")
    $("input[name=form_url]").val(url)
    return submit_special(url)
})