From 23e5c27d83d545fb1155ae9c0d558abe9c828c91 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Thu, 9 May 2019 15:47:10 -0500 Subject: links from nodes --- templates/cytoscape.html | 10 +++++++++- templates/index.html | 16 ++++------------ templates/layout.html | 4 +--- templates/sentences.html | 3 ++- 4 files changed, 16 insertions(+), 17 deletions(-) (limited to 'templates') 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 @@

- +

- This app searches PubMed to find sentences that contain the query terms (e.g., gene symbols) and a drug addiction related keyword. These keywords belong to the following categories: - - + This app searches PubMed to find sentences that contain the query terms (e.g., gene symbols, up to five are allowed per search) and keywords related to drug addiction. +


-Live searches are conducted through PubMed to get relevant PMIDs, which are then used to retrieve the abstracts from a local archive. The relationships are presented as an interactive cytoscape 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 local archive. The relationships are presented as an interactive cytoscape 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.


Source code 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 @@ -