Mercurial > repos > fubar > jbrowse2
view x/static/js/9070.d49de235.chunk.js.map @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | |
children |
line wrap: on
line source
{"version":3,"file":"static/js/9070.d49de235.chunk.js","mappings":"0LAQO,SAASA,EACdC,EACAC,GAeA,SAASC,EAAKC,GACZ,MAAMC,EAASJ,EAAKK,IACpB,IAAKD,EACH,OAGF,MAAME,EAAMF,EAAOG,WAAW,MACzBD,GAIAN,EAAKQ,YAIVF,EAAIG,UAAU,EAAG,EAAGL,EAAOM,MAAqB,EAAdV,EAAKW,QACvCL,EAAIM,iBACJN,EAAIO,MAAM,EAAG,GACbZ,EAAGD,EAAMM,EAAKF,EAAOM,MAAOV,EAAKW,QACjCX,EAAKc,qBAAqBX,EAAKY,UAC/Bf,EAAKgB,oBAAoBb,EAAKc,SAChC,EA7BAC,EAAAA,EAAAA,IACElB,GACAmB,gBCqBGA,eACLnB,GAGA,MAAQoB,aAAcC,IAAcC,EAAAA,EAAAA,oBAAmBtB,IACjD,WAAEuB,IAAeC,EAAAA,EAAAA,YAAWxB,GAC5BG,GAAOsB,EAAAA,EAAAA,mBAAkBzB,GAE/B,IAAKG,EAAKuB,aAAe1B,EAAK2B,OAAS3B,EAAK4B,eAC1C,OAGF5B,EAAK6B,YAAW,GAChB,MAAMC,QAAaP,EAAWQ,KAAKV,EAAW,2BAA4B,CACxEA,YACAW,QAAS7B,EAAK8B,aAAaC,cAC3BC,UAAUC,EAAAA,EAAAA,aAAYpC,EAAKmC,UAC3BE,cAAerC,EAAKqC,gBAGtBrC,EAAKsC,aAAaR,GAClB9B,EAAK6B,YAAW,EAClB,CD1CYU,CAAYvC,EAAK,GAEzB,CAAEwC,MAAO,OA2BXtB,EAAAA,EAAAA,IAAclB,GAAMmB,UAClB,MAAMhB,GAAOsB,EAAAA,EAAAA,mBAAkBzB,GAC3BG,EAAKc,UAAYjB,EAAKyC,kBACxBvC,EAAKC,EACP,KAIFe,EAAAA,EAAAA,IACElB,GACAmB,UAEEjB,GADauB,EAAAA,EAAAA,mBAAkBzB,GACrB,GAEZ,CAAEwC,MAAO,KAEb,C","sources":["../../../plugins/alignments/src/shared/afterAttach.tsx","../../../plugins/alignments/src/shared/fetchChains.ts"],"sourcesContent":["import { getContainingView } from '@jbrowse/core/util'\nimport { createAutorun } from '../util'\nimport { fetchChains } from './fetchChains'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\nimport { IAnyStateTreeNode } from 'mobx-state-tree'\n\ntype LGV = LinearGenomeViewModel\n\nexport function doAfterAttach<T extends IAnyStateTreeNode>(\n self: T,\n cb: (\n self: T,\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n ) => void,\n) {\n createAutorun(\n self,\n async () => {\n await fetchChains(self)\n },\n { delay: 1000 },\n )\n\n function draw(view: LGV) {\n const canvas = self.ref\n if (!canvas) {\n return\n }\n\n const ctx = canvas.getContext('2d')\n if (!ctx) {\n return\n }\n\n if (!self.chainData) {\n return\n }\n\n ctx.clearRect(0, 0, canvas.width, self.height * 2)\n ctx.resetTransform()\n ctx.scale(2, 2)\n cb(self, ctx, canvas.width, self.height)\n self.setLastDrawnOffsetPx(view.offsetPx)\n self.setLastDrawnBpPerPx(view.bpPerPx)\n }\n\n // first autorun instantly draws if bpPerPx changes\n createAutorun(self, async () => {\n const view = getContainingView(self) as LGV\n if (view.bpPerPx !== self.lastDrawnBpPerPx) {\n draw(view)\n }\n })\n\n // second autorun draws after delay 1000 e.g. if offsetPx changes\n createAutorun(\n self,\n async () => {\n const view = getContainingView(self) as LGV\n draw(view)\n },\n { delay: 1000 },\n )\n}\n","import {\n getContainingTrack,\n getContainingView,\n getSession,\n} from '@jbrowse/core/util'\nimport { getSnapshot } from 'mobx-state-tree'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\nimport { LinearReadArcsDisplayModel } from '../LinearReadArcsDisplay/model'\nimport { LinearReadCloudDisplayModel } from '../LinearReadCloudDisplay/model'\n\ntype LGV = LinearGenomeViewModel\n\nexport interface ReducedFeature {\n name: string\n strand: number\n refName: string\n start: number\n end: number\n id: string\n flags: number\n tlen: number\n pair_orientation: string\n next_ref?: string\n next_pos?: number\n clipPos: number\n SA?: string\n}\n\nexport interface ChainStats {\n max: number\n min: number\n upper: number\n lower: number\n}\n\nexport interface ChainData {\n chains: ReducedFeature[][]\n stats?: ChainStats\n}\n\nexport async function fetchChains(\n self: LinearReadArcsDisplayModel | LinearReadCloudDisplayModel,\n) {\n // @ts-expect-error\n const { rpcSessionId: sessionId } = getContainingTrack(self)\n const { rpcManager } = getSession(self)\n const view = getContainingView(self) as LGV\n\n if (!view.initialized || self.error || self.regionTooLarge) {\n return\n }\n\n self.setLoading(true)\n const ret = (await rpcManager.call(sessionId, 'PileupGetReducedFeatures', {\n sessionId,\n regions: view.staticBlocks.contentBlocks,\n filterBy: getSnapshot(self.filterBy),\n adapterConfig: self.adapterConfig,\n })) as ChainData\n\n self.setChainData(ret)\n self.setLoading(false)\n}\n"],"names":["doAfterAttach","self","cb","draw","view","canvas","ref","ctx","getContext","chainData","clearRect","width","height","resetTransform","scale","setLastDrawnOffsetPx","offsetPx","setLastDrawnBpPerPx","bpPerPx","createAutorun","async","rpcSessionId","sessionId","getContainingTrack","rpcManager","getSession","getContainingView","initialized","error","regionTooLarge","setLoading","ret","call","regions","staticBlocks","contentBlocks","filterBy","getSnapshot","adapterConfig","setChainData","fetchChains","delay","lastDrawnBpPerPx"],"sourceRoot":""}