Skip to content

Commit 857ade8

Browse files
committed
Add checkbox to show/suppress Concept Graph in Synonyms; reset max to 1000 (from 50) [#2367]
1 parent cfc270a commit 857ade8

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

code/UI/interactive/index.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,14 @@ <h3 style="display:inline;">Synonym Lookup:</h3>
465465
<input type="text" autocomplete="off" autocapitalize="off" spellcheck="false" autocorrect="off" data-provide="typeahead" class="nodeInput questionBox" id="newsynonym" name="newsynonym" onkeydown="submit_on_enter(this);" size="100" maxlength="1000"/>
466466
<input type="button" class="questionBox button" name="action" value="Look Up" onClick="sendSyn();"/>
467467
<span title="clear" class="clq" onclick="pasteSyn('');">&#9587;</span>
468+
<br>
469+
<label id="showConceptGraphText" class="tiny">
470+
<span class="switch">
471+
<input id="showConceptGraph" type="checkbox" onchange="togglecolor(this,'showConceptGraphText');">
472+
<span class="slider"></span>
473+
</span>
474+
Show Concept Graph (can be very slow for large graphs)</label>
475+
468476
<div id="synonym_result_container"></div>
469477
</div>
470478

@@ -575,17 +583,15 @@ <h3 style="margin-bottom:0px;">EXTERNAL API (post query):</h3>
575583
<input type="button" class="qprob sbte" value="BTE" onClick="update_url('EXT','https://api.bte.ncats.io/v1');"/>
576584
<input type="button" class="qprob schp" value="CHP" onClick="update_url('EXT','http://chp.thayer.dartmouth.edu');"/>
577585
<input type="button" class="qprob p0" value="ClinicalRiskKP" onClick="update_url('EXT','https://api.bte.ncats.io/v1/smartapi/d86a24f6027ffe778f84ba10a7a1861a');"/>
586+
<input type="button" class="qprob p3" value="ClinicalTrialsKP" onClick="update_url('EXT','https://multiomics.rtx.ai:9990/ctkp');"/>
578587
<input type="button" class="qprob scod" value="COHD" onClick="update_url('EXT','https://cohd.io/api');"/>
588+
<input type="button" class="qprob p5" value="DrugApprovalsKP" onClick="update_url('EXT','https://multiomics.rtx.ai:9990/dakp');"/>
579589
<input type="button" class="qprob p0" value="DrugResponseKP" onClick="update_url('EXT','https://api.bte.ncats.io/v1/smartapi/adf20dd6ff23dfe18e8e012bde686e31');"/>
580590
<input type="button" class="qprob sgen" value="GeneticsKP" onClick="update_url('EXT','https://translator.broadinstitute.org/genetics_provider/trapi/v1.5');"/>
581-
<input type="button" class="qprob p1" value="ICEES-Asthma" onClick="update_url('EXT','https://icees.renci.org:16339');"/>
582-
<input type="button" class="qprob p1" value="ICEES-DILI" onClick="update_url('EXT','https://icees.renci.org:16341');"/>
583591
<input type="button" class="qprob smol" value="MolePro" onClick="update_url('EXT','https://translator.broadinstitute.org/molepro/trapi/v1.5');"/>
584592
<input type="button" class="qprob srtx" value="RTX-KG2" onClick="update_url('EXT','https://arax.ncats.io/api/rtxkg2/v1.4');"/>
585593
<input type="button" class="qprob p0" value="TumorGeneMutationKP" onClick="update_url('EXT','https://api.bte.ncats.io/v1/smartapi/5219cefb9d2b8d5df08c3a956fdd20f3');"/>
586594
<input type="button" class="qprob p0" value="WellnessKP" onClick="update_url('EXT','https://api.bte.ncats.io/v1/smartapi/02af7d098ab304e80d6f4806c3527027');"/>
587-
<input type="button" class="qprob p3" value="ClinicalTrialsKP" onClick="update_url('EXT','https://multiomics.rtx.ai:9990/ctkp');"/>
588-
<input type="button" class="qprob p5" value="DrugApprovalsKP" onClick="update_url('EXT','https://multiomics.rtx.ai:9990/dakp');"/>
589595
</span>
590596
<span>
591597
</span>
@@ -603,7 +609,7 @@ <h3 style="display:inline;margin-right:5px;margin-bottom:0px;">MAXIMUM NUMBER OF
603609
</span>
604610

605611
<span>
606-
<h3 style="display:inline;margin-right:5px;margin-bottom:0px;">MAXIMUM NUMBER OF SYNONYMS TO DISPLAY (values above 100 may slow down UI):</h3>
612+
<h3 style="display:inline;margin-right:5px;margin-bottom:0px;">MAXIMUM NUMBER OF SYNONYMS TO DISPLAY (values above 1000 may slow down UI):</h3>
607613
<input type="text" class="questionBox" id="maxsyns_url" onkeyup="enter_url(this,'maxsyns');" size="4" maxlength="4"/>
608614
nodes
609615
</span>

code/UI/interactive/rtx.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function main() {
6969
UIstate["version"] = checkUIversion(false);
7070
UIstate["scorestep"] = 0.1;
7171
UIstate["maxresults"] = 1000;
72-
UIstate["maxsyns"] = 50;
72+
UIstate["maxsyns"] = 1000;
7373
UIstate["prevtimestampobj"] = null;
7474
document.getElementById("menuapiurl").href = providers["ARAX"].url + "/ui/";
7575

@@ -752,7 +752,7 @@ async function sendSyn() {
752752
syndiv.innerHTML = "";
753753

754754
var maxsyn = UIstate["maxsyns"];
755-
var allweknow = await check_entity(word,true,maxsyn);
755+
var allweknow = await check_entity(word,true,maxsyn,document.getElementById("showConceptGraph").checked);
756756

757757
if (0) { // set to 1 if you just want full JSON dump instead of html tables
758758
syndiv.innerHTML = "<pre>"+JSON.stringify(allweknow,null,2)+"</pre>";
@@ -870,6 +870,9 @@ async function sendSyn() {
870870
span.append(' to change this value ]');
871871
text.appendChild(span);
872872
}
873+
else
874+
text.append(' ('+allweknow[word].total_synonyms+")");
875+
873876
div.appendChild(text);
874877

875878
table = document.createElement("table");
@@ -7654,6 +7657,8 @@ function check_entities_batch(batchsize) {
76547657
if (thisbatch) batches.push(thisbatch);
76557658

76567659
for (let batch of batches) {
7660+
if (batch.length < 1)
7661+
continue;
76577662
fetch(providers["ARAX"].url + "/entity", {
76587663
method: 'post',
76597664
body: JSON.stringify({"format":"minimal","terms":batch}),
@@ -7756,7 +7761,7 @@ function check_entities() {
77567761
}
77577762

77587763

7759-
async function check_entity(term,wantall,maxsyn=0) {
7764+
async function check_entity(term,wantall,maxsyn=0,getgraph=false) {
77607765
var data = {};
77617766
var ent = {};
77627767
ent.found = false;
@@ -7772,6 +7777,8 @@ async function check_entity(term,wantall,maxsyn=0) {
77727777
queryObj['terms'] = [term];
77737778
if(maxsyn > 0)
77747779
queryObj['max_synonyms'] = maxsyn;
7780+
if(!getgraph)
7781+
queryObj['format'] = 'slim';
77757782

77767783
var response = await fetch(providers["ARAX"].url + "/entity", {
77777784
method: 'post',
@@ -7933,7 +7940,7 @@ function update_url(urlkey,value) {
79337940
else if (urlkey == 'maxsyns') {
79347941
var sy = parseInt(document.getElementById(urlkey+"_url").value.trim());
79357942
if (isNaN(sy))
7936-
sy = 50;
7943+
sy = 1000;
79377944
UIstate[urlkey] = sy;
79387945
document.getElementById(urlkey+"_url").value = UIstate[urlkey];
79397946
}

code/UI/interactive/rtx.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Ill-fated Perch
1+
Thick African Buffalo

0 commit comments

Comments
 (0)