UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

38 lines (37 loc) 1.19 kB
import { t as s, u as o, i as c } from "./JBrowsePanel-BNE3gNW1.js"; async function g(t) { const e = s.getRpcSessionId(t), { rpcManager: r } = o.getSession(t), n = o.getContainingView(t); if (!n.initialized || t.error || !t.statsReadyAndRegionNotTooLarge) return; t.setLoading(!0); const a = await r.call(e, "PileupGetReducedFeatures", { sessionId: e, regions: n.staticBlocks.contentBlocks, filterBy: t.filterBy, adapterConfig: t.adapterConfig }); t.setChainData(a), t.setLoading(!1); } function u(t, e) { c(t, async () => { await g(t); }, { delay: 1e3 }); function r(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), e(t, i, a.width, t.height), t.setLastDrawnOffsetPx(n.offsetPx), t.setLastDrawnBpPerPx(n.bpPerPx)); } c(t, async () => { const n = o.getContainingView(t); n.bpPerPx !== t.lastDrawnBpPerPx && r(n); }), c(t, async () => { const n = o.getContainingView(t); r(n); }, { delay: 1e3 }); } export { u as doAfterAttach }; //# sourceMappingURL=afterAttach-e7aspwHJ.js.map