aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-09-20 08:55:01 +0300
committerFrederick Muriuki Muriithi2021-09-20 08:55:01 +0300
commit99bfeeef777bdaa804e4f91cae486a34fdf1e1c2 (patch)
tree6dfa22f62900c904c68728cfe9d991daaa79193c /wqflask
parent03a91557c119fc2c4cdfc36015260034ead0ba98 (diff)
downloadgenenetwork2-99bfeeef777bdaa804e4f91cae486a34fdf1e1c2.tar.gz
Implement proof-of-concept code to submit data
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Implement some javascript to activate the "Clustered Heatmap" button. This commit provides a proof-of-concept implementation to help with identifying the requirements for sending and receiving of the heatmaps data.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/templates/collections/view.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 09f9dd21..783458fc 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -253,6 +253,27 @@
$("#make_default").on("click", function(){
make_default();
});
+
+ $("#clustered-heatmaps").on("click", function() {
+ heatmap_url = $(this).attr("data-url")
+ console.log("heatmap url:", heatmap_url)
+ traits = $(".trait_checkbox:checked").map(function() {
+ return this.value
+ }).get();
+ console.log("SELECTED TRAITS", traits);
+ $.ajax({
+ type: "POST",
+ url: heatmap_url,
+ contentType: "application/json",
+ data: JSON.stringify({
+ "traits_names": traits
+ }),
+ dataType: "JSON",
+ success: function(res) {
+ console.log("results:", res)
+ }
+ });
+ });
});
</script>