taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
31 lines (30 loc) • 904 B
JavaScript
import { u as a, s as f } from "./JBrowsePanel-uJIA-L6s.js";
function x(t, e, i = 1) {
const c = e.map((n) => t.findIndex((o) => o.name === n)).sort((n, o) => n - o);
let s = 0;
for (const n of c) {
const o = Math.max(s, n - i);
o >= s && t.splice(o, 0, t.splice(n, 1)[0]), s = s + 1;
}
return t;
}
function m(t, e, i = 1) {
const c = e.map((n) => t.findIndex((o) => o.name === n)).sort((n, o) => o - n);
let s = t.length - 1;
for (const n of c) {
const o = Math.min(s, n + i);
o <= s && t.splice(o, 0, t.splice(n, 1)[0]), s = s - 1;
}
return t;
}
const p = 12.8;
function r(t) {
const { prefersOffset: e } = t, { trackLabels: i } = a.getContainingView(t), c = a.getContainingTrack(t), s = f.getConf(c, "name");
return i === "overlapping" && !e ? a.measureText(s, p) + 100 : 10;
}
export {
m as a,
r as g,
x as m
};
//# sourceMappingURL=util-BUvuuJah.js.map