From 99bfeeef777bdaa804e4f91cae486a34fdf1e1c2 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 20 Sep 2021 08:55:01 +0300 Subject: 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. --- wqflask/wqflask/templates/collections/view.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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) + } + }); + }); }); -- cgit v1.2.3