aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorZachary Sloan2013-11-26 00:09:26 +0000
committerZachary Sloan2013-11-26 00:09:26 +0000
commit8f91205970bfbce7bbe049889a31dfa98c9ef168 (patch)
tree2ad463f086a614cbd6adccc0eb4ad2cb6626d58e /wqflask/wqflask
parente069e5dd7a8f007a4bdf248f733f4003baf65ca2 (diff)
downloadgenenetwork2-8f91205970bfbce7bbe049889a31dfa98c9ef168.tar.gz
Made some progress towards getting the traits inside a collection to display on hover
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r--wqflask/wqflask/collect.py11
-rw-r--r--wqflask/wqflask/static/new/javascript/get_traits_from_collection.coffee12
-rw-r--r--wqflask/wqflask/static/new/javascript/get_traits_from_collection.js15
-rw-r--r--wqflask/wqflask/static/new/javascript/scientific_notation.js13
4 files changed, 32 insertions, 19 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 991d281c..48b4b4da 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -150,8 +150,15 @@ def view_collection():
trait_ob.get_info()
trait_obs.append(trait_ob)
- json_version.append(dict(name=trait_ob.name))
- #dis=trait_ob.description))
+ json_version.append(trait_ob.jsonable())
+ #json_version.append(dict(name=trait_ob.name,
+ # description=trait_ob.description_display,
+ # location=trait_ob.location_repr,
+ # mean=trait_ob.mean,
+ # lrs_score=trait_ob.LRS_score_repr,
+ # lrs_location=trait_ob.LRS_location_repr))
+ # dis=trait_ob.description))
+ #json_version.append(trait_ob.__dict__th)
collection_info = dict(trait_obs=trait_obs,
uc = uc)
diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.coffee b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.coffee
index 6854dda5..8566b804 100644
--- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.coffee
+++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.coffee
@@ -7,9 +7,17 @@ collection_hover = () ->
this_collection_url = $(this).find('.collection_name').prop("href")
this_collection_url += "&json"
console.log("this_collection_url", this_collection_url)
+ $.ajax(
+ dataType: "json",
+ url: this_collection_url,
+ success: process_traits
+ )
+
+process_traits = (trait_data, textStatus, jqXHR) ->
+ console.log('in process_traits with trait_data:', trait_data)
+ html = "<table>"
+
$ ->
console.log("inside get_traits_from_collection")
$(document).on("mouseover", ".collection_line", collection_hover)
-
- \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
index 9ef31088..57f42a38 100644
--- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
+++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
@@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.6.1
(function() {
- var collection_hover;
+ var collection_hover, process_traits;
console.log("before get_traits_from_collection");
@@ -9,7 +9,18 @@
console.log("Hovering over:", $(this));
this_collection_url = $(this).find('.collection_name').prop("href");
this_collection_url += "&json";
- return console.log("this_collection_url", this_collection_url);
+ console.log("this_collection_url", this_collection_url);
+ return $.ajax({
+ dataType: "json",
+ url: this_collection_url,
+ success: process_traits
+ });
+ };
+
+ process_traits = function(trait_data, textStatus, jqXHR) {
+ var html;
+ console.log('in process_traits with trait_data:', trait_data);
+ return html = "<table>";
};
$(function() {
diff --git a/wqflask/wqflask/static/new/javascript/scientific_notation.js b/wqflask/wqflask/static/new/javascript/scientific_notation.js
deleted file mode 100644
index 82c55fda..00000000
--- a/wqflask/wqflask/static/new/javascript/scientific_notation.js
+++ /dev/null
@@ -1,13 +0,0 @@
-jQuery.extend( jQuery.fn.dataTableExt.oSort, {
- "scientific-pre": function ( a ) {
- return parseFloat(a);
- },
-
- "scientific-asc": function ( a, b ) {
- return ((a < b) ? -1 : ((a > b) ? 1 : 0));
- },
-
- "scientific-desc": function ( a, b ) {
- return ((a < b) ? 1 : ((a > b) ? -1 : 0));
- }
-} ); \ No newline at end of file