INNER CODE UNIT · JavaScript
PLOT_HEIGHT
sirius-ms/sirius · lcms2/viewer/viewer.js:6
let PLOT_HEIGHT = SCREEN_HEIGHT * 0.5;
document.lcdata = [];
Object.keys(document.traces).forEach(function(traceId) {
if (traceId >= 0) {
document.lcdata.push(document.traces[traceId]);
}
});
document.lcdata.sort(function(a,b){return a.mz - b.mz;});
document.currentIndex = 0
d3.select("#mzslider").node().min = document.lcdata[0].mz;
d3.select("#mzslider").node().max = document.lcdata[document.lcdata.length-1].mz;
d3.select("#mzslider").style("width", (PLOT_WIDTH - 20) + "px");
function binarySearchClosest(arr, target,functor) {
let low = 0;
let high = arr.length - 1;
let closestIndex = -1;