view x/static/js/489.43cb4a5f.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/489.43cb4a5f.chunk.js","mappings":"6ZA6BA,MAEMA,EAAMA,CAACC,EAAWC,IAAkB,GAF9BC,EAACC,EAAI,OAASA,GAAGC,QAAQ,GAEQF,CAAKF,GAAKC,GAAS,GAAM,QAMhEI,EAAkBC,EAAAA,YACtB,UAA0B,QAAEC,GAAWC,GACrC,MAAMC,EAAQF,EAAQG,IAAI,SACpBC,EAAMJ,EAAQG,IAAI,OAClBE,EAAOL,EAAQG,IAAI,YACnB,QACJG,EAAO,IACPC,EAAG,MACHb,EAAK,IACLc,EACA,KAAMC,EACN,EAAKC,EACL,EAAKC,KACFC,GACDZ,EAAQG,IAAI,WACVU,EAAM,CACVR,EACAH,IAAUE,GAAMU,EAAAA,EAAAA,UAASZ,GAAS,IAAGY,EAAAA,EAAAA,UAASZ,QAAWY,EAAAA,EAAAA,UAASV,MAEjEW,QAAOC,KAAOA,IACdC,KAAK,KAER,OACElB,EAAAA,cAAA,OAAKS,IAAKP,GACRF,EAAAA,cAAA,aACEA,EAAAA,cAAA,eAAUc,GACVd,EAAAA,cAAA,aACEA,EAAAA,cAAA,UACEA,EAAAA,cAAA,UAAI,QACJA,EAAAA,cAAA,UAAI,SACJA,EAAAA,cAAA,UAAI,cACJA,EAAAA,cAAA,UAAI,WACJA,EAAAA,cAAA,UAAI,YAGRA,EAAAA,cAAA,aACEA,EAAAA,cAAA,UACEA,EAAAA,cAAA,UAAI,SACJA,EAAAA,cAAA,UAAKQ,IAEPR,EAAAA,cAAA,UACEA,EAAAA,cAAA,UAAI,OAAKO,EAAU,IAAIA,EAAQY,iBAAmB,IAClDnB,EAAAA,cAAA,UAAKS,GACLT,EAAAA,cAAA,UAAKP,EAAIgB,EAAKD,IACdR,EAAAA,cAAA,UACGU,EAAM,GAAGA,OAAW,GACpBC,EAAK,GAAGA,OAAU,IAErBX,EAAAA,cAAA,YAGDoB,OAAOC,QAAQR,GAAMS,KAAI,EAAEC,EAAKC,KAC/BJ,OAAOC,QAAQG,GAAOF,KAAI,EAAEG,EAAMC,KAChC1B,EAAAA,cAAA,MAAIuB,IAAKE,GACPzB,EAAAA,cAAA,UAAKyB,EAAKN,eACVnB,EAAAA,cAAA,UAAK0B,EAAM/B,OACXK,EAAAA,cAAA,UACY,UAATyB,GAA6B,SAATA,EACjB,MACAhC,EAAIiC,EAAM/B,MAAOa,IAEvBR,EAAAA,cAAA,UACG0B,GAAM,GAAQ,GAAGA,GAAM,QAAa,GACpCA,EAAM,GAAO,GAAGA,EAAM,QAAY,IAErC1B,EAAAA,cAAA,UAAKuB,UAQrB,IAqBF,GAhB2BI,EAAAA,EAAAA,WAAS,SAAUC,GAS5C,MAAM,MAAEC,GAAUD,GACVE,kBAAmBC,GAASF,EACpC,OAAOE,GAA6B,SAArBA,EAAK3B,IAAI,QAAqB,KAC3CJ,EAAAA,cAACgC,EAAAA,GAAOC,EAAA,CAAClC,gBAAiBA,GAAqB6B,GAEnD,G","sources":["../../../plugins/alignments/src/LinearSNPCoverageDisplay/components/Tooltip.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react'\nimport { Feature, toLocale } from '@jbrowse/core/util'\nimport { Tooltip } from '@jbrowse/plugin-wiggle'\n\ntype Count = Record<\n  string,\n  {\n    total: number\n    '-1': number\n    '0': number\n    '1': number\n  }\n>\n\ninterface SNPInfo {\n  cov: Count\n  lowqual: Count\n  noncov: Count\n  delskips: Count\n  refbase: string\n  total: number\n  ref: number\n  all: number\n  '-1': number\n  '0': number\n  '1': number\n}\n\nconst toP = (s = 0) => +(+s).toFixed(1)\n\nconst pct = (n: number, total: number) => `${toP((n / (total || 1)) * 100)}%`\n\ninterface Props {\n  feature: Feature\n}\n\nconst TooltipContents = React.forwardRef<HTMLDivElement, Props>(\n  function TooltipContents2({ feature }, reactRef) {\n    const start = feature.get('start')\n    const end = feature.get('end')\n    const name = feature.get('refName')\n    const {\n      refbase,\n      all,\n      total,\n      ref,\n      '-1': rn1,\n      '1': r1,\n      '0': r0,\n      ...info\n    } = feature.get('snpinfo') as SNPInfo\n    const loc = [\n      name,\n      start === end ? toLocale(start) : `${toLocale(start)}..${toLocale(end)}`,\n    ]\n      .filter(f => !!f)\n      .join(':')\n\n    return (\n      <div ref={reactRef}>\n        <table>\n          <caption>{loc}</caption>\n          <thead>\n            <tr>\n              <th>Base</th>\n              <th>Count</th>\n              <th>% of Total</th>\n              <th>Strands</th>\n              <th>Source</th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>Total</td>\n              <td>{all}</td>\n            </tr>\n            <tr>\n              <td>REF {refbase ? `(${refbase.toUpperCase()})` : ''}</td>\n              <td>{ref}</td>\n              <td>{pct(ref, all)}</td>\n              <td>\n                {rn1 ? `${rn1}(-)` : ''}\n                {r1 ? `${r1}(+)` : ''}\n              </td>\n              <td />\n            </tr>\n\n            {Object.entries(info).map(([key, entry]) =>\n              Object.entries(entry).map(([base, score]) => (\n                <tr key={base}>\n                  <td>{base.toUpperCase()}</td>\n                  <td>{score.total}</td>\n                  <td>\n                    {base === 'total' || base === 'skip'\n                      ? '---'\n                      : pct(score.total, all)}\n                  </td>\n                  <td>\n                    {score['-1'] ? `${score['-1']}(-)` : ''}\n                    {score['1'] ? `${score['1']}(+)` : ''}\n                  </td>\n                  <td>{key}</td>\n                </tr>\n              )),\n            )}\n          </tbody>\n        </table>\n      </div>\n    )\n  },\n)\n\ntype Coord = [number, number]\n\nconst SNPCoverageTooltip = observer(function (props: {\n  model: {\n    featureUnderMouse?: Feature\n  }\n  height: number\n  offsetMouseCoord: Coord\n  clientMouseCoord: Coord\n  clientRect?: DOMRect\n}) {\n  const { model } = props\n  const { featureUnderMouse: feat } = model\n  return feat && feat.get('type') === 'skip' ? null : (\n    <Tooltip TooltipContents={TooltipContents} {...props} />\n  )\n})\n\nexport default SNPCoverageTooltip\n"],"names":["pct","n","total","toP","s","toFixed","TooltipContents","React","feature","reactRef","start","get","end","name","refbase","all","ref","rn1","r1","r0","info","loc","toLocale","filter","f","join","toUpperCase","Object","entries","map","key","entry","base","score","observer","props","model","featureUnderMouse","feat","Tooltip","_extends"],"sourceRoot":""}