58 lines
2.6 KiB
HTML
58 lines
2.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>MSAV event processing demo</title>
|
|
<script type="text/javascript" src="../js/multialign.js"></script>
|
|
<script>
|
|
function println(line){
|
|
var textarea = document.getElementById('output');
|
|
var value = textarea.textContent;
|
|
value += line + "\n";
|
|
textarea.textContent = value;
|
|
textarea.scrollTop = 99999;
|
|
};
|
|
|
|
MultiAlignViewOnReady(function() {
|
|
var app = MultiAlignView.App.findAppByDivId("msaviewer_1");
|
|
app.on({
|
|
'selection_changed': function(last) {
|
|
console.log('selection_changed: ', last);
|
|
println('selection_changed: ' + last.area.d);
|
|
println('Mapping Alignment position ' + (last.area.pos + 1) + ' to ' + last.area.d);
|
|
app.mapCoords([last.area.pos], 'alignment', last.area.id, function(respos) {
|
|
var mapped = respos[0];
|
|
if (mapped.length == 1) {
|
|
println(' - direct - : ' + mapped[0]);
|
|
return;
|
|
}
|
|
println(' - gap from: ' + mapped[1] + ' to: ' + mapped[2]);
|
|
});
|
|
},
|
|
'visible_range_changed': function(range) {
|
|
console.log('visible_range_changed: ', range);
|
|
println('visible_range_changed: from ' + range[0] +
|
|
' to ' + range[1] +
|
|
' len ' + range[2]);
|
|
},
|
|
'graphical_image_loaded': function(view) {
|
|
console.log('graphical_image_loaded: ', view);
|
|
println('graphical_image_loaded');
|
|
},
|
|
'master_changed': function(master) {
|
|
console.log('master_changed: ', master);
|
|
println('master_changed: ' + (master ? master : 'none'));
|
|
},
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h2>Event processing demo</h2>
|
|
<form>
|
|
<textarea id="output" readonly style="width:600px;height:300px;overflow-y:scroll;"></textarea>
|
|
</form>
|
|
<div id="msaviewer_1" class="MultiAlignViewerApp" data-autoload style="height:400px">
|
|
<a href="?appname=ncbi_msav_demo&url=https://www.ncbi.nlm.nih.gov/projects/msaviewer/data/YP.13.muscle.asn"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|