INNER CODE UNIT · JavaScript
max_end
lh3/gfatools · js/gfa-plot.js:130
var max_end = -1, pl = [];
for (var j = 0; j < level_max.length; ++j) pl[j] = { cnt:0, i:-1 };
for (var j = 0; j < pred[i].length; ++j) {
var pos_ij = pos[pred[i][j]];
if (pos_ij.level >= 0) {
var end = pos_ij.start + pos_ij.len;
if (end > max_end) max_end = end;
pl[pos_ij.level].i = pred[i][j];
pl[pos_ij.level].end = pos[pred[i][j]].start + pos[pred[i][j]].len;
++pl[pos_ij.level].cnt;
}
}
pos[i].start = max_end + conf.xskip;
// look for an existing level
var l;
for (l = 0; l < level_max.length; ++l) {
if (pl[l].cnt > 1 || level_max[l] + conf.xskip > pos[i].start) continue;
if (pl[l].cnt == 0) break;