Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (89 sloc) 3.54 KB
<!doctype html>
<html>
<head>
<title>Cytoscape Intermine</title>
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ To show the export table button, ensure that imtables is available in
+ the DOM before this script is loaded. The 'show in table' button
+ will automatically appear.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<script src="http://cdn.intermine.org/js/intermine/im-tables/2.0.0-beta/imtables.js" charset="UTF-8"></script>
<script src="http://cdn.intermine.org/js/intermine/imjs/3.15.0/im.min.js" charset="UTF-8"></script>
<link rel="stylesheet" href="http://cdn.intermine.org/js/intermine/im-tables/2.0.0-beta/main.sandboxed.css">
<link href="dist/style.css" rel="stylesheet" type="text/css">
<script src="dist/bundle.slim.js"></script>
</head>
<body>
<!-- This form is for demo purposes only, and not required to run the script -->
<form id="searchForm" name="searchForm">
<input type="text" id="searchOn" name="searchOn" placeholder="Search for another gene"></input>
<div class="nodeType">
<div>
<label><input type="radio" name="proteinOrGene" value="Protein"> Protein</label>
</div>
<div>
<label><input type="radio" name="proteinOrGene" value="Gene" checked="checked"> Gene</label>
</div>
</div>
<button>Search!</button>
</form>
<!-- End demo form -->
<div id="myAwesomeElement"></div> <!--this is where the graph will display. -->
<div id="cymine"></div> <!--this is where the graph would display if we didn't specify that myAwesomeElement is the parentElem -->
<script>
cymine({
//optional. Will default to '#cymine' if not specified:
parentElem : document.getElementById('myAwesomeElement'),
//required. can't query without this! :) must be a valid
//intermine API URL
service : {root : 'http://www.humanmine.org/humanmine/service/'},
//required. needs value : "whatever", optionally extraValue : "whatever".
queryOn : {
"value": "pparg",
"extraValue": "H. sapiens"
},
nodeType : "Gene", //valid options are Gene or Protein. Optional, will default to Gene.
compact:true //optional. Only relevant for error messages. Displays compact 1.5 em 'no results found' message rather than taking up the normal amount of space.
});
//EVERYTHING BELOW THIS LINE IS COMPLETELY OPTIONAL. IT JUST CREATES THE
//GENE SEARCH BOX, FOR DEMO PURPOSES:
var search = document.getElementById('searchForm');
search.addEventListener('submit', function(e) {
e.preventDefault(); //don't be silly, we don't need to reload the page
var searchOn = e.target.searchOn.value;
//remove any crazy stuff from the input before we send it
searchOn = searchOn.replace(/[^\w_]/g,"");
nodeType = search.proteinOrGene.value;
cymine({
parentElem : document.getElementById('myAwesomeElement'),
service : {root : 'http://www.humanmine.org/humanmine/service/'},
queryOn : {
"value": searchOn,
"extraValue": "H. sapiens"
},
nodeType: nodeType
});
});
</script>
<style>
#searchForm {
text-align:left;
padding:1em;
display:flex;
justify-content:center;
}
#searchOn, #searchForm button {
border-radius:4px;
padding:0.5em;
border:solid 1px #ccc;
}
#myAwesomeElement {
min-height:470px;
box-sizing:border-box;
}
.nodeType {
padding:0em 1em;
}
</style>
</body>
</html>
You can’t perform that action at this time.