nih-gov/www.ncbi.nlm.nih.gov/projects/treeview/tvapp.html

94 lines
No EOL
2.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- $Id: tvapp.html 36497 2016-09-29 19:33:00Z lotovv $ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>NCBI Tree Viewer example</title>
<script type="text/javascript" src="js/treeviewer.js"></script>
</head>
<body>
<h2>TreeViewer Application </h2>
<div id="TreeViewerFrame" class="TreeViewerFrame">
<div id="TreeViewer0" class="TreeViewerApp">
<a href="embedded=true&nostatusbar=true"></a>
</div>
</div>
<div id="TreeViewerFrame1" class="TreeViewerFrame">
<div id="TreeViewer1" class="TreeViewerApp">
<a href="embedded=true"></a>
</div>
</div>
<script type="text/javascript">
var DemoApp = function() {
// do NOT access DOM from here; elements don't exist yet
// private variables
var initTimeout;
// private functions
// public space
return {
// public properties, e.g. strings to translate
// public methods
init: function() {
// var tviewer1 = TreeView.findAppByIndex( 0 );
function doInit()
{
if (typeof TreeView === 'undefined')
{
setTimeout(doInit, 50);//wait 50 millisecnds then recheck
return;
}
var instanceInit = function (params) {
if (TreeView.findAppByIndex(0) === null) {
setTimeout(instanceInit, 150); //wait 150 millisecnds then recheck
return;
}
var tviewer0 = TreeView.findAppByIndex(0);
var tviewer1 = TreeView.findAppByIndex(1);
tviewer0.reloadTree("?appname=ncbi_tviewer&btc_id=data/sample_tree.asn&renderer=rect&panx=30&pany=30");
tviewer1.reloadTree("?appname=ncbi_tviewer&btc_id=data/sample_tree.asn&renderer=radial&panx=30&pany=30");
};
instanceInit();
}
doInit();
} // end of init
};
}(); // end of app
window.onload = function ()
{
TreeViewOnReady( DemoApp.init, DemoApp );
}
</script>
</body>
</html>