From 03a91557c119fc2c4cdfc36015260034ead0ba98 Mon Sep 17 00:00:00 2001
From: Frederick Muriuki Muriithi
Date: Mon, 20 Sep 2021 06:54:04 +0300
Subject: Provide UI elements for clustered heatmap generation
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* wqflask/wqflask/collect.py: provide hard-coded URL for testing
* wqflask/wqflask/templates/collections/view.html: provide button
Provide a button to trigger the heatmap generation. As a test, we
also provide a hard-coded URL for the API endpoint to get the
heatmap data.
---
wqflask/wqflask/collect.py | 3 ++-
wqflask/wqflask/templates/collections/view.html | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 01274ba9..41ff47ae 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -219,7 +219,8 @@ def view_collection():
json_version.append(jsonable(trait_ob))
collection_info = dict(trait_obs=trait_obs,
- uc=uc)
+ uc=uc,
+ heatmap_data_url="http://localhost:8080/api/heatmaps/clustered")
if "json" in params:
return json.dumps(json_version)
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 9ec98ab1..09f9dd21 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -50,6 +50,12 @@
+
--
cgit v1.2.3
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(+)
(limited to 'wqflask')
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
From 614f641624582754e29b84d632e311ed5f186c1e Mon Sep 17 00:00:00 2001
From: Frederick Muriuki Muriithi
Date: Mon, 20 Sep 2021 09:06:28 +0300
Subject: Move "Clustered Heatmap" button to separate form
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Move the button out of the "export_form" into a new "heatmaps_form"
to avoid some weird JS interaction that showed up.
---
wqflask/wqflask/templates/collections/view.html | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 783458fc..06fd80f4 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -50,13 +50,16 @@
-
+
+