diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/index.html | 14 | ||||
-rw-r--r-- | templates/layout.html | 46 | ||||
-rw-r--r-- | templates/network.html | 46 |
3 files changed, 106 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..c7bafcd --- /dev/null +++ b/templates/index.html @@ -0,0 +1,14 @@ +{% extends "layout.html" %} +{% block content %} + + +<h3> Searching PubMed to find sentences related to addiction</h3> + <form class="form-inline my-2 my-lg-0" action="/network" method="POST"> + <input name="query" class="form-control mr-sm-2" type="search" placeholder="Nrxn1" aria-label="search" value="Nrxn1"> + <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> + </form> + +{% endblock %} + + + diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..1a81c1a --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,46 @@ +<!doctype html> +<head> +<!-- Required meta tags --> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + + <!-- Bootstrap CSS --> + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> + <link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> + + + <title>GatPub: Gene Addictionness through PubMed</title> +</head> +<body> + +<nav class="navbar navbar-expand-lg navbar-light bg-light"> + <a class="navbar-brand" href="#">GatPub</a> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarSupportedContent"> + <ul class="navbar-nav mr-auto"> + <li class="nav-item active"> + <a class="nav-link" href="/home">Home <span class="sr-only">(current)</span></a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/search">Search</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/result">Result</a> + </li> + </div> +</nav> + + <div class="container"> + {% block content %}{% endblock %} + </div> + +<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> +<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> +<script src="http://d3js.org/d3.v5.min.js"></script> +</body> + + diff --git a/templates/network.html b/templates/network.html new file mode 100644 index 0000000..24c18c1 --- /dev/null +++ b/templates/network.html @@ -0,0 +1,46 @@ +{% extends "layout.html" %} +{% block content %} + +<script type="text/javascript" src="{{ url_for('static', filename='cytoscape.min.js') }}"></script> + + + <div id="cy"></div> + <script> + var cy = cytoscape({ + container: document.getElementById('cy'), + + style: [ + { selector: 'node', + css: { + 'content': 'data(id)', + 'text-valign': 'center', + 'text-halign': 'center', + 'background-color': 'data(nodecolor)', + 'font-weight': 'data(fontweight)' + } + }, + + { selector: 'edge', + css: { + 'content': 'data(sentCnt)', + 'curve-style': 'bezier', + "opacity": "0.4", + } + } + ], + elements:[ {{ elements | safe }} ], + + layout: { + name: 'concentric', + concentric: function( node ){ + return node.degree(); + }, + levelWidth: function( nodes ){ + return 2; + } + }, + + }); + </script> + +{% endblock %} |