bio-vis-expression-bar
Version:
Simple barchart to show expression levels across experiments
48 lines (39 loc) • 1.47 kB
JavaScript
var biovisexpressionbar = require("bio-vis-expression-bar");
$(document).ready(function(){
runThese();
})
function runThese(){
var navHeight = $('nav').outerHeight(true);
var footerHeight = $('footer').outerHeight(true);
var avaHeight = $(window).outerHeight(true) - navHeight - footerHeight -5;
var container_div="bar_expression_viewer";
var parentWidth = $("#bar_expression_viewer").parent().width();
var eb = new biovisexpressionbar.ExpressionBar({
target: container_div,
data: window.location.href + "/../data/heatmapexmp.json",
renderProperty: 'tpm',
fontFamily:'Helvetica Neue, Helvetica, Arial, sans-serif',
groupBy: ["Fruit ripening stage"],
height: avaHeight,
plot:'HeatMap'
});
// Key 'T' for showing the ternary plot as shortcut
$(document).keypress(function(event){
var keyPressed = (String.fromCharCode(event.which));
if(keyPressed === 't'){
$(`#bar_expression_viewer_showTernaryPlot`).click();
}
});
// Resize function
var resizeTimer;
$(window).on('resize', function(e){
clearTimeout(resizeTimer); // Making sure that the reload doesn't happen if the window is resized within 1.5 seconds
resizeTimer = setTimeout(function(){
var navHeight = $('nav').outerHeight(true);
var footerHeight = $('footer').outerHeight(true);
var avaHeight = $(window).outerHeight(true) - navHeight - footerHeight -5;
eb.resizeChart(avaHeight);
}, 1500);
});
// $('.wrapper').css('height', $(window).height());
}