aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-12-06 15:03:27 +0300
committerBonfaceKilz2020-12-06 15:47:49 +0300
commita865a2d490722e866c847a996439ed31253fea8a (patch)
tree31ca5d2212ba40876cf64426e0b596264d043efd
parentb39395e648d8f1f26e3455c3be8dd1a2ec0d3592 (diff)
downloadgenenetwork2-a865a2d490722e866c847a996439ed31253fea8a.tar.gz
Add svg graph of inputs
* wqflask/wqflask/markdown_routes.py: New import: "send_from_directory" (svg_graph): New function that adds route for svg_graph. * wqflask/wqflask/static/new/css/markdown.css: New style rules for svg graph. * wqflask/wqflask/templates/environment.html: Add new section for displaying svg graph.
-rw-r--r--wqflask/wqflask/markdown_routes.py8
-rw-r--r--wqflask/wqflask/static/new/css/markdown.css7
-rw-r--r--wqflask/wqflask/templates/environment.html7
3 files changed, 21 insertions, 1 deletions
diff --git a/wqflask/wqflask/markdown_routes.py b/wqflask/wqflask/markdown_routes.py
index 3b60bc96..ebf75807 100644
--- a/wqflask/wqflask/markdown_routes.py
+++ b/wqflask/wqflask/markdown_routes.py
@@ -9,6 +9,7 @@ import sys
from bs4 import BeautifulSoup
+from flask import send_from_directory
from flask import Blueprint
from flask import render_template
@@ -99,6 +100,13 @@ def environments():
200)
+@environments_blueprint.route('/svg-dependency-graph')
+def svg_graph():
+ directory, file_name, _ = get_file_from_python_search_path(
+ "wqflask/dependency-graph.svg").partition("dependency-graph.svg")
+ return send_from_directory(directory, file_name)
+
+
@links_blueprint.route("/")
def links():
return render_template(
diff --git a/wqflask/wqflask/static/new/css/markdown.css b/wqflask/wqflask/static/new/css/markdown.css
index 38d664e2..859fe7fc 100644
--- a/wqflask/wqflask/static/new/css/markdown.css
+++ b/wqflask/wqflask/static/new/css/markdown.css
@@ -62,7 +62,8 @@
}
.graph-legend,
-#guix-graph {
+#guix-graph,
+#guix-svg-graph{
width: 90%;
margin: 10px auto;
}
@@ -71,6 +72,10 @@
border: solid 2px black;
}
+#guix-svg-graph img {
+ width: 100%;
+}
+
#markdown table {
width: 100%;
}
diff --git a/wqflask/wqflask/templates/environment.html b/wqflask/wqflask/templates/environment.html
index 5fe01dad..85133ac3 100644
--- a/wqflask/wqflask/templates/environment.html
+++ b/wqflask/wqflask/templates/environment.html
@@ -21,6 +21,13 @@
</div>
<div id="guix-graph"></div>
+
+<!-- Display the svg graph -->
+
+<div id="guix-svg-graph">
+ <h1>The dependency graph is shown below</h1>
+ <img alt="Dependency graph of the tools needed to build python3-genenetwork2" src="{{url_for('environments_blueprint.svg_graph')}}"/>
+</div>
{% endif %}
{% endblock %}