UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

38 lines (37 loc) 1.2 kB
import { u as e, i as c } from "./JBrowsePanel-uJIA-L6s.js"; async function s(t) { const { rpcSessionId: r } = e.getContainingTrack(t), { rpcManager: o } = e.getSession(t), n = e.getContainingView(t); if (!n.initialized || t.error || !t.statsReadyAndRegionNotTooLarge) return; t.setLoading(!0); const a = await o.call(r, "PileupGetReducedFeatures", { sessionId: r, regions: n.staticBlocks.contentBlocks, filterBy: t.filterBy, adapterConfig: t.adapterConfig }); t.setChainData(a), t.setLoading(!1); } function d(t, r) { c(t, async () => { await s(t); }, { delay: 1e3 }); function o(n) { const a = t.ref; if (!a) return; const i = a.getContext("2d"); i && t.chainData && (i.clearRect(0, 0, a.width, t.height * 2), i.resetTransform(), i.scale(2, 2), r(t, i, a.width, t.height), t.setLastDrawnOffsetPx(n.offsetPx), t.setLastDrawnBpPerPx(n.bpPerPx)); } c(t, async () => { const n = e.getContainingView(t); n.bpPerPx !== t.lastDrawnBpPerPx && o(n); }), c(t, async () => { const n = e.getContainingView(t); o(n); }, { delay: 1e3 }); } export { d as doAfterAttach }; //# sourceMappingURL=afterAttach-Cet7BwtB.js.map