aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/cytoscape.html10
-rw-r--r--templates/index.html16
-rw-r--r--templates/layout.html4
-rw-r--r--templates/sentences.html3
4 files changed, 16 insertions, 17 deletions
diff --git a/templates/cytoscape.html b/templates/cytoscape.html
index fd2000e..c0c6bf6 100644
--- a/templates/cytoscape.html
+++ b/templates/cytoscape.html
@@ -22,7 +22,7 @@
css: {
'content': 'data(sentCnt)',
'curve-style': 'bezier',
- 'opacity': '0.3'
+ 'opacity': 'mapData(sentCnt, 1, 50, 0.2, 0.3)',
}
},
{ selector: 'node.highlight',
@@ -50,6 +50,7 @@
name: 'circle'
}
});
+
cy.on('tap', 'edge', function(){
try { // your browser may block popups
window.open( this.data('url') );
@@ -57,6 +58,13 @@
window.location.href = this.data('url');
}
});
+ cy.on('tap', 'node', function(){
+ try { // your browser may block popups
+ window.open( this.data('url') );
+ } catch(e){ // fall back on url change
+ window.location.href = this.data('url');
+ }
+ });
cy.on('mouseover', 'node', function(e){
var sel = e.target;
cy.elements().difference(sel.outgoers()).not(sel).addClass('semitransp');
diff --git a/templates/index.html b/templates/index.html
index ba18e0c..011aa6f 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,22 +3,14 @@
<p>
<form action="/search">
- <input name="query" class="form-control form-control-lg" type="search" placeholder="e.g., Rgma Nrxn3, up to 5 terms are allowed" aria-label="search" value="">
+ <input name="query" class="form-control form-control-lg" type="search" placeholder="Rgma Nrxn3" aria-label="search" value="">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
<br>
- This app searches PubMed to find <u>sentences</u> that contain the query terms (e.g., gene symbols) and a drug addiction related keyword. <a href="https://github.com/chen42/RatsPub/blob/master/ratspub.py#L95-L129">These keywords</a> belong to the following categories:
-<ul>
-<li> names of abused drugs, e.g., opioids</li>
-<li> terms describing addiction, e.g., relapse </li>
-<li> key brain regions implicated in addiction, e.g., ventral striatum </li>
-<li> neurotrasmission, e.g., dopaminergic </li>
-<li> synaptic plasticity, e.g., long term potentiation </li>
-<li> intracellular signaling, e.g., phosphorylation </li>
-</ul>
-
+ This app searches PubMed to find <i>sentences</i> that contain the query terms (e.g., gene symbols, <b>up to five are allowed per search</b>) and <a href="https://github.com/chen42/RatsPub/blob/master/ratspub.py#L95-L129">keywords</a> related to drug addiction.
+ <p>
<br>
-Live searches are conducted through PubMed to get relevant PMIDs, which are then used to retrieve the abstracts from a <a href="https://dataguide.nlm.nih.gov/edirect/archive.html">local archive</a>. The relationships are presented as an interactive <a href="https://js.cytoscape.org" >cytoscape</a> graph. The nodes can be moved around to better reveal the connections. Clicking on the links will bring up the corresponding sentences in a new browser window.
+Searches are conducted through PubMed to get relevant PMIDs, which are then used to retrieve the abstracts from a <a href="https://dataguide.nlm.nih.gov/edirect/archive.html">local archive</a>. The relationships are presented as an interactive <a href="https://js.cytoscape.org" >cytoscape</a> graph. The nodes can be moved around to better reveal the connections. Clicking on the links will bring up the corresponding sentences in a new browser window.
<p>
<hr>
<a href="https://github.com/chen42/ratspub"> Source code </a>
diff --git a/templates/layout.html b/templates/layout.html
index d64b331..cf8e8ed 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -13,7 +13,7 @@
</head>
<body>
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
+ <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/">RatsPub:</br> <span style="font-size:small"> <u>R</u>elationship with <u>A</u>ddiction <u>T</u>hrough <u>S</u>earches of <u>Pub</u>Med </span></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>
@@ -24,8 +24,6 @@
{% 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="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.6.0/cytoscape.min.js" integrity="sha256-uZV2wRlscgr52q3Wb3Oew0rKCPsM3g4aBTv46sF4qzg=" crossorigin="anonymous"></script>
</body>
diff --git a/templates/sentences.html b/templates/sentences.html
index c481817..f8da871 100644
--- a/templates/sentences.html
+++ b/templates/sentences.html
@@ -1,8 +1,9 @@
{% extends "layout.html" %}
{% block content %}
+<br>
{{ sentences | safe }}
-
+
{% endblock %}