diff options
author | Pjotr Prins | 2018-04-06 10:21:35 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-04-06 10:21:35 +0000 |
commit | 1debb0849066a31c8538b529536a9a7a12a0a8f9 (patch) | |
tree | ed1e4292add486535ba66517bf77c8c5fcf0499b /wqflask | |
parent | b579c97c58f4c5fe55a1dc100747699219b1c66e (diff) | |
download | genenetwork2-1debb0849066a31c8538b529536a9a7a12a0a8f9.tar.gz |
See #308.
Cytoscape and related is now loaded from Guix. Use the latest GN2_PROFILE.
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/utility/tools.py | 12 | ||||
-rw-r--r-- | wqflask/wqflask/templates/ctl_results.html | 22 | ||||
-rw-r--r-- | wqflask/wqflask/templates/network_graph.html | 28 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 10 |
4 files changed, 50 insertions, 22 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 59bb49d8..ea216a35 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -285,10 +285,16 @@ TEMPDIR = tempdir() # defaults to UNIX TMPDIR assert_dir(TEMPDIR) # ---- Handle specific JS modules +JS_GUIX_PATH = get_setting("JS_GUIX_PATH") +assert_dir(JS_GUIX_PATH) +assert_dir(JS_GUIX_PATH+'/cytoscape-panzoom') +CSS_PATH = "UNKNOWN" +# assert_dir(JS_PATH) JS_TWITTER_POST_FETCHER_PATH = get_setting("JS_TWITTER_POST_FETCHER_PATH",js_path("Twitter-Post-Fetcher")) assert_dir(JS_TWITTER_POST_FETCHER_PATH) - -from six import string_types +assert_file(JS_TWITTER_POST_FETCHER_PATH+"/js/twitterFetcher_min.js") +JS_CYTOSCAPE_PATH = get_setting("JS_CYTOSCAPE_PATH",js_path("cytoscape")) +assert_dir(JS_CYTOSCAPE_PATH) +assert_file(JS_CYTOSCAPE_PATH+'/cytoscape.min.js') # assert_file(PHEWAS_FILES+"/auwerx/PheWAS_pval_EMMA_norm.RData") -assert_file(JS_TWITTER_POST_FETCHER_PATH+"/js/twitterFetcher_min.js") diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index 969ca18a..d85075a9 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/css/network_graph.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/cytoscape/css/cytoscape.js-panzoom.css" /> + <link rel="stylesheet" type="text/css" href="/js/cytoscape-panzoom/cytoscape.js-panzoom.css" /> <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.css"> <style> /* The Cytoscape Web container must have its dimensions set. */ @@ -24,7 +24,7 @@ {% print("%c"|format(elem)) %} {%- endfor %} " /></a> --> - + <h3>CTL/QTL Plots for individual traits</h3> {% for r in range(2, (request.form['trait_list'].split(',')|length +1)) %} <a href="/tmp/{{ results['imgurl' + r|string] }}"> @@ -66,12 +66,18 @@ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.js"></script> <script language="javascript" type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/cytoscape.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/AC_OETags.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/json2.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/src/cytoscape-panzoom.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/src/cytoscape-qtip.js"></script> + <script language="javascript" type="text/javascript" src="/js/cytoscape/cytoscape.min.js"></script> + <script language="javascript" type="text/javascript" src="/js/cytoscape-panzoom/cytoscape-panzoom.js"></script> + <!-- should be using cytoscape-popper for tips, see docs --> + <script language="javascript" type="text/javascript" src="/js/cytoscape-qtip/cytoscape-qtip.js"></script> + <!-- + Loads flash - who wants that? + <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/AC_OETags.min.js"></script> + Disabled because it is standard JS now: + <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/json2.min.js"></script> +t> + --> <script language="javascript" type="text/javascript" src="/static/new/javascript/ctl_graph.js"></script> -{% endblock %} +{% endblock %} diff --git a/wqflask/wqflask/templates/network_graph.html b/wqflask/wqflask/templates/network_graph.html index 24293de6..ad5dee9d 100644 --- a/wqflask/wqflask/templates/network_graph.html +++ b/wqflask/wqflask/templates/network_graph.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block css %} <link rel="stylesheet" type="text/css" href="/static/new/css/network_graph.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/cytoscape/css/cytoscape.js-panzoom.css" /> + <link rel="stylesheet" type="text/css" href="/js/cytoscape-panzoom/cytoscape.js-panzoom.css" /> <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.css"> <style> /* The Cytoscape Web container must have its dimensions set. */ @@ -10,7 +10,7 @@ </style> {% endblock %} {% block content %} - + {{ header("Network Graph") }} <div class="container-fluid"> @@ -39,7 +39,7 @@ {% endfor %} </select> </td> - </tr> + </tr> <tr> <td colspan="1"> Correlation Coefficient<sup title="Filter edges to only show correlations less than the negative value specified with the slider and greater than the positive value. For example, moving the slider half way will display correlations less than -0.5 and greater than 0.5" style="color:#f00"> ?</sup> @@ -69,9 +69,9 @@ <option value="random">Random</option> </select> </td> - </tr> + </tr> </tbody> - </table> + </table> <h3 style="margin-bottom: 5px;"> Download</h3> <table> <tbody> @@ -102,11 +102,19 @@ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.js"></script> <script language="javascript" type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.js"></script> <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/cytoscape.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/AC_OETags.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/json2.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/src/cytoscape-panzoom.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/src/cytoscape-qtip.js"></script> + + <script language="javascript" type="text/javascript" src="/js/cytoscape/cytoscape.min.js"></script> + <script language="javascript" type="text/javascript" src="/js/cytoscape-panzoom/cytoscape-panzoom.js"></script> + <!-- should be using cytoscape-popper for tips, see docs --> + <script language="javascript" type="text/javascript" src="/js/cytoscape-qtip/cytoscape-qtip.js"></script> + + <!-- + Loads flash - who wants that? + <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/AC_OETags.min.js"></script> + Disabled because it is standard JS now: + <script language="javascript" type="text/javascript" src="/static/packages/cytoscape/js/min/json2.min.js"></script> + --> <script language="javascript" type="text/javascript" src="/static/new/javascript/network_graph.js"></script> + {% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index a65924d8..3c2cca94 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -54,7 +54,7 @@ from wqflask.ctl import ctl_analysis #from wqflask.trait_submission import submit_trait from utility import temp_data -from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION,JS_TWITTER_POST_FETCHER_PATH +from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION,JS_TWITTER_POST_FETCHER_PATH,JS_GUIX_PATH, CSS_PATH from utility.helper_functions import get_species_groups from base import webqtlFormData @@ -151,6 +151,14 @@ def tmp_page(img_path): return render_template("show_image.html", img_base64 = bytesarray ) +@app.route("/js/<path:filename>") +def js(filename): + return send_from_directory(JS_GUIX_PATH, filename) + +@app.route("/css/<path:filename>") +def css(filename): + return send_from_directory(CSS_PATH, filename) + @app.route("/twitter/<path:filename>") def twitter(filename): return send_from_directory(JS_TWITTER_POST_FETCHER_PATH, filename) |