view x/static/js/9028.12f6efe2.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/9028.12f6efe2.chunk.js","mappings":"2KAYOA,eAAeC,EACpBC,EACAC,EACAC,GAOA,MACMC,GADOC,EAAAA,EAAAA,mBAAkBJ,GACZK,cAAcC,aAC3BC,EAASP,EAAKO,OACpB,GAAIN,EAAKO,gBAAiB,CACxB,MAAMC,EAASC,SAASC,cAAc,UACtCF,EAAON,MAAgB,EAARA,EACfM,EAAOF,OAAkB,EAATA,EAChB,MAAMK,EAAMH,EAAOI,WAAW,MAC9B,IAAKD,EACH,OAIF,OAFAA,EAAIE,MAAM,EAAG,GACbZ,EAAGF,EAAMY,EAAKT,EAAOI,GAEnBQ,EAAAA,cAAA,SACEZ,MAAOA,EACPI,OAAQA,EACRS,UAAWP,EAAOQ,UAAU,cAGlC,CAAO,CAEL,MACML,EAAM,WADM,sCACEM,SAAQf,EAAOI,GACnCL,EAAGF,EAAMY,EAAKT,EAAOI,GACrB,MAAMY,GA1CKC,EA0CUpB,EAAKoB,GAxCrB,YADwB,oBAATC,KACMD,EAAK,UAyC/B,OACEL,EAAAA,cAAAA,EAAAA,SAAA,KACEA,EAAAA,cAAA,YACEA,EAAAA,cAAA,YAAUK,GAAID,GACZJ,EAAAA,cAAA,QAAMO,EAAG,EAAGC,EAAG,EAAGpB,MAAOA,EAAOI,OAAQA,MAG5CQ,EAAAA,cAAA,KACES,wBAAyB,CAAEC,OAAQb,EAAIc,SAASC,WAChDC,SAAU,QAAQT,OAI1B,CAxDF,IAAeC,CAyDf,C","sources":["../../../plugins/alignments/src/shared/renderSvg.tsx"],"sourcesContent":["import React from 'react'\nimport { getContainingView } from '@jbrowse/core/util'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\n// stabilize clipid under test for snapshot\nfunction getId(id: string) {\n  const isJest = typeof jest === 'undefined'\n  return `arc-clip-${isJest ? id : 'jest'}`\n}\n\ntype LGV = LinearGenomeViewModel\n\nexport async function renderSvg<T extends { id: string; height: number }>(\n  self: T,\n  opts: { rasterizeLayers?: boolean },\n  cb: (\n    model: T,\n    ctx: CanvasRenderingContext2D,\n    width: number,\n    height: number,\n  ) => void,\n) {\n  const view = getContainingView(self) as LGV\n  const width = view.dynamicBlocks.totalWidthPx\n  const height = self.height\n  if (opts.rasterizeLayers) {\n    const canvas = document.createElement('canvas')\n    canvas.width = width * 2\n    canvas.height = height * 2\n    const ctx = canvas.getContext('2d')\n    if (!ctx) {\n      return\n    }\n    ctx.scale(2, 2)\n    cb(self, ctx, width, height)\n    return (\n      <image\n        width={width}\n        height={height}\n        xlinkHref={canvas.toDataURL('image/png')}\n      />\n    )\n  } else {\n    // @ts-ignore\n    const C2S = await import('canvas2svg')\n    const ctx = new C2S.default(width, height)\n    cb(self, ctx, width, height)\n    const clipid = getId(self.id)\n    return (\n      <>\n        <defs>\n          <clipPath id={clipid}>\n            <rect x={0} y={0} width={width} height={height} />\n          </clipPath>\n        </defs>\n        <g\n          dangerouslySetInnerHTML={{ __html: ctx.getSvg().innerHTML }}\n          clipPath={`url(#${clipid})`}\n        />\n      </>\n    )\n  }\n}\n"],"names":["async","renderSvg","self","opts","cb","width","getContainingView","dynamicBlocks","totalWidthPx","height","rasterizeLayers","canvas","document","createElement","ctx","getContext","scale","React","xlinkHref","toDataURL","default","clipid","id","jest","x","y","dangerouslySetInnerHTML","__html","getSvg","innerHTML","clipPath"],"sourceRoot":""}