jbrowse-plugin-msaview 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MsaViewPanel/model.d.ts +25 -29
- package/dist/chunks/AboutDialog-447TIFAW.js +2 -0
- package/dist/chunks/{AboutDialog-IRBPUPJK.js.map → AboutDialog-447TIFAW.js.map} +4 -4
- package/dist/chunks/AnnotationFileDialog-S3N5EHHE.js +2 -0
- package/dist/chunks/AnnotationFileDialog-S3N5EHHE.js.map +7 -0
- package/dist/chunks/ExportSVGDialog-7ZHKKQ7W.js +2 -0
- package/dist/chunks/ExportSVGDialog-7ZHKKQ7W.js.map +7 -0
- package/dist/chunks/{FeatureDialog-ZBX3XQZ5.js → FeatureDialog-EEOGSLOG.js} +1 -1
- package/dist/chunks/{FeatureDialog-ZBX3XQZ5.js.map → FeatureDialog-EEOGSLOG.js.map} +1 -1
- package/dist/chunks/HelpDialog-TCWNBZOV.js +2 -0
- package/dist/chunks/HelpDialog-TCWNBZOV.js.map +7 -0
- package/dist/chunks/{LaunchMsaViewDialog-GJAUPGFC.js → LaunchMsaViewDialog-R6CNRASN.js} +2 -2
- package/dist/chunks/{LaunchMsaViewDialog-GJAUPGFC.js.map → LaunchMsaViewDialog-R6CNRASN.js.map} +1 -1
- package/dist/chunks/MetadataDialog-MNSI6NEW.js +2 -0
- package/dist/chunks/{MetadataDialog-KZWQFRF7.js.map → MetadataDialog-MNSI6NEW.js.map} +2 -2
- package/dist/chunks/MsaViewPanel-R2WAER5O.js +2 -0
- package/dist/chunks/{MsaViewPanel-RUZAKFCB.js.map → MsaViewPanel-R2WAER5O.js.map} +1 -1
- package/dist/chunks/{TrackInfoDialog-IFIG77WO.js → TrackInfoDialog-W2F77IPG.js} +2 -2
- package/dist/chunks/{TrackInfoDialog-IFIG77WO.js.map → TrackInfoDialog-W2F77IPG.js.map} +1 -1
- package/dist/chunks/TreeNodeInfoDialog-T5XMPG3R.js +2 -0
- package/dist/chunks/{TreeNodeInfoDialog-VRCVIF26.js.map → TreeNodeInfoDialog-T5XMPG3R.js.map} +2 -2
- package/dist/chunks/chunk-6EOYBBT4.js +2 -0
- package/dist/chunks/chunk-6EOYBBT4.js.map +7 -0
- package/dist/chunks/chunk-A63PUWQZ.js +6 -0
- package/dist/chunks/chunk-A63PUWQZ.js.map +7 -0
- package/dist/chunks/{chunk-NI3VGKQP.js → chunk-BAM67QHH.js} +2 -2
- package/dist/chunks/chunk-CSCUNTGJ.js +18 -0
- package/dist/chunks/chunk-CSCUNTGJ.js.map +7 -0
- package/dist/chunks/chunk-DEFUNIWW.js +8 -0
- package/dist/chunks/chunk-DEFUNIWW.js.map +7 -0
- package/dist/chunks/{chunk-YOTSFJMU.js → chunk-ERCMNTEQ.js} +1 -1
- package/dist/chunks/{chunk-YOTSFJMU.js.map → chunk-ERCMNTEQ.js.map} +1 -1
- package/dist/chunks/{chunk-GDFVLZYX.js → chunk-FEUZKN5V.js} +2 -2
- package/dist/chunks/{chunk-GDFVLZYX.js.map → chunk-FEUZKN5V.js.map} +1 -1
- package/dist/chunks/{chunk-GIHMPOCO.js → chunk-JF6CW6MO.js} +1 -1
- package/dist/chunks/{chunk-GIHMPOCO.js.map → chunk-JF6CW6MO.js.map} +1 -1
- package/dist/chunks/chunk-K55ZVN73.js +5 -0
- package/dist/chunks/chunk-K55ZVN73.js.map +7 -0
- package/dist/chunks/chunk-L6CBIH6H.js +2 -0
- package/dist/chunks/chunk-L6CBIH6H.js.map +7 -0
- package/dist/chunks/{chunk-F3EC6OCO.js → chunk-NWHZOZMG.js} +1 -1
- package/dist/chunks/{chunk-F3EC6OCO.js.map → chunk-NWHZOZMG.js.map} +1 -1
- package/dist/chunks/chunk-OVAXNTPN.js +2 -0
- package/dist/chunks/chunk-OVAXNTPN.js.map +7 -0
- package/dist/chunks/chunk-TSHN6J7U.js +2 -0
- package/dist/chunks/chunk-TSHN6J7U.js.map +7 -0
- package/dist/chunks/{chunk-H6IQBAW7.js → chunk-WAPIOD25.js} +5 -5
- package/dist/chunks/{chunk-H6IQBAW7.js.map → chunk-WAPIOD25.js.map} +1 -1
- package/dist/chunks/chunk-XVNCZQMR.js +2 -0
- package/dist/chunks/{chunk-ZCT7RD24.js.map → chunk-XVNCZQMR.js.map} +1 -1
- package/dist/chunks/{dist-CMWKVHC7.js → dist-GXYZN4ZR.js} +2 -2
- package/dist/chunks/{dist-CMWKVHC7.js.map → dist-GXYZN4ZR.js.map} +3 -3
- package/dist/chunks/dist-N4ZJK63Q.js +2 -0
- package/dist/chunks/{model-VE7IYWNU.js → model-TCPB6WNJ.js} +2 -2
- package/dist/chunks/{model-VE7IYWNU.js.map → model-TCPB6WNJ.js.map} +1 -1
- package/dist/chunks/renderToSvg-53FEV6IJ.js +2 -0
- package/dist/jbrowse-plugin-msaview.esm.js +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
- package/dist/chunks/AboutDialog-IRBPUPJK.js +0 -2
- package/dist/chunks/AnnotationFileDialog-FCYYZ4JN.js +0 -2
- package/dist/chunks/AnnotationFileDialog-FCYYZ4JN.js.map +0 -7
- package/dist/chunks/ExportSVGDialog-TYYPI6VB.js +0 -2
- package/dist/chunks/ExportSVGDialog-TYYPI6VB.js.map +0 -7
- package/dist/chunks/MetadataDialog-KZWQFRF7.js +0 -2
- package/dist/chunks/MsaViewPanel-RUZAKFCB.js +0 -2
- package/dist/chunks/TreeNodeInfoDialog-VRCVIF26.js +0 -2
- package/dist/chunks/chunk-F726IWCW.js +0 -2
- package/dist/chunks/chunk-F726IWCW.js.map +0 -7
- package/dist/chunks/chunk-NMYD2GWF.js +0 -18
- package/dist/chunks/chunk-NMYD2GWF.js.map +0 -7
- package/dist/chunks/chunk-QQ5LZUIO.js +0 -11
- package/dist/chunks/chunk-QQ5LZUIO.js.map +0 -7
- package/dist/chunks/chunk-QUWPHTZQ.js +0 -2
- package/dist/chunks/chunk-QUWPHTZQ.js.map +0 -7
- package/dist/chunks/chunk-ZCT7RD24.js +0 -2
- package/dist/chunks/dist-R73J3CC3.js +0 -2
- package/dist/chunks/renderToSvg-VDXAB7TT.js +0 -2
- /package/dist/chunks/{chunk-NI3VGKQP.js.map → chunk-BAM67QHH.js.map} +0 -0
- /package/dist/chunks/{dist-R73J3CC3.js.map → dist-N4ZJK63Q.js.map} +0 -0
- /package/dist/chunks/{renderToSvg-VDXAB7TT.js.map → renderToSvg-53FEV6IJ.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function n(c,o){let t=URL.createObjectURL(c),e=document.createElement("a");e.href=t,e.download=o,e.click(),setTimeout(()=>{URL.revokeObjectURL(t)},4e4)}export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-NWHZOZMG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/react-msaview@9.
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/vendor/fileSaver.ts"],
|
|
4
4
|
"sourcesContent": ["export function saveAs(blob: Blob, name: string) {\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = name\n a.click()\n setTimeout(() => {\n URL.revokeObjectURL(url)\n }, 40_000)\n}\n"],
|
|
5
5
|
"mappings": "AAAM,SAAUA,EAAOC,EAAYC,EAAY,CAC7C,IAAMC,EAAM,IAAI,gBAAgBF,CAAI,EAC9BG,EAAI,SAAS,cAAc,GAAG,EACpCA,EAAE,KAAOD,EACTC,EAAE,SAAWF,EACbE,EAAE,MAAK,EACP,WAAW,IAAK,CACd,IAAI,gBAAgBD,CAAG,CACzB,EAAG,GAAM,CACX",
|
|
6
6
|
"names": ["saveAs", "blob", "name", "url", "a"]
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function c(t){let o=t.length>1;return t.flatMap(r=>[...o?[{key:r.id,label:r.title}]:[],...r.entries.map(e=>({key:`${r.id}:${e.id}`,label:e.label,color:e.color,hint:e.id}))])}var G=new Set(["exon","CDS","five_prime_UTR","three_prime_UTR","UTR","intron"]),z=["#9fb6d4","#d4dcea"],O=!0,B=!1,P=["both","horizontal","vertical"],X="both",y=8,k=5,Z=9;function A(t){return Math.min(Math.max(6,t-3),18)}var U=A(16),Y=.2,I=1,$=80,J=!0,j="maeditor",q=!0,K=!0,Q=!1,V=70,tt=160,et=10,ot=.3,rt=!0,nt=["branchLength","input","ladderize","ladderizeReverse"],at="branchLength",it=!0,st=!0,lt=!1,ct=!1,ht=120,pt=500,xt=.25,dt="#fff3c4",ut=.6,ft=5e4,gt=56,g=22,mt=200,D=1e3,wt=D+1;var h=8,R=16,_=12,Tt=12,E=7,v=360,C=h+_+6;function M(t){let o=t.reduce((e,n)=>Math.max(e,n.label.length),0),r=C+h+o*E;return Math.min(v,Math.max(120,r))}function N(t){return h*2+t.length*R}function bt(t,o){let{scrollX:r,scrollY:e,totalWidth:n,totalHeight:a,effectiveTreeAreaWidth:m,rowPanelsWidth:w,rowPanelsHeaderHeight:H,totalTrackAreaHeight:S,minimapHeight:L,msaAreaHeight:p,msaCanvasWidth:x,showHorizontalScrollbar:T,treeOverviewHeight:b,treeScaleBar:W}=t,i=o.includeTracks?S:0,l=o.exportType==="viewport"&&!!o.includeMinimap&&T,d=c(t.legends),u=d.length>0?M(d):0,s=Math.max(l?L:0,H,b+(W?g:0)),f=m+w;return o.exportType==="entire"?{width:n+f,msaAreaWidth:n,height:a+i+s,contentHeight:a,trackHeight:i,topHeight:s,offsetX:0,offsetY:0,includeMinimap:l,legendWidth:u}:{width:x+f,msaAreaWidth:x,height:p+s+i,contentHeight:p,trackHeight:i,topHeight:s,offsetX:-r,offsetY:-e,includeMinimap:l,legendWidth:u}}function Wt(t,o){let{width:r,height:e,legendWidth:n,topHeight:a}=o;return{width:r+n,height:n>0?Math.max(e,a+N(c(t.legends))):e}}export{c as a,G as b,z as c,O as d,B as e,P as f,X as g,y as h,k as i,Z as j,A as k,U as l,Y as m,I as n,$ as o,J as p,j as q,q as r,K as s,Q as t,V as u,tt as v,et as w,ot as x,rt as y,nt as z,at as A,it as B,st as C,lt as D,ct as E,ht as F,pt as G,xt as H,dt as I,ut as J,ft as K,gt as L,g as M,mt as N,D as O,wt as P,h as Q,R,_ as S,Tt as T,E as U,C as V,N as W,bt as X,Wt as Y};
|
|
2
|
+
//# sourceMappingURL=chunk-OVAXNTPN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/msa/legendRows.ts", "../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/constants.ts", "../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/exportLayout.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Legend } from '../../types.ts'\n\nexport interface LegendRow {\n key: string\n label: string\n color?: string\n hint?: string\n}\n\n// the legends flattened into the rows both the overlay and the export stack\n// top to bottom. A title row separates one legend from the next, and a lone\n// legend needs no title.\nexport function legendRows(legends: Legend[]): LegendRow[] {\n const titled = legends.length > 1\n return legends.flatMap(legend => [\n ...(titled ? [{ key: legend.id, label: legend.title }] : []),\n ...legend.entries.map(entry => ({\n key: `${legend.id}:${entry.id}`,\n label: entry.label,\n color: entry.color,\n hint: entry.id,\n })),\n ])\n}\n", "import type { TreeOrder } from './types.ts'\n\n// Main model defaults\nexport const defaultRowHeight = 16\nexport const defaultColWidth = 12\nexport const defaultHeight = 550\nexport const defaultScrollX = 0\nexport const defaultScrollY = 0\nexport const defaultCurrentAlignment = 0\n// Only a hidden overlay is stored, so a link that never mentions it opens\n// showing its annotations.\nexport const defaultShowDomains = true\nexport const defaultShowDomainLegend = true\nexport const defaultHideGaps = true\nexport const defaultAllowedGappyness = 100\nexport const defaultSubFeatureRows = false\n// height of one sub-row when subFeatureRows is on, unless the row has more\n// lanes than fit at this height (see renderBoxFeatureCanvasBlock)\nexport const subFeatureRowHeight = 4\n// height of the bar the overlay draws under a row in letter-color mode\nexport const domainUnderlineHeight = 3\n\n// Feature types that are ordinal segments of one transcript. The overlay\n// alternates two shades across them and labels them by number, where a domain\n// type gets its own hue and legend row.\nexport const segmentFeatureTypes = new Set([\n 'exon',\n 'CDS',\n 'five_prime_UTR',\n 'three_prime_UTR',\n 'UTR',\n 'intron',\n])\n\n// the two shades alternated across adjacent segments (exons)\nexport const segmentShades = ['#9fb6d4', '#d4dcea']\nexport const defaultDrawMsaLetters = true\nexport const defaultScrollZoom = false\n\n// Which cell dimensions a wheel zoom scales. 'horizontal' holds the row height,\n// which fixes the label and letter font size while the columns compress.\n// 'vertical' does the reverse.\nexport const scrollZoomAxes = ['both', 'horizontal', 'vertical'] as const\nexport type ScrollZoomAxis = (typeof scrollZoomAxes)[number]\nexport const defaultScrollZoomAxis: ScrollZoomAxis = 'both'\n\n// Cell size floors for drawing residue letters and tree labels. Below these a\n// 500px block holds thousands of glyphs, and fillText dominates every zoom\n// frame. A sprite atlas measured slower.\nexport const minLetterRowHeight = 8\nexport const minLetterColWidth = 5\n\n// A feature span draws its label at two pixels under its height, capped at 11,\n// so a span shorter than this holds no readable text: an underline bar, a\n// sub-row band or a features panel over small rows\nexport const minFeatureLabelHeight = 9\n\nexport function fontSizeFor(rowHeight: number) {\n return Math.min(Math.max(6, rowHeight - 3), 18)\n}\n\n// The fitted tree area measures the tip labels and the clade labels at the\n// font a default row draws, so a vertical zoom leaves the alignment in place.\n// A larger font ellipsizes the labels.\nexport const labelFitFontSize = fontSizeFor(defaultRowHeight)\n\n// Zoom limits, px per cell. maxCellSize caps both smooth zoom and the stepwise\n// zoom-in buttons (which otherwise grow unbounded). minColWidth/minRowHeight are\n// the smooth-zoom floors.\nexport const minColWidth = 0.2\nexport const minRowHeight = 1\nexport const maxCellSize = 80\n\n// MSA model defaults\nexport const defaultBgColor = true\nexport const defaultColorSchemeName = 'maeditor'\nexport const defaultShowColumnStats = true\n\n// Tree model defaults\nexport const defaultDrawLabels = true\nexport const defaultLabelsAlignRight = false\n// The fitted tree area gives the tree pxPerTreeDepth per level of its depth,\n// between minTreeWidth and maxFitTreeWidth, beside the widest label, and takes\n// at most maxTreeAreaShare of a view with an alignment. Where the share binds,\n// the tree keeps minTreeWidth and the labels ellipsize.\nexport const minTreeWidth = 70\nexport const maxFitTreeWidth = 160\nexport const pxPerTreeDepth = 10\nexport const maxTreeAreaShare = 0.3\nexport const defaultShowBranchLen = true\nexport const treeOrders = [\n 'branchLength',\n 'input',\n 'ladderize',\n 'ladderizeReverse',\n] as const satisfies readonly TreeOrder[]\nexport const defaultTreeOrder: TreeOrder = 'branchLength'\nexport const defaultDrawTree = true\nexport const defaultDrawNodeBubbles = true\nexport const defaultDrawNodeLabels = false\nexport const defaultShowTreeOverview = false\nexport const defaultOverviewHeight = 120\n\n// Neighbor joining does not run above this many rows. The distance matrix is\n// O(n^2*L) and the join loop O(n^3), both on the main thread with no progress\n// and no cancel: 400 rows measured 1.5s, 800 rows 10s, and 1600 would be about\n// seventy. See agent-docs/reference/neighbor-joining-scaling.md.\nexport const maxNeighborJoiningRows = 500\n\n// The opacity a `rowTint` encoding draws its scale's color at, so the residues\n// under the wash stay readable. A color the producer already gave an alpha\n// keeps it.\nexport const rowTintAlpha = 0.25\n\n// The fill a `clades` record with the `highlight` mark draws behind its rows,\n// and the opacity a producer's own color takes when it carries none.\nexport const cladeHighlightColor = '#fff3c4'\nexport const cladeHighlightAlpha = 0.6\n\n// The largest inline document a snapshot carries by default, which keeps a\n// jbrowse session small. A larger pasted or locally-opened file stays in the\n// live model and out of the snapshot, and `unshareableData` warns using the\n// same number. `MSAModelF({ maxInlineSnapshotBytes })` sets another; the demo\n// app's links hold far more.\nexport const maxInlineSnapshotBytes = 50_000\n\n// Height of the band the `rowPanels` headers draw in, above the strips in the\n// top area beside the tree ruler and the minimap. A panel wider than the band\n// is tall writes its header across, where it has more room.\nexport const rowPanelHeaderHeight = 56\n\n// Height of the branch-length scale bar above the tree.\nexport const treeScaleBarHeight = 22\n\n// Width of a `features` row panel that names none, wide enough for a gene\n// neighborhood of a few arrows to read.\nexport const defaultFeaturePanelWidth = 200\n\n// The alignment's overlay canvas draws the mouseover, the persisted highlights\n// and the row tints over the residues, and the legend key floats above that,\n// so a tint reaching the top right corner leaves the key readable.\nexport const msaOverlayZIndex = 1000\nexport const legendZIndex = msaOverlayZIndex + 1\n", "import { legendRows } from './components/msa/legendRows.ts'\nimport { treeScaleBarHeight } from './constants.ts'\n\nimport type { LegendRow } from './components/msa/legendRows.ts'\nimport type { MsaViewModel } from './model.ts'\nimport type { Theme } from '@mui/material'\n\nexport interface ExportSvgOptions {\n theme: Theme\n includeMinimap?: boolean\n includeTracks?: boolean\n exportType: 'entire' | 'viewport'\n}\n\n// legend geometry, shared by the width calculation and the renderer so the\n// reserved column on the right exactly fits the drawn legends\nexport const LEGEND_PAD = 8\nexport const LEGEND_ROW_H = 16\nexport const LEGEND_SWATCH = 12\nexport const LEGEND_FONT = 12\nexport const LEGEND_CHAR_W = 7\n\nexport const LEGEND_MAX_W = 360\nexport const LEGEND_TEXT_X = LEGEND_PAD + LEGEND_SWATCH + 6\n\nexport function getLegendWidth(rows: LegendRow[]) {\n const maxLen = rows.reduce((a, r) => Math.max(a, r.label.length), 0)\n const w = LEGEND_TEXT_X + LEGEND_PAD + maxLen * LEGEND_CHAR_W\n return Math.min(LEGEND_MAX_W, Math.max(120, w))\n}\n\nexport function legendHeight(rows: LegendRow[]) {\n return LEGEND_PAD * 2 + rows.length * LEGEND_ROW_H\n}\n\n// resolved sizes/offsets (in svg user units) for the chosen export, shared by\n// every layer; 'entire' renders the whole alignment unscrolled, 'viewport'\n// mirrors the live scroll position\nexport interface Layout {\n width: number\n msaAreaWidth: number\n height: number\n contentHeight: number\n trackHeight: number\n // the band the minimap, the row panel headers and the tree overview stacked\n // on the scale bar share across the top\n topHeight: number\n offsetX: number\n offsetY: number\n includeMinimap: boolean\n legendWidth: number\n}\n\nexport function getLayout(model: MsaViewModel, opts: ExportSvgOptions): Layout {\n const {\n scrollX,\n scrollY,\n totalWidth,\n totalHeight,\n effectiveTreeAreaWidth,\n rowPanelsWidth,\n rowPanelsHeaderHeight,\n totalTrackAreaHeight,\n minimapHeight,\n msaAreaHeight,\n msaCanvasWidth,\n showHorizontalScrollbar,\n treeOverviewHeight,\n treeScaleBar,\n } = model\n const trackHeight = opts.includeTracks ? totalTrackAreaHeight : 0\n // the minimap reflects the live viewport scroll position, so it's only\n // meaningful for a viewport export, never for the entire alignment -- and\n // only when the live view shows one at all, since a minimap over an alignment\n // that already fits marks a viewport wider than the bar\n const includeMinimap =\n opts.exportType === 'viewport' &&\n !!opts.includeMinimap &&\n showHorizontalScrollbar\n const rows = legendRows(model.legends)\n const legendWidth = rows.length > 0 ? getLegendWidth(rows) : 0\n const topHeight = Math.max(\n includeMinimap ? minimapHeight : 0,\n rowPanelsHeaderHeight,\n treeOverviewHeight + (treeScaleBar ? treeScaleBarHeight : 0),\n )\n const gutterWidth = effectiveTreeAreaWidth + rowPanelsWidth\n\n // width stays content-only; the legend occupies an extra column added at the\n // svg root in MsaSvg. The viewport export takes the alignment canvas's own\n // size rather than the widget's -- the widget box also covers the header, the\n // resize handle and the scrollbars, and rendering that box exports rows and\n // columns the scrollbars hide on screen\n return opts.exportType === 'entire'\n ? {\n width: totalWidth + gutterWidth,\n msaAreaWidth: totalWidth,\n height: totalHeight + trackHeight + topHeight,\n contentHeight: totalHeight,\n trackHeight,\n topHeight,\n offsetX: 0,\n offsetY: 0,\n includeMinimap,\n legendWidth,\n }\n : {\n width: msaCanvasWidth + gutterWidth,\n msaAreaWidth: msaCanvasWidth,\n height: msaAreaHeight + topHeight + trackHeight,\n contentHeight: msaAreaHeight,\n trackHeight,\n topHeight,\n offsetX: -scrollX,\n offsetY: -scrollY,\n includeMinimap,\n legendWidth,\n }\n}\n\n/**\n * the exported page's size: the layout plus the legend column, and as tall as\n * the legend where the key outgrows a short alignment\n */\nexport function exportPageSize(model: MsaViewModel, layout: Layout) {\n const { width, height, legendWidth, topHeight } = layout\n return {\n width: width + legendWidth,\n height:\n legendWidth > 0\n ? Math.max(height, topHeight + legendHeight(legendRows(model.legends)))\n : height,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAYM,SAAUA,EAAWC,EAAiB,CAC1C,IAAMC,EAASD,EAAQ,OAAS,EAChC,OAAOA,EAAQ,QAAQE,GAAU,CAC/B,GAAID,EAAS,CAAC,CAAE,IAAKC,EAAO,GAAI,MAAOA,EAAO,KAAK,CAAE,EAAI,CAAA,EACzD,GAAGA,EAAO,QAAQ,IAAIC,IAAU,CAC9B,IAAK,GAAGD,EAAO,EAAE,IAAIC,EAAM,EAAE,GAC7B,MAAOA,EAAM,MACb,MAAOA,EAAM,MACb,KAAMA,EAAM,IACZ,EACH,CACH,CCEO,IAAMC,EAAsB,IAAI,IAAI,CACzC,OACA,MACA,iBACA,kBACA,MACA,SACD,EAGYC,EAAgB,CAAC,UAAW,SAAS,EACrCC,EAAwB,GACxBC,EAAoB,GAKpBC,EAAiB,CAAC,OAAQ,aAAc,UAAU,EAElDC,EAAwC,OAKxCC,EAAqB,EACrBC,EAAoB,EAKpBC,EAAwB,EAE/B,SAAUC,EAAYC,EAAiB,CAC3C,OAAO,KAAK,IAAI,KAAK,IAAI,EAAGA,EAAY,CAAC,EAAG,EAAE,CAChD,CAKO,IAAMC,EAAmBF,EAAY,EAAgB,EAK/CG,EAAc,GACdC,EAAe,EACfC,EAAc,GAGdC,EAAiB,GACjBC,EAAyB,WACzBC,EAAyB,GAGzBC,EAAoB,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Y,KAAK,IACrBH,EAAiBP,EAAgB,EACjCF,EACAM,GAAsBC,EAAeM,EAAqB,EAAE,EAExDC,EAAchB,EAAyBC,EAO7C,OAAON,EAAK,aAAe,SACvB,CACE,MAAOG,EAAakB,EACpB,aAAclB,EACd,OAAQC,EAAcW,EAAcI,EACpC,cAAef,EACf,YAAAW,EACA,UAAAI,EACA,QAAS,EACT,QAAS,EACT,eAAAH,EACA,YAAAE,GAEF,CACE,MAAOP,EAAiBU,EACxB,aAAcV,EACd,OAAQD,EAAgBS,EAAYJ,EACpC,cAAeL,EACf,YAAAK,EACA,UAAAI,EACA,QAAS,CAAClB,EACV,QAAS,CAACC,EACV,eAAAc,EACA,YAAAE,EAER,CAMM,SAAUI,GAAevB,EAAqBwB,EAAc,CAChE,GAAM,CAAE,MAAAC,EAAO,OAAAC,EAAQ,YAAAP,EAAa,UAAAC,CAAS,EAAKI,EAClD,MAAO,CACL,MAAOC,EAAQN,EACf,OACEA,EAAc,EACV,KAAK,IAAIO,EAAQN,EAAYtB,EAAaoB,EAAWlB,EAAM,OAAO,CAAC,CAAC,EACpE0B,EAEV",
|
|
6
|
+
"names": ["legendRows", "legends", "titled", "legend", "entry", "segmentFeatureTypes", "segmentShades", "defaultDrawMsaLetters", "defaultScrollZoom", "scrollZoomAxes", "defaultScrollZoomAxis", "minLetterRowHeight", "minLetterColWidth", "minFeatureLabelHeight", "fontSizeFor", "rowHeight", "labelFitFontSize", "minColWidth", "minRowHeight", "maxCellSize", "defaultBgColor", "defaultColorSchemeName", "defaultShowColumnStats", "defaultDrawLabels", "defaultLabelsAlignRight", "minTreeWidth", "maxFitTreeWidth", "pxPerTreeDepth", "maxTreeAreaShare", "defaultShowBranchLen", "treeOrders", "defaultTreeOrder", "defaultDrawTree", "defaultDrawNodeBubbles", "defaultDrawNodeLabels", "defaultShowTreeOverview", "defaultOverviewHeight", "maxNeighborJoiningRows", "rowTintAlpha", "cladeHighlightColor", "cladeHighlightAlpha", "maxInlineSnapshotBytes", "rowPanelHeaderHeight", "treeScaleBarHeight", "defaultFeaturePanelWidth", "msaOverlayZIndex", "legendZIndex", "LEGEND_PAD", "LEGEND_ROW_H", "LEGEND_SWATCH", "LEGEND_FONT", "LEGEND_CHAR_W", "LEGEND_MAX_W", "LEGEND_TEXT_X", "getLegendWidth", "rows", "maxLen", "a", "r", "w", "legendHeight", "getLayout", "model", "opts", "scrollX", "scrollY", "totalWidth", "totalHeight", "effectiveTreeAreaWidth", "rowPanelsWidth", "rowPanelsHeaderHeight", "totalTrackAreaHeight", "minimapHeight", "msaAreaHeight", "msaCanvasWidth", "showHorizontalScrollbar", "treeOverviewHeight", "treeScaleBar", "trackHeight", "includeMinimap", "legendRows", "legendWidth", "topHeight", "treeScaleBarHeight", "gutterWidth", "exportPageSize", "layout", "width", "height"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],l=[{label:"Arrow keys",action:"Scroll one cell",keys:o},{label:"Shift + arrow keys",action:"Scroll one page",keys:o,shiftKey:!0},{label:"+ and -",action:"Zoom in and out",keys:["+","=","-"]},{label:"Home and End",action:"Jump to the first and last column",keys:["Home","End"]},{label:"Escape",action:"Clear the selection",keys:["Escape"]}],a={label:"Shift + drag",action:"Select a block of cells"},t=[{label:"Drag",action:"Pan the alignment"},{label:"Wheel",action:"Scroll, or zoom as set in Alignment settings \u2192 Mouse wheel"},{label:"Ctrl + wheel",action:"Zoom at the cursor"},a,{label:"Drag along a track",action:"Select a range of columns across every row"},{label:"Click a tree node",action:"Collapse, rotate, reroot or show only that clade"},{label:"Click the tree overview",action:"Show only the clade under the pointer"},{label:"Drag a divider",action:"Resize the tree area or a track"}],r=["Alignment",...[...l,a].map(e=>`${e.label}: ${e.action}`)].join(". ");export{l as a,t as b,r as c};
|
|
2
|
+
//# sourceMappingURL=chunk-TSHN6J7U.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/controls.ts"],
|
|
4
|
+
"sourcesContent": ["export interface Control {\n label: string\n action: string\n}\n\nexport interface KeyControl extends Control {\n keys: string[]\n shiftKey?: boolean\n}\n\nconst arrows = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']\n\nexport const keyboardControls: KeyControl[] = [\n { label: 'Arrow keys', action: 'Scroll one cell', keys: arrows },\n {\n label: 'Shift + arrow keys',\n action: 'Scroll one page',\n keys: arrows,\n shiftKey: true,\n },\n { label: '+ and -', action: 'Zoom in and out', keys: ['+', '=', '-'] },\n {\n label: 'Home and End',\n action: 'Jump to the first and last column',\n keys: ['Home', 'End'],\n },\n { label: 'Escape', action: 'Clear the selection', keys: ['Escape'] },\n]\n\nconst selectCells: Control = {\n label: 'Shift + drag',\n action: 'Select a block of cells',\n}\n\nexport const mouseControls: Control[] = [\n { label: 'Drag', action: 'Pan the alignment' },\n {\n label: 'Wheel',\n action: 'Scroll, or zoom as set in Alignment settings \u2192 Mouse wheel',\n },\n { label: 'Ctrl + wheel', action: 'Zoom at the cursor' },\n selectCells,\n {\n label: 'Drag along a track',\n action: 'Select a range of columns across every row',\n },\n {\n label: 'Click a tree node',\n action: 'Collapse, rotate, reroot or show only that clade',\n },\n {\n label: 'Click the tree overview',\n action: 'Show only the clade under the pointer',\n },\n { label: 'Drag a divider', action: 'Resize the tree area or a track' },\n]\n\nexport const alignmentAriaLabel = [\n 'Alignment',\n ...[...keyboardControls, selectCells].map(c => `${c.label}: ${c.action}`),\n].join('. ')\n"],
|
|
5
|
+
"mappings": "AAUA,IAAMA,EAAS,CAAC,YAAa,aAAc,UAAW,WAAW,EAEpDC,EAAiC,CAC5C,CAAE,MAAO,aAAc,OAAQ,kBAAmB,KAAMD,CAAM,EAC9D,CACE,MAAO,qBACP,OAAQ,kBACR,KAAMA,EACN,SAAU,IAEZ,CAAE,MAAO,UAAW,OAAQ,kBAAmB,KAAM,CAAC,IAAK,IAAK,GAAG,CAAC,EACpE,CACE,MAAO,eACP,OAAQ,oCACR,KAAM,CAAC,OAAQ,KAAK,GAEtB,CAAE,MAAO,SAAU,OAAQ,sBAAuB,KAAM,CAAC,QAAQ,CAAC,GAG9DE,EAAuB,CAC3B,MAAO,eACP,OAAQ,2BAGGC,EAA2B,CACtC,CAAE,MAAO,OAAQ,OAAQ,mBAAmB,EAC5C,CACE,MAAO,QACP,OAAQ,mEAEV,CAAE,MAAO,eAAgB,OAAQ,oBAAoB,EACrDD,EACA,CACE,MAAO,qBACP,OAAQ,8CAEV,CACE,MAAO,oBACP,OAAQ,oDAEV,CACE,MAAO,0BACP,OAAQ,yCAEV,CAAE,MAAO,iBAAkB,OAAQ,iCAAiC,GAGzDE,EAAqB,CAChC,YACA,GAAG,CAAC,GAAGH,EAAkBC,CAAW,EAAE,IAAIG,GAAK,GAAGA,EAAE,KAAK,KAAKA,EAAE,MAAM,EAAE,GACxE,KAAK,IAAI",
|
|
6
|
+
"names": ["arrows", "keyboardControls", "selectCells", "mouseControls", "alignmentAriaLabel", "c"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
2
|
-
`):String(r))))))}var n=s(w(),1),C=s(
|
|
3
|
-
${t?o:
|
|
1
|
+
import{a as d}from"./chunk-ERCMNTEQ.js";import{a as b}from"./chunk-NWHZOZMG.js";import{d as S}from"./chunk-DEFUNIWW.js";import{a as x}from"./chunk-FEUZKN5V.js";import{a as y}from"./chunk-JF6CW6MO.js";import{a as g}from"./chunk-BX4Z274Q.js";import{a as w}from"./chunk-J6KYLXRD.js";import{b as s}from"./chunk-FY3BTKY4.js";var l=s(w(),1),E=s(y(),1),a=s(g(),1),j=(0,E.makeStyles)()({key:{fontWeight:"bold",verticalAlign:"top"},value:{whiteSpace:"pre-wrap",wordBreak:"break-word"}});function k(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function B(e){return k(e)&&Object.keys(e).length===0}function A({record:e}){let{classes:o}=j();return l.default.createElement(a.Table,{size:"small"},l.default.createElement(a.TableBody,null,Object.entries(e).filter(([,t])=>t!=null&&!B(t)).map(([t,r])=>l.default.createElement(a.TableRow,{key:t},l.default.createElement(a.TableCell,{component:"th",className:o.key},t),l.default.createElement(a.TableCell,{className:o.value},k(r)?l.default.createElement(A,{record:r}):Array.isArray(r)?r.join(`
|
|
2
|
+
`):String(r))))))}var n=s(w(),1),C=s(y(),1),f=s(g(),1);var F=(0,C.makeStyles)()(e=>({textAreaFont:{fontFamily:"Courier New",wordWrap:"break-word"},dialogContent:{background:e.palette.action.selected,margin:4}})),N=100,$=2e5;function T([e,o],t){return`>${e}
|
|
3
|
+
${t?o:S(o)}`}function G(e){return!/[^.-]/.test(e)}function O(e,o){let t=[],r=0;for(let c of e){if(t.length>=N||r>=$)break;let i=T(c,o);t.push(i),r+=i.length+1}return{text:t.join(`
|
|
4
4
|
`),hidden:e.length-t.length}}function W({str:e}){let{classes:o}=F(),[t,r]=(0,n.useState)(!1),[c,i]=(0,n.useState)(!1),m=c?e:e.filter(([,p])=>t?!!p:!G(p)),{text:R,hidden:u}=O(m,t),h=()=>m.map(p=>T(p,t)).join(`
|
|
5
|
-
`);return n.default.createElement(n.default.Fragment,null,n.default.createElement(
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
`);return n.default.createElement(n.default.Fragment,null,n.default.createElement(x,{text:h}),n.default.createElement(f.Button,{onClick:()=>{b(new Blob([h()],{type:"text/plain"}),"sequences.fasta")}},"Download"),n.default.createElement(d,{label:"Show gaps",checked:t,onChange:()=>{r(!t)}}),n.default.createElement(d,{label:"Show empty",checked:c,onChange:()=>{i(!c)}}),n.default.createElement(f.TextField,{variant:"outlined",multiline:!0,className:o.dialogContent,minRows:5,maxRows:10,fullWidth:!0,value:R,helperText:u>0?`Showing ${m.length-u} of ${m.length.toLocaleString()} sequences. ${u.toLocaleString()} more are in the copy and the download.`:void 0,slotProps:{input:{readOnly:!0,className:o.textAreaFont}}}))}export{B as a,A as b,W as c};
|
|
6
|
+
//# sourceMappingURL=chunk-WAPIOD25.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/react-msaview@9.
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/MetadataTable.tsx", "../../node_modules/.pnpm/react-msaview@9.1.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/SequenceTextArea.tsx"],
|
|
4
4
|
"sourcesContent": ["import React from 'react'\n\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { Table, TableBody, TableCell, TableRow } from '@mui/material'\n\nconst useStyles = makeStyles()({\n key: {\n fontWeight: 'bold',\n verticalAlign: 'top',\n },\n value: {\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n },\n})\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nexport function isEmpty(value: unknown) {\n return isRecord(value) && Object.keys(value).length === 0\n}\n\nexport default function MetadataTable({\n record,\n}: {\n record: Record<string, unknown>\n}) {\n const { classes } = useStyles()\n return (\n <Table size=\"small\">\n <TableBody>\n {Object.entries(record)\n .filter(([, value]) => value != null && !isEmpty(value))\n .map(([key, value]) => (\n <TableRow key={key}>\n <TableCell component=\"th\" className={classes.key}>\n {key}\n </TableCell>\n <TableCell className={classes.value}>\n {isRecord(value) ? (\n <MetadataTable record={value} />\n ) : Array.isArray(value) ? (\n value.join('\\n')\n ) : (\n String(value)\n )}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )\n}\n", "import React, { useState } from 'react'\n\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { Button, TextField } from '@mui/material'\nimport { getUngappedSequence } from 'msa-parsers'\n\nimport { saveAs } from '../vendor/fileSaver.ts'\nimport Checkbox2 from './Checkbox2.tsx'\nimport CopyButton from './CopyButton.tsx'\n\nconst useStyles = makeStyles()(theme => ({\n textAreaFont: {\n fontFamily: 'Courier New',\n wordWrap: 'break-word',\n },\n dialogContent: {\n background: theme.palette.action.selected,\n margin: 4,\n },\n}))\n\nexport const maxShownRecords = 100\nexport const maxShownChars = 200_000\n\nfunction fastaRecord([name, seq]: [string, string], showGaps: boolean) {\n return `>${name}\\n${showGaps ? seq : getUngappedSequence(seq)}`\n}\n\nfunction isAllGaps(seq: string) {\n return !/[^.-]/.test(seq)\n}\n\n/**\n * The first records of `rows` as FASTA, up to `maxShownRecords` records or\n * `maxShownChars` characters, whichever comes first. A textarea holding every\n * row of a large alignment freezes the page.\n */\nexport function fastaPreview(rows: [string, string][], showGaps: boolean) {\n const shown: string[] = []\n let chars = 0\n for (const row of rows) {\n if (shown.length >= maxShownRecords || chars >= maxShownChars) {\n break\n }\n const record = fastaRecord(row, showGaps)\n shown.push(record)\n chars += record.length + 1\n }\n return { text: shown.join('\\n'), hidden: rows.length - shown.length }\n}\n\nexport default function SequenceTextArea({ str }: { str: [string, string][] }) {\n const { classes } = useStyles()\n const [showGaps, setShowGaps] = useState(false)\n const [showEmpty, setShowEmpty] = useState(false)\n\n const rows = showEmpty\n ? str\n : str.filter(([, seq]) => (showGaps ? !!seq : !isAllGaps(seq)))\n const { text, hidden } = fastaPreview(rows, showGaps)\n const fullText = () => rows.map(row => fastaRecord(row, showGaps)).join('\\n')\n return (\n <>\n <CopyButton text={fullText} />\n <Button\n onClick={() => {\n saveAs(\n new Blob([fullText()], { type: 'text/plain' }),\n 'sequences.fasta',\n )\n }}\n >\n Download\n </Button>\n <Checkbox2\n label=\"Show gaps\"\n checked={showGaps}\n onChange={() => {\n setShowGaps(!showGaps)\n }}\n />\n <Checkbox2\n label=\"Show empty\"\n checked={showEmpty}\n onChange={() => {\n setShowEmpty(!showEmpty)\n }}\n />\n <TextField\n variant=\"outlined\"\n multiline\n className={classes.dialogContent}\n minRows={5}\n maxRows={10}\n fullWidth\n value={text}\n helperText={\n hidden > 0\n ? `Showing ${rows.length - hidden} of ${rows.length.toLocaleString()} sequences. ${hidden.toLocaleString()} more are in the copy and the download.`\n : undefined\n }\n slotProps={{\n input: {\n readOnly: true,\n className: classes.textAreaFont,\n },\n }}\n />\n </>\n )\n}\n"],
|
|
5
5
|
"mappings": "gUAAA,IAAAA,EAAkB,SAElBC,EAA2B,SAC3BC,EAAsD,SAEhDC,KAAY,cAAU,EAAG,CAC7B,IAAK,CACH,WAAY,OACZ,cAAe,OAEjB,MAAO,CACL,WAAY,WACZ,UAAW,cAEd,EAED,SAASC,EAASC,EAAc,CAC9B,OAAO,OAAOA,GAAU,UAAYA,IAAU,MAAQ,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEM,SAAUC,EAAQD,EAAc,CACpC,OAAOD,EAASC,CAAK,GAAK,OAAO,KAAKA,CAAK,EAAE,SAAW,CAC1D,CAEc,SAAPE,EAA+B,CACpC,OAAAC,CAAM,EAGP,CACC,GAAM,CAAE,QAAAC,CAAO,EAAKN,EAAS,EAC7B,OACE,EAAAO,QAAA,cAAC,QAAK,CAAC,KAAK,OAAO,EACjB,EAAAA,QAAA,cAAC,YAAS,KACP,OAAO,QAAQF,CAAM,EACnB,OAAO,CAAC,CAAC,CAAEH,CAAK,IAAMA,GAAS,MAAQ,CAACC,EAAQD,CAAK,CAAC,EACtD,IAAI,CAAC,CAACM,EAAKN,CAAK,IACf,EAAAK,QAAA,cAAC,WAAQ,CAAC,IAAKC,CAAG,EAChB,EAAAD,QAAA,cAAC,YAAS,CAAC,UAAU,KAAK,UAAWD,EAAQ,GAAG,EAC7CE,CAAG,EAEN,EAAAD,QAAA,cAAC,YAAS,CAAC,UAAWD,EAAQ,KAAK,EAChCL,EAASC,CAAK,EACb,EAAAK,QAAA,cAACH,EAAa,CAA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Kb,EAAaC,EAAMJ,CAAQ,EAC9CiB,EAAW,IAAMb,EAAK,IAAIG,GAAOV,EAAYU,EAAKP,CAAQ,CAAC,EAAE,KAAK;CAAI,EAC5E,OACE,EAAAkB,QAAA,cAAA,EAAAA,QAAA,SAAA,KACE,EAAAA,QAAA,cAACC,EAAU,CAAC,KAAMF,CAAQ,CAAA,EAC1B,EAAAC,QAAA,cAAC,SAAM,CACL,QAAS,IAAK,CACZE,EACE,IAAI,KAAK,CAACH,EAAQ,CAAE,EAAG,CAAE,KAAM,YAAY,CAAE,EAC7C,iBAAiB,CAErB,CAAC,EAAA,UAAA,EAIH,EAAAC,QAAA,cAACG,EAAS,CACR,MAAM,YACN,QAASrB,EACT,SAAU,IAAK,CACbY,EAAY,CAACZ,CAAQ,CACvB,CAAC,CAAA,EAEH,EAAAkB,QAAA,cAACG,EAAS,CACR,MAAM,aACN,QAASR,EACT,SAAU,IAAK,CACbC,EAAa,CAACD,CAAS,CACzB,CAAC,CAAA,EAEH,EAAAK,QAAA,cAAC,YAAS,CACR,QAAQ,WACR,UAAS,GACT,UAAWP,EAAQ,cACnB,QAAS,EACT,QAAS,GACT,UAAS,GACT,MAAOI,EACP,WACEC,EAAS,EACL,WAAWZ,EAAK,OAASY,CAAM,OAAOZ,EAAK,OAAO,eAAc,CAAE,eAAeY,EAAO,eAAc,CAAE,0CACxG,OAEN,UAAW,CACT,MAAO,CACL,SAAU,GACV,UAAWL,EAAQ,cAEtB,CAAA,CACD,CAGR",
|
|
6
6
|
"names": ["import_react", "import_tss_react", "import_material", "useStyles", "isRecord", "value", "isEmpty", "MetadataTable", "record", "classes", "React", "key", "import_react", "import_tss_react", "import_material", "useStyles", "theme", "maxShownRecords", "maxShownChars", "fastaRecord", "name", "seq", "showGaps", "getUngappedSequence", "isAllGaps", "fastaPreview", "rows", "shown", "chars", "row", "record", "SequenceTextArea", "str", "classes", "setShowGaps", "showEmpty", "setShowEmpty", "text", "hidden", "fullText", "React", "CopyButton", "saveAs", "Checkbox2"]
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as m,p as l,q as h,u as p}from"./chunk-A63PUWQZ.js";var g="ncbiblast";function f(e){return(e.hits??[]).map(t=>{let n=Number.parseInt(t.hit_uni_ox??"",10);return{accession:t.hit_acc??"unknown",id:t.hit_id??t.hit_acc??"unknown",sciname:t.hit_uni_os??t.hit_os??"unknown",taxid:Number.isNaN(n)?void 0:n,title:t.hit_uni_de??t.hit_desc,sequence:(t.hit_hsps?.[0]?.hsp_hseq??"").replaceAll("-","")}})}function E(e){return`https://www.ebi.ac.uk/jdispatcher/sss/${g}/summary?jobId=${e}`}async function w({query:e,blastDatabase:t,maxHits:n,onProgress:r,onRid:s,signal:i}){let a=String(h(n??l)),o=await m({tool:g,label:"BLAST",params:{program:"blastp",stype:"protein",database:t,sequence:e,alignments:a,scores:a},onProgress:r,onRid:s,signal:i});return{rid:o.jobId,hits:f(JSON.parse(await o.result("json")))}}var R=({database:e,...t})=>w({blastDatabase:e,...t});var u="hmmer3_phmmer";function O(e){return`https://www.ebi.ac.uk/jdispatcher/sss/${u}/summary?jobId=${e}`}function H(e){return e.startsWith(`${u}-`)}function x({rf:e,query:t}){let n=0,r=Array.from(e,s=>s==="x"?t[n++]??"-":"-").join("");if(n!==t.length)throw new Error(`phmmer alignment has ${n} match columns for a query of ${t.length} residues, so the query row cannot be placed`);return r}function _(e){let t=(e??"").replace("[subseq from] ","");if(t.includes("^|^")){let s=t.split("^|^"),i=s[6];return{id:s[0]||void 0,sciname:s[5]||"unknown",taxid:i&&/^\d+$/.test(i)?Number.parseInt(i,10):void 0,title:s[2]||void 0}}let n=/OS=(.*?)\s+(?:OX|GN|PE|SV)=/.exec(t)?.[1],r=/OX=(\d+)/.exec(t)?.[1];return{id:void 0,sciname:n??"unknown",taxid:r?Number.parseInt(r,10):void 0,title:t.split(" OS=")[0]||void 0}}function S(e){let t=e.lastIndexOf("/"),n=t===-1?void 0:/^\d+-\d+$/.exec(e.slice(t+1))?.[0],r=n===void 0?e:e.slice(0,t),s=r.split("|");return s.length===3?{accession:s[1],id:s[2],range:n}:{accession:r,id:r,range:n}}function y({stockholm:e,query:t}){let{gc:n,gs:r,seqdata:s,seqname:i}=new p(e,0).getMSA(),a=n.RF;if(!a)throw new Error("phmmer alignment has no #=GC RF line");return{queryRow:x({rf:a,query:t}),rows:i.map(o=>{let{id:d,...b}=_(r.DE?.[o]?.[0]),c=S(o);return{...c,id:c.id===c.accession&&d?d:c.id,...b,aligned:(s[o]??"").replaceAll(".","-").toUpperCase()}})}}async function B({query:e,database:t,maxHits:n,onProgress:r,onRid:s,signal:i}){let a=await m({tool:u,label:"phmmer",params:{database:t,sequence:e,alignView:"true",...n?{nhits:String(n)}:{}},onProgress:r,onRid:s,signal:i});return{rid:a.jobId,...y({stockholm:await a.result("sto"),query:e})}}function q(e){return e.map(({aligned:t,...n})=>({...n,sequence:t}))}var I=async({database:e,...t})=>{let{rows:n,queryRow:r,rid:s}=await B({database:e,...t});return{rid:s,queryRow:r,hits:q(n)}};export{E as a,R as b,O as c,H as d,I as e};
|
|
2
|
+
//# sourceMappingURL=chunk-XVNCZQMR.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/ebiBlast.ts", "../../src/utils/phmmer.ts"],
|
|
4
4
|
"sourcesContent": ["import {\n defaultMaxHits,\n snapBlastHitCount,\n} from '../LaunchMsaView/components/BlastQuery/consts'\nimport { runEbiJob } from './ebiJobDispatcher'\n\nimport type { BlastDatabase } from '../LaunchMsaView/components/BlastQuery/consts'\nimport type { SearchBackend, SearchHit } from './homologSearch'\n\nconst TOOL = 'ncbiblast'\n\n/**\n * The subset of EBI's ncbiblast JSON result this plugin reads. The service\n * returns a great deal more per hit (urls, bit scores, e-values, the match\n * string); only what the MSA rows are built from is typed here.\n */\ninterface EbiBlastJson {\n hits?: {\n hit_acc?: string\n hit_id?: string\n hit_desc?: string\n /** the UniProt fields are absent on hits from non-UniProt databases */\n hit_os?: string\n hit_uni_de?: string\n hit_uni_os?: string\n /** NCBI taxon id, delivered as a string */\n hit_uni_ox?: string\n hit_hsps?: { hsp_hseq?: string }[]\n }[]\n}\n\n/**\n * EBI's hits as search hits. BLAST's alignments are pairwise, one hit at a\n * time, so the gaps come back off and an aligner gets bare sequences. Exported\n * for testing against a captured response: nothing else in CI would notice if\n * EBI renamed a field.\n */\nexport function normalizeEbiBlastHits(result: EbiBlastJson): SearchHit[] {\n return (result.hits ?? []).map(hit => {\n const taxid = Number.parseInt(hit.hit_uni_ox ?? '', 10)\n return {\n accession: hit.hit_acc ?? 'unknown',\n id: hit.hit_id ?? hit.hit_acc ?? 'unknown',\n sciname: hit.hit_uni_os ?? hit.hit_os ?? 'unknown',\n taxid: Number.isNaN(taxid) ? undefined : taxid,\n // hit_uni_de is the bare protein name; hit_desc repeats it with the\n // OS=/OX=/GN= suffix that makeId already covers with real columns\n title: hit.hit_uni_de ?? hit.hit_desc,\n sequence: (hit.hit_hsps?.[0]?.hsp_hseq ?? '').replaceAll('-', ''),\n }\n })\n}\n\n/**\n * Human-facing link to a job, shown while it runs and on error \u2014 so it has to\n * be EBI's own results UI, not the REST result endpoint, which does not exist\n * yet at the moment the link is on screen.\n */\nexport function ebiBlastResultUrl(jobId: string) {\n return `https://www.ebi.ac.uk/jdispatcher/sss/${TOOL}/summary?jobId=${jobId}`\n}\n\nexport async function queryEbiBlast({\n query,\n blastDatabase,\n maxHits,\n onProgress,\n onRid,\n signal,\n}: {\n query: string\n blastDatabase: BlastDatabase\n /** rounded up to a count EBI accepts */\n maxHits?: number\n onProgress: (arg: string) => void\n onRid: (arg: string) => void\n signal?: AbortSignal\n}) {\n const hitCount = String(snapBlastHitCount(maxHits ?? defaultMaxHits))\n const job = await runEbiJob({\n tool: TOOL,\n label: 'BLAST',\n params: {\n program: 'blastp',\n stype: 'protein',\n database: blastDatabase,\n sequence: query,\n alignments: hitCount,\n scores: hitCount,\n },\n onProgress,\n onRid,\n signal,\n })\n return {\n rid: job.jobId,\n hits: normalizeEbiBlastHits(\n JSON.parse(await job.result('json')) as EbiBlastJson,\n ),\n }\n}\n\nexport const searchEbiBlast: SearchBackend = ({ database, ...request }) =>\n queryEbiBlast({ blastDatabase: database as BlastDatabase, ...request })\n", "import { StockholmMSA } from 'msa-parsers'\n\nimport { runEbiJob } from './ebiJobDispatcher'\n\nimport type { PhmmerDatabase } from '../LaunchMsaView/components/BlastQuery/consts'\nimport type { SearchBackend, SearchHit } from './homologSearch'\n\nconst TOOL = 'hmmer3_phmmer'\n\nexport interface PhmmerRow {\n accession: string\n id: string\n sciname: string\n taxid?: number\n title?: string\n /** the matched envelope on the target, e.g. '503-912', absent if unparseable */\n range?: string\n /** the row as phmmer aligned it, uppercased with '.' inserts turned into '-' */\n aligned: string\n}\n\nexport interface PhmmerAlignment {\n rows: PhmmerRow[]\n /**\n * the query, placed into the same columns. phmmer does not put the query in\n * its own output, so this is derived \u2014 see buildQueryRow.\n */\n queryRow: string\n}\n\n/**\n * Human-facing link to a job, shown while it runs and on error.\n *\n * The category has to be sss: jdispatcher serves its shell with a 200 for any\n * category, so /pfa/ and /psa/ look fine to a fetch and render \"Page Not Found\"\n * in a browser.\n */\nexport function phmmerResultUrl(jobId: string) {\n return `https://www.ebi.ac.uk/jdispatcher/sss/${TOOL}/summary?jobId=${jobId}`\n}\n\n/** EBI job ids are prefixed with the tool that made them */\nexport function isPhmmerJobId(jobId: string) {\n return jobId.startsWith(`${TOOL}-`)\n}\n\n/**\n * phmmer aligns every hit to a profile built from the query, one match state\n * per query residue, and marks those columns 'x' in #=GC RF. So the query's own\n * row is exactly recoverable: walk RF, consume a query residue at each match\n * column, gap everywhere else.\n *\n * This is the one piece of real logic here rather than a library call, and it\n * is checked hard: if the match columns do not account for the query exactly,\n * the columns and the query have drifted apart, and a query row that is off by\n * even one residue would silently mis-map every column to the genome. Throwing\n * is much better than drawing that.\n */\nfunction buildQueryRow({ rf, query }: { rf: string; query: string }) {\n let consumed = 0\n const row = Array.from(rf, c =>\n c === 'x' ? (query[consumed++] ?? '-') : '-',\n ).join('')\n if (consumed !== query.length) {\n throw new Error(\n `phmmer alignment has ${consumed} match columns for a query of ${query.length} residues, so the query row cannot be placed`,\n )\n }\n return row\n}\n\n/**\n * '[subseq from] Albumin OS=Homo sapiens OX=9606 GN=ALB PE=1 SV=2' is what a\n * UniProt target's #=GS DE looks like. The representative-proteome databases\n * (rp15..rp75) write the same facts as caret-pipe fields instead --\n * 'P53_HUMAN^|^DNHU53^|^Cellular tumor antigen p53^|^...^|^Homo sapiens^|^9606^|^Euk/mammal^|^40674'\n * -- so both grammars are read. Hits from the non-UniProt databases phmmer\n * also offers (PDB, AlphaFold, MEROPS...) carry neither, so every field here\n * is optional.\n */\nfunction parseDescription(de: string | undefined) {\n const text = (de ?? '').replace('[subseq from] ', '')\n if (text.includes('^|^')) {\n const fields = text.split('^|^')\n const ox = fields[6]\n return {\n id: fields[0] || undefined,\n sciname: fields[5] || 'unknown',\n taxid: ox && /^\\d+$/.test(ox) ? Number.parseInt(ox, 10) : undefined,\n title: fields[2] || undefined,\n }\n }\n const sciname = /OS=(.*?)\\s+(?:OX|GN|PE|SV)=/.exec(text)?.[1]\n const ox = /OX=(\\d+)/.exec(text)?.[1]\n return {\n id: undefined,\n sciname: sciname ?? 'unknown',\n taxid: ox ? Number.parseInt(ox, 10) : undefined,\n title: text.split(' OS=')[0] || undefined,\n }\n}\n\n/**\n * Target names look like 'sp|P02768|ALBU_HUMAN/1-609' for UniProt databases and\n * like anything at all for the others, so an unrecognized name becomes its own\n * accession rather than being dropped.\n */\nfunction parseName(name: string) {\n const slash = name.lastIndexOf('/')\n const range =\n slash === -1 ? undefined : /^\\d+-\\d+$/.exec(name.slice(slash + 1))?.[0]\n const bare = range === undefined ? name : name.slice(0, slash)\n const parts = bare.split('|')\n return parts.length === 3\n ? { accession: parts[1]!, id: parts[2]!, range }\n : { accession: bare, id: bare, range }\n}\n\n/**\n * Exported for testing against a captured .sto \u2014 the annotation names (RF, the\n * DE line's OS=/OX=) are the whole risk in this mapping, and nothing else in CI\n * would notice if HMMER or EBI changed one.\n */\nexport function parsePhmmerAlignment({\n stockholm,\n query,\n}: {\n stockholm: string\n query: string\n}): PhmmerAlignment {\n const { gc, gs, seqdata, seqname } = new StockholmMSA(stockholm, 0).getMSA()\n const rf = gc.RF\n if (!rf) {\n throw new Error('phmmer alignment has no #=GC RF line')\n }\n\n return {\n queryRow: buildQueryRow({ rf, query }),\n rows: seqname.map(name => {\n const { id, ...description } = parseDescription(gs.DE?.[name]?.[0])\n const parsed = parseName(name)\n return {\n ...parsed,\n // the rp databases name a row by bare accession and put the mnemonic\n // id in the description instead\n id: parsed.id === parsed.accession && id ? id : parsed.id,\n ...description,\n // insert columns come back lowercase with '.' for gaps; the MSA renderer\n // looks colors up by the literal letter, so lowercase would draw\n // uncolored. The insert columns stay visible as gaps in the query row.\n aligned: (seqdata[name] ?? '').replaceAll('.', '-').toUpperCase(),\n }\n }),\n }\n}\n\nexport async function queryPhmmer({\n query,\n database,\n maxHits,\n onProgress,\n onRid,\n signal,\n}: {\n query: string\n database: PhmmerDatabase\n /** EBI's `nhits`, 100 when omitted */\n maxHits?: number\n onProgress: (arg: string) => void\n onRid: (arg: string) => void\n signal?: AbortSignal\n}) {\n const job = await runEbiJob({\n tool: TOOL,\n label: 'phmmer',\n params: {\n database,\n sequence: query,\n // the alignment is the whole point of using phmmer here\n alignView: 'true',\n ...(maxHits ? { nhits: String(maxHits) } : {}),\n },\n onProgress,\n onRid,\n signal,\n })\n return {\n rid: job.jobId,\n ...parsePhmmerAlignment({ stockholm: await job.result('sto'), query }),\n }\n}\n\n/** phmmer's rows as search hits: the aligned row is the hit's sequence. */\nexport function toSearchHits(rows: PhmmerRow[]): SearchHit[] {\n return rows.map(({ aligned, ...rest }) => ({ ...rest, sequence: aligned }))\n}\n\n/**\n * phmmer as a search backend. It aligns every hit to a profile of the query as\n * it searches, so the result carries `queryRow` and no aligner runs after it.\n */\nexport const searchEbiPhmmer: SearchBackend = async ({\n database,\n ...request\n}) => {\n const { rows, queryRow, rid } = await queryPhmmer({\n database: database as PhmmerDatabase,\n ...request,\n })\n return { rid, queryRow, hits: toSearchHits(rows) }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "6DASA,IAAMA,EAAO,YA4BN,SAASC,EAAsBC,EAAmC,CACvE,OAAQA,EAAO,MAAQ,CAAC,GAAG,IAAIC,GAAO,CACpC,IAAMC,EAAQ,OAAO,SAASD,EAAI,YAAc,GAAI,EAAE,EACtD,MAAO,CACL,UAAWA,EAAI,SAAW,UAC1B,GAAIA,EAAI,QAAUA,EAAI,SAAW,UACjC,QAASA,EAAI,YAAcA,EAAI,QAAU,UACzC,MAAO,OAAO,MAAMC,CAAK,EAAI,OAAYA,EAGzC,MAAOD,EAAI,YAAcA,EAAI,SAC7B,UAAWA,EAAI,WAAW,CAAC,GAAG,UAAY,IAAI,WAAW,IAAK,EAAE,CAClE,CACF,CAAC,CACH,CAOO,SAASE,EAAkBC,EAAe,CAC/C,MAAO,yCAAyCN,CAAI,kBAAkBM,CAAK,EAC7E,CAEA,eAAsBC,EAAc,CAClC,MAAAC,EACA,cAAAC,EACA,QAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACF,EAQG,CACD,IAAMC,EAAW,OAAOC,EAAkBL,GAAWM,CAAc,CAAC,EAC9DC,EAAM,MAAMC,EAAU,CAC1B,KAAMlB,EACN,MAAO,QACP,OAAQ,CACN,QAAS,SACT,MAAO,UACP,SAAUS,EACV,SAAUD,EACV,WAAYM,EACZ,OAAQA,CACV,EACA,WAAAH,EACA,MAAAC,EACA,OAAAC,CACF,CAAC,EACD,MAAO,CACL,IAAKI,EAAI,MACT,KAAMhB,EACJ,KAAK,MAAM,MAAMgB,EAAI,OAAO,MAAM,CAAC,CACrC,CACF,CACF,CAEO,IAAME,EAAgC,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAQ,IAC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,MAAO,OAAOA,CAAO,CAAE,EAAI,CAAC,CAC9C,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACF,CAAC,EACD,MAAO,CACL,IAAKC,EAAI,MACT,GAAGhB,EAAqB,CAAE,UAAW,MAAMgB,EAAI,OAAO,KAAK,EAAG,MAAAhC,CAAM,CAAC,CACvE,CACF,CAGO,SAASkC,EAAaC,EAAgC,CAC3D,OAAOA,EAAK,IAAI,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAK,KAAO,CAAE,GAAGA,EAAM,SAAUD,CAAQ,EAAE,CAC5E,CAMO,IAAME,EAAiC,MAAO,CACnD,SAAAX,EACA,GAAGY,CACL,IAAM,CACJ,GAAM,CAAE,KAAAJ,EAAM,SAAAK,EAAU,IAAAC,CAAI,EAAI,MAAMf,EAAY,CAChD,SAAUC,EACV,GAAGY,CACL,CAAC,EACD,MAAO,CAAE,IAAAE,EAAK,SAAAD,EAAU,KAAMN,EAAaC,CAAI,CAAE,CACnD",
|
|
6
6
|
"names": ["TOOL", "normalizeEbiBlastHits", "result", "hit", "taxid", "ebiBlastResultUrl", "jobId", "queryEbiBlast", "query", "blastDatabase", "maxHits", "onProgress", "onRid", "signal", "hitCount", "snapBlastHitCount", "defaultMaxHits", "job", "runEbiJob", "searchEbiBlast", "database", "request", "TOOL", "phmmerResultUrl", "jobId", "isPhmmerJobId", "buildQueryRow", "rf", "query", "consumed", "row", "c", "parseDescription", "de", "text", "fields", "ox", "sciname", "parseName", "name", "slash", "range", "bare", "parts", "parsePhmmerAlignment", "stockholm", "gc", "gs", "seqdata", "seqname", "StockholmMSA", "id", "description", "parsed", "queryPhmmer", "database", "maxHits", "onProgress", "onRid", "signal", "job", "runEbiJob", "toSearchHits", "rows", "aligned", "rest", "searchEbiPhmmer", "request", "queryRow", "rid"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-FY3BTKY4.js";function
|
|
2
|
-
//# sourceMappingURL=dist-
|
|
1
|
+
import"./chunk-FY3BTKY4.js";function S(_){let t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[_]||t.start}function b(_){let t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[_]||t.alphabetic}var v={"font-style":"normal","font-weight":"normal","dominant-baseline":"alphabetic"};function c(_,t){return t===v[_]?void 0:t}var h={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},font:{canvas:"10px sans-serif"},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:null,svg:null,apply:"stroke"}},T=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/i,u=class{width;height;canvas;__document;__ctx;__canvas;__root;__currentElement;__styleStack;__groupStack;__currentDefaultPath;__currentPosition;__transformMatrix;__transformMatrixStack;__fontCache=new Map;strokeStyle;fillStyle;lineWidth;font;textAlign;textBaseline;lineDash;constructor(t,e,s={}){this.width=t,this.height=e,this.canvas=this,this.__document=s.document||document,s.ctx?this.__ctx=s.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__root.setAttribute("version","1.1"),this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__root.setAttribute("width",String(t)),this.__root.setAttribute("height",String(e)),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__root.appendChild(this.__currentElement),this.__currentDefaultPath="",this.__currentPosition={},this.__transformMatrix=new DOMMatrix,this.resetTransform()}__createElement(t,e={},s){let r=this.__document.createElementNS("http://www.w3.org/2000/svg",t);s&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let i of Object.keys(e)){let n=e[i];n!=null&&r.setAttribute(i,n)}return r}__setDefaultStyles(){for(let t of Object.keys(h))this[t]=h[t].canvas}__applyStyleState(t){for(let e of Object.keys(t))this[e]=t[e]}__getStyleState(){let t={};for(let e of Object.keys(h))t[e]=this[e];return t}__applyTransformation(t,e){let{a:s,b:r,c:i,d:n,e:a,f:o}=e||this.getTransform();if(s===1&&r===0&&i===0&&n===1&&t.hasAttribute("x")&&t.hasAttribute("y")){a!==0&&t.setAttribute("x",String(Number(t.getAttribute("x"))+a)),o!==0&&t.setAttribute("y",String(Number(t.getAttribute("y"))+o));return}t.setAttribute("transform",`matrix(${s} ${r} ${i} ${n} ${a} ${o})`)}__applyStyleToCurrentElement(t){let e=this.__currentElement;for(let s of Object.keys(h)){let r=h[s],i=this[s];if(!r.apply?.includes(t)||r.svg===i)continue;let n=(r.svgAttr==="stroke"||r.svgAttr==="fill")&&typeof i=="string"&&i.includes("rgba")?T.exec(i):null;if(n)e.setAttribute(r.svgAttr,`rgb(${n[1]},${n[2]},${n[3]})`),e.setAttribute(`${r.svgAttr}-opacity`,n[4]);else if(s==="lineWidth"){let a=this.__getTransformScale();e.setAttribute(r.svgAttr,String(i*Math.max(a.x,a.y)))}else e.setAttribute(r.svgAttr,i)}t==="fill"&&e.getAttribute("stroke")==="none"&&e.removeAttribute("stroke")}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSvg(){return this.__root}save(){let t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState()),this.__transformMatrixStack||(this.__transformMatrixStack=[]),this.__transformMatrixStack.push(this.getTransform())}restore(){this.__currentElement=this.__groupStack.pop(),this.__currentElement||(this.__currentElement=this.__root.childNodes[0]),this.__applyStyleState(this.__styleStack.pop()),this.__transformMatrixStack&&this.__transformMatrixStack.length>0&&this.setTransform(this.__transformMatrixStack.pop())}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};let t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e};let s=this.__matrixTransform(t,e);this.__addPathCommand(`M ${s.x} ${s.y}`)}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e};let s=this.__matrixTransform(t,e);this.__addPathCommand(this.__currentDefaultPath.includes("M")?`L ${s.x} ${s.y}`:`M ${s.x} ${s.y}`)}quadraticCurveTo(t,e,s,r){this.__currentPosition={x:s,y:r};let i=this.__matrixTransform(t,e),n=this.__matrixTransform(s,r);this.__addPathCommand(`Q ${i.x} ${i.y} ${n.x} ${n.y}`)}__applyPaintOrder(t,e){let s=this.__currentElement;s.nodeName==="path"&&s.hasAttribute(e)&&s.getAttribute(e)!=="none"&&s.setAttribute("paint-order",t)}stroke(){this.__applyPaintOrder("fill stroke markers","fill"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__applyPaintOrder("stroke fill markers","stroke"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}fillRect(t,e,s,r){let i=this.__createElement("rect",{x:t,y:e,width:s,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyTransformation(i),this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,r){let i=this.__createElement("rect",{x:t,y:e,width:s,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyTransformation(i),this.__applyStyleToCurrentElement("stroke")}__parsedFont(){let t=this.__fontCache.get(this.font);if(t)return t;let e=document.createElement("span");return e.setAttribute("style",`font:${this.font}`),this.__fontCache.set(this.font,e.style),e.style}fillText(t,e,s){let r=this.__parsedFont(),i=this.__closestGroupOrSvg(),n=this.__createElement("text",{"font-family":r.fontFamily,"font-size":r.fontSize,"font-style":c("font-style",r.fontStyle),"font-weight":c("font-weight",r.fontWeight),x:e,y:s,"text-anchor":S(this.textAlign),"dominant-baseline":c("dominant-baseline",b(this.textBaseline))},!0);n.appendChild(this.__document.createTextNode(t)),this.__currentElement=n,this.__applyTransformation(n),this.__applyStyleToCurrentElement("fill"),i.appendChild(n)}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,r,i,n){if(r===i)return;r=r%(2*Math.PI),i=i%(2*Math.PI),r===i&&(i=(i+2*Math.PI-.001*(n?-1:1))%(2*Math.PI));let a=t+s*Math.cos(i),o=e+s*Math.sin(i),m=t+s*Math.cos(r),p=e+s*Math.sin(r),d=n?0:1,l=i-r;l<0&&(l+=2*Math.PI);let g=n?l>Math.PI?0:1:l>Math.PI?1:0,{x:y,y:x}=this.__getTransformScale(),f=this.__matrixTransform(a,o);this.lineTo(m,p),this.__addPathCommand(`A ${s*y} ${s*x} 0 ${g} ${d} ${f.x} ${f.y}`),this.__currentPosition={x:a,y:o}}setLineDash(t){this.lineDash=t.length>0?t.join(","):null}setTransform(t,e,s,r,i,n){this.__transformMatrix=t instanceof DOMMatrix?new DOMMatrix([t.a,t.b,t.c,t.d,t.e,t.f]):new DOMMatrix([t,e,s,r,i,n])}getTransform(){let{a:t,b:e,c:s,d:r,e:i,f:n}=this.__transformMatrix;return new DOMMatrix([t,e,s,r,i,n])}resetTransform(){this.setTransform(1,0,0,1,0,0)}scale(t,e){e===void 0&&(e=t),!(isNaN(t)||isNaN(e)||!isFinite(t)||!isFinite(e))&&this.setTransform(this.getTransform().scale(t,e))}translate(t,e){this.setTransform(this.getTransform().translate(t,e))}__matrixTransform(t,e){return new DOMPoint(t,e).matrixTransform(this.__transformMatrix)}__getTransformScale(){return{x:Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),y:Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d)}}};export{u as Context};
|
|
2
|
+
//# sourceMappingURL=dist-GXYZN4ZR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/@jbrowse+svgcanvas@9.
|
|
4
|
-
"sourcesContent": ["/**\n * SVGCanvas v2.0.3\n * Draw on SVG using Canvas's 2D Context API.\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Original Authors: Kerry Liu, Zeno Zeng\n * Copyright (c) 2014 Gliffy Inc.\n * Copyright (c) 2021 Zeno Zeng\n *\n * Vendored, converted to ESM/TypeScript, and cut down to the calls the\n * renderers make: rectangles, paths, arcs and glyphs.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nfunction getTextAnchor(textAlign: string): string {\n const mapping: Record<string, string> = {\n left: 'start',\n right: 'end',\n center: 'middle',\n start: 'start',\n end: 'end',\n }\n return mapping[textAlign] || mapping.start!\n}\n\nfunction getDominantBaseline(textBaseline: string): string {\n const mapping: Record<string, string> = {\n alphabetic: 'alphabetic',\n hanging: 'hanging',\n top: 'text-before-edge',\n bottom: 'text-after-edge',\n middle: 'central',\n }\n return mapping[textBaseline] || mapping.alphabetic!\n}\n\n/**\n * SVG's initial values for text presentation attributes. Omitting them from\n * every glyph takes ~22% off a sequence-logo figure.\n */\nconst TEXT_ATTR_DEFAULTS: Record<string, string> = {\n 'font-style': 'normal',\n 'font-weight': 'normal',\n // the initial value is `auto`, which resolves to the alphabetic baseline\n 'dominant-baseline': 'alphabetic',\n}\n\nfunction omitDefault(attr: string, value: string | undefined) {\n return value === TEXT_ATTR_DEFAULTS[attr] ? undefined : value\n}\n\nconst STYLES: Record<string, any> = {\n strokeStyle: {\n svgAttr: 'stroke',\n canvas: '#000000',\n svg: 'none',\n apply: 'stroke',\n },\n fillStyle: {\n svgAttr: 'fill',\n canvas: '#000000',\n svg: null,\n apply: 'fill',\n },\n lineWidth: {\n svgAttr: 'stroke-width',\n canvas: 1,\n svg: 1,\n apply: 'stroke',\n },\n font: {\n canvas: '10px sans-serif',\n },\n textAlign: {\n canvas: 'start',\n },\n textBaseline: {\n canvas: 'alphabetic',\n },\n // null on both sides so the canvas and svg defaults compare equal and strokes\n // carry no empty stroke-dasharray\n lineDash: {\n svgAttr: 'stroke-dasharray',\n canvas: null,\n svg: null,\n apply: 'stroke',\n },\n}\n\nconst rgbaRegex =\n /rgba\\(\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/i\n\ninterface ContextOptions {\n document?: Document\n ctx?: CanvasRenderingContext2D\n}\n\nexport class Context {\n width: number\n height: number\n canvas: Context\n\n __document: Document\n __ctx: CanvasRenderingContext2D\n __canvas?: HTMLCanvasElement\n __root: SVGSVGElement\n __currentElement: SVGElement\n __styleStack: any[]\n __groupStack: SVGElement[]\n __currentDefaultPath: string\n __currentPosition: { x?: number; y?: number }\n __transformMatrix: DOMMatrix\n __transformMatrixStack?: DOMMatrix[]\n // parsed fonts keyed by `font` string; each parse costs a DOM element and a\n // CSS parse, and exports ask per glyph\n __fontCache = new Map<string, CSSStyleDeclaration>()\n\n strokeStyle: any\n fillStyle: any\n lineWidth: any\n font: any\n textAlign: any\n textBaseline: any\n lineDash: any\n\n constructor(width: number, height: number, options: ContextOptions = {}) {\n this.width = width\n this.height = height\n this.canvas = this\n this.__document = options.document || document\n\n if (options.ctx) {\n this.__ctx = options.ctx\n } else {\n this.__canvas = this.__document.createElement('canvas')\n this.__ctx = this.__canvas.getContext('2d')!\n }\n\n this.__setDefaultStyles()\n this.__styleStack = [this.__getStyleState()]\n this.__groupStack = []\n\n this.__root = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg',\n )\n this.__root.setAttribute('version', '1.1')\n this.__root.setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n this.__root.setAttribute('width', String(width))\n this.__root.setAttribute('height', String(height))\n\n this.__currentElement = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'g',\n )\n this.__root.appendChild(this.__currentElement)\n\n this.__currentDefaultPath = ''\n this.__currentPosition = {}\n this.__transformMatrix = new DOMMatrix()\n\n this.resetTransform()\n }\n\n __createElement(\n elementName: string,\n properties: Record<string, any> = {},\n resetFill?: boolean,\n ): SVGElement {\n const element = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n elementName,\n )\n if (resetFill) {\n // placeholders: fill()/stroke() overwrite their own attribute, and\n // __applyStyleToCurrentElement drops the other when it is the svg default\n element.setAttribute('fill', 'none')\n element.setAttribute('stroke', 'none')\n }\n for (const key of Object.keys(properties)) {\n // __applyText passes optional attributes through unconditionally; skipping\n // unset ones keeps an invalid text-decoration=\"undefined\" (~28 bytes) off\n // every glyph\n const value = properties[key]\n if (value !== undefined && value !== null) {\n element.setAttribute(key, value)\n }\n }\n return element\n }\n\n __setDefaultStyles() {\n for (const key of Object.keys(STYLES)) {\n ;(this as any)[key] = STYLES[key].canvas\n }\n }\n\n __applyStyleState(styleState: Record<string, any>) {\n for (const key of Object.keys(styleState)) {\n ;(this as any)[key] = styleState[key]\n }\n }\n\n __getStyleState(): Record<string, any> {\n const styleState: Record<string, any> = {}\n for (const key of Object.keys(STYLES)) {\n styleState[key] = (this as any)[key]\n }\n return styleState\n }\n\n /**\n * A pure translation folds into the element's x/y, saving ~35 bytes per\n * glyph. Any other transform, such as a sequence-logo letter's scale, is\n * written as a matrix.\n */\n __applyTransformation(element: SVGElement, matrix?: DOMMatrix) {\n const { a, b, c, d, e, f } = matrix || this.getTransform()\n if (\n a === 1 &&\n b === 0 &&\n c === 0 &&\n d === 1 &&\n element.hasAttribute('x') &&\n element.hasAttribute('y')\n ) {\n if (e !== 0) {\n element.setAttribute('x', String(Number(element.getAttribute('x')) + e))\n }\n if (f !== 0) {\n element.setAttribute('y', String(Number(element.getAttribute('y')) + f))\n }\n return\n }\n element.setAttribute('transform', `matrix(${a} ${b} ${c} ${d} ${e} ${f})`)\n }\n\n __applyStyleToCurrentElement(type: string) {\n const currentElement = this.__currentElement\n\n for (const key of Object.keys(STYLES)) {\n const style = STYLES[key]\n const value = (this as any)[key]\n if (!style.apply?.includes(type) || style.svg === value) {\n continue\n }\n const matches =\n (style.svgAttr === 'stroke' || style.svgAttr === 'fill') &&\n typeof value === 'string' &&\n value.includes('rgba')\n ? rgbaRegex.exec(value)\n : null\n if (matches) {\n // SVG has no rgba(); the alpha goes in the -opacity attribute\n currentElement.setAttribute(\n style.svgAttr,\n `rgb(${matches[1]},${matches[2]},${matches[3]})`,\n )\n currentElement.setAttribute(`${style.svgAttr}-opacity`, matches[4]!)\n } else if (key === 'lineWidth') {\n const scale = this.__getTransformScale()\n currentElement.setAttribute(\n style.svgAttr,\n String(value * Math.max(scale.x, scale.y)),\n )\n } else {\n currentElement.setAttribute(style.svgAttr, value)\n }\n }\n\n // svg defaults stroke to none, so a fill drops stroke=\"none\". Fill defaults\n // to black, so a stroked element keeps fill=\"none\".\n if (type === 'fill' && currentElement.getAttribute('stroke') === 'none') {\n currentElement.removeAttribute('stroke')\n }\n }\n\n __closestGroupOrSvg(node?: SVGElement): SVGElement {\n node = node || this.__currentElement\n if (node.nodeName === 'g' || node.nodeName === 'svg') {\n return node\n }\n return this.__closestGroupOrSvg(node.parentNode as SVGElement)\n }\n\n getSvg(): SVGSVGElement {\n return this.__root\n }\n\n save() {\n const group = this.__createElement('g')\n const parent = this.__closestGroupOrSvg()\n this.__groupStack.push(parent)\n parent.appendChild(group)\n this.__currentElement = group\n this.__styleStack.push(this.__getStyleState())\n if (!this.__transformMatrixStack) {\n this.__transformMatrixStack = []\n }\n this.__transformMatrixStack.push(this.getTransform())\n }\n\n restore() {\n this.__currentElement = this.__groupStack.pop()!\n if (!this.__currentElement) {\n this.__currentElement = this.__root.childNodes[0] as SVGElement\n }\n this.__applyStyleState(this.__styleStack.pop())\n if (this.__transformMatrixStack && this.__transformMatrixStack.length > 0) {\n this.setTransform(this.__transformMatrixStack.pop()!)\n }\n }\n\n beginPath() {\n this.__currentDefaultPath = ''\n this.__currentPosition = {}\n const path = this.__createElement('path', {}, true)\n this.__closestGroupOrSvg().appendChild(path)\n this.__currentElement = path\n }\n\n __applyCurrentDefaultPath() {\n if (this.__currentElement.nodeName === 'path') {\n this.__currentElement.setAttribute('d', this.__currentDefaultPath)\n }\n }\n\n __addPathCommand(command: string) {\n this.__currentDefaultPath += ' '\n this.__currentDefaultPath += command\n }\n\n moveTo(x: number, y: number) {\n if (this.__currentElement.nodeName !== 'path') {\n this.beginPath()\n }\n this.__currentPosition = { x, y }\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(`M ${p.x} ${p.y}`)\n }\n\n closePath() {\n if (this.__currentDefaultPath) {\n this.__addPathCommand('Z')\n }\n }\n\n lineTo(x: number, y: number) {\n this.__currentPosition = { x, y }\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(\n this.__currentDefaultPath.includes('M')\n ? `L ${p.x} ${p.y}`\n : `M ${p.x} ${p.y}`,\n )\n }\n\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number) {\n this.__currentPosition = { x, y }\n const cp = this.__matrixTransform(cpx, cpy)\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(`Q ${cp.x} ${cp.y} ${p.x} ${p.y}`)\n }\n\n // paint-order matters only on an element with both fill and stroke: the\n // collapsed-clade triangle\n __applyPaintOrder(order: string, other: string) {\n const current = this.__currentElement\n if (\n current.nodeName === 'path' &&\n current.hasAttribute(other) &&\n current.getAttribute(other) !== 'none'\n ) {\n current.setAttribute('paint-order', order)\n }\n }\n\n stroke() {\n this.__applyPaintOrder('fill stroke markers', 'fill')\n this.__applyCurrentDefaultPath()\n this.__applyStyleToCurrentElement('stroke')\n }\n\n fill() {\n this.__applyPaintOrder('stroke fill markers', 'stroke')\n this.__applyCurrentDefaultPath()\n this.__applyStyleToCurrentElement('fill')\n }\n\n // A fill covering the whole context paints over what is under it, as on a\n // canvas; it does not clear the drawing.\n fillRect(x: number, y: number, width: number, height: number) {\n const rect = this.__createElement('rect', { x, y, width, height }, true)\n this.__closestGroupOrSvg().appendChild(rect)\n this.__currentElement = rect\n this.__applyTransformation(rect)\n this.__applyStyleToCurrentElement('fill')\n }\n\n strokeRect(x: number, y: number, width: number, height: number) {\n const rect = this.__createElement('rect', { x, y, width, height }, true)\n this.__closestGroupOrSvg().appendChild(rect)\n this.__currentElement = rect\n this.__applyTransformation(rect)\n this.__applyStyleToCurrentElement('stroke')\n }\n\n clearRect(x: number, y: number, width: number, height: number) {\n const { a, b, c, d, e, f } = this.getTransform()\n if (\n a === 1 &&\n b === 0 &&\n c === 0 &&\n d === 1 &&\n e === 0 &&\n f === 0 &&\n x === 0 &&\n y === 0 &&\n width === this.width &&\n height === this.height\n ) {\n this.__clearCanvas()\n return\n }\n const rect = this.__createElement(\n 'rect',\n { x, y, width, height, fill: '#FFFFFF' },\n true,\n )\n this.__applyTransformation(rect)\n this.__closestGroupOrSvg().appendChild(rect)\n }\n\n __clearCanvas() {\n this.__root.removeChild(this.__root.childNodes[0]!)\n this.__currentElement = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'g',\n )\n this.__root.appendChild(this.__currentElement)\n this.__groupStack = []\n }\n\n __parsedFont() {\n const hit = this.__fontCache.get(this.font)\n if (hit) {\n return hit\n }\n const el = document.createElement('span')\n el.setAttribute('style', `font:${this.font}`)\n this.__fontCache.set(this.font, el.style)\n return el.style\n }\n\n fillText(text: string, x: number, y: number) {\n const style = this.__parsedFont()\n const parent = this.__closestGroupOrSvg()\n const textElement = this.__createElement(\n 'text',\n {\n 'font-family': style.fontFamily,\n 'font-size': style.fontSize,\n 'font-style': omitDefault('font-style', style.fontStyle),\n 'font-weight': omitDefault('font-weight', style.fontWeight),\n x,\n y,\n 'text-anchor': getTextAnchor(this.textAlign),\n 'dominant-baseline': omitDefault(\n 'dominant-baseline',\n getDominantBaseline(this.textBaseline),\n ),\n },\n true,\n )\n\n textElement.appendChild(this.__document.createTextNode(text))\n this.__currentElement = textElement\n this.__applyTransformation(textElement)\n this.__applyStyleToCurrentElement('fill')\n parent.appendChild(textElement)\n }\n\n measureText(text: string): TextMetrics {\n this.__ctx.font = this.font\n return this.__ctx.measureText(text)\n }\n\n arc(\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n counterClockwise?: boolean,\n ) {\n if (startAngle === endAngle) {\n return\n }\n startAngle = startAngle % (2 * Math.PI)\n endAngle = endAngle % (2 * Math.PI)\n if (startAngle === endAngle) {\n endAngle =\n (endAngle + 2 * Math.PI - 0.001 * (counterClockwise ? -1 : 1)) %\n (2 * Math.PI)\n }\n const endX = x + radius * Math.cos(endAngle)\n const endY = y + radius * Math.sin(endAngle)\n const startX = x + radius * Math.cos(startAngle)\n const startY = y + radius * Math.sin(startAngle)\n const sweepFlag = counterClockwise ? 0 : 1\n let diff = endAngle - startAngle\n if (diff < 0) {\n diff += 2 * Math.PI\n }\n const largeArcFlag = counterClockwise\n ? diff > Math.PI\n ? 0\n : 1\n : diff > Math.PI\n ? 1\n : 0\n\n const { x: scaleX, y: scaleY } = this.__getTransformScale()\n const end = this.__matrixTransform(endX, endY)\n\n this.lineTo(startX, startY)\n this.__addPathCommand(\n `A ${radius * scaleX} ${radius * scaleY} 0 ${largeArcFlag} ${sweepFlag} ${end.x} ${end.y}`,\n )\n this.__currentPosition = { x: endX, y: endY }\n }\n\n setLineDash(dashArray: number[]) {\n this.lineDash = dashArray.length > 0 ? dashArray.join(',') : null\n }\n\n setTransform(\n a: number | DOMMatrix,\n b?: number,\n c?: number,\n d?: number,\n e?: number,\n f?: number,\n ) {\n this.__transformMatrix =\n a instanceof DOMMatrix\n ? new DOMMatrix([a.a, a.b, a.c, a.d, a.e, a.f])\n : new DOMMatrix([a, b!, c!, d!, e!, f!])\n }\n\n getTransform(): DOMMatrix {\n const { a, b, c, d, e, f } = this.__transformMatrix\n return new DOMMatrix([a, b, c, d, e, f])\n }\n\n resetTransform() {\n this.setTransform(1, 0, 0, 1, 0, 0)\n }\n\n scale(x: number, y?: number) {\n if (y === undefined) {\n y = x\n }\n if (isNaN(x) || isNaN(y) || !isFinite(x) || !isFinite(y)) {\n return\n }\n this.setTransform(this.getTransform().scale(x, y))\n }\n\n translate(x: number, y: number) {\n this.setTransform(this.getTransform().translate(x, y))\n }\n\n __matrixTransform(x: number, y: number): DOMPoint {\n return new DOMPoint(x, y).matrixTransform(this.__transformMatrix)\n }\n\n __getTransformScale(): { x: number; y: number } {\n return {\n x: Math.hypot(this.__transformMatrix.a, this.__transformMatrix.b),\n y: Math.hypot(this.__transformMatrix.c, this.__transformMatrix.d),\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "4BAiBA,SAASA,EAAcC,EAAiB,CACtC,IAAMC,EAAkC,CACtC,KAAM,QACN,MAAO,MACP,OAAQ,SACR,MAAO,QACP,IAAK,OAEP,OAAOA,EAAQD,CAAS,GAAKC,EAAQ,KACvC,CAEA,SAASC,EAAoBC,EAAoB,CAC/C,IAAMF,EAAkC,CACtC,WAAY,aACZ,QAAS,UACT,IAAK,mBACL,OAAQ,kBACR,OAAQ,WAEV,OAAOA,EAAQE,CAAY,GAAKF,EAAQ,UAC1C,CAMA,IAAMG,EAA6C,CACjD,aAAc,SACd,cAAe,SAEf,oBAAqB,cAGvB,SAASC,EAAYC,EAAcC,EAAyB,CAC1D,OAAOA,IAAUH,EAAmBE,CAAI,EAAI,OAAYC,CAC1D,CAEA,IAAMC,EAA8B,CAClC,YAAa,CACX,QAAS,SACT,OAAQ,UACR,IAAK,OACL,MAAO,UAET,UAAW,CACT,QAAS,OACT,OAAQ,UACR,IAAK,KACL,MAAO,QAET,UAAW,CACT,QAAS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se+svgcanvas@9.1.0/node_modules/@jbrowse/svgcanvas/src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * SVGCanvas v2.0.3\n * Draw on SVG using Canvas's 2D Context API.\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Original Authors: Kerry Liu, Zeno Zeng\n * Copyright (c) 2014 Gliffy Inc.\n * Copyright (c) 2021 Zeno Zeng\n *\n * Vendored, converted to ESM/TypeScript, and cut down to the calls the\n * renderers make: rectangles, paths, arcs and glyphs.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nfunction getTextAnchor(textAlign: string): string {\n const mapping: Record<string, string> = {\n left: 'start',\n right: 'end',\n center: 'middle',\n start: 'start',\n end: 'end',\n }\n return mapping[textAlign] || mapping.start!\n}\n\nfunction getDominantBaseline(textBaseline: string): string {\n const mapping: Record<string, string> = {\n alphabetic: 'alphabetic',\n hanging: 'hanging',\n top: 'text-before-edge',\n bottom: 'text-after-edge',\n middle: 'central',\n }\n return mapping[textBaseline] || mapping.alphabetic!\n}\n\n/**\n * SVG's initial values for text presentation attributes. Omitting them from\n * every glyph takes ~22% off a sequence-logo figure.\n */\nconst TEXT_ATTR_DEFAULTS: Record<string, string> = {\n 'font-style': 'normal',\n 'font-weight': 'normal',\n // the initial value is `auto`, which resolves to the alphabetic baseline\n 'dominant-baseline': 'alphabetic',\n}\n\nfunction omitDefault(attr: string, value: string | undefined) {\n return value === TEXT_ATTR_DEFAULTS[attr] ? undefined : value\n}\n\nconst STYLES: Record<string, any> = {\n strokeStyle: {\n svgAttr: 'stroke',\n canvas: '#000000',\n svg: 'none',\n apply: 'stroke',\n },\n fillStyle: {\n svgAttr: 'fill',\n canvas: '#000000',\n svg: null,\n apply: 'fill',\n },\n lineWidth: {\n svgAttr: 'stroke-width',\n canvas: 1,\n svg: 1,\n apply: 'stroke',\n },\n font: {\n canvas: '10px sans-serif',\n },\n textAlign: {\n canvas: 'start',\n },\n textBaseline: {\n canvas: 'alphabetic',\n },\n // null on both sides so the canvas and svg defaults compare equal and strokes\n // carry no empty stroke-dasharray\n lineDash: {\n svgAttr: 'stroke-dasharray',\n canvas: null,\n svg: null,\n apply: 'stroke',\n },\n}\n\nconst rgbaRegex =\n /rgba\\(\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/i\n\ninterface ContextOptions {\n document?: Document\n ctx?: CanvasRenderingContext2D\n}\n\nexport class Context {\n width: number\n height: number\n canvas: Context\n\n __document: Document\n __ctx: CanvasRenderingContext2D\n __canvas?: HTMLCanvasElement\n __root: SVGSVGElement\n __currentElement: SVGElement\n __styleStack: any[]\n __groupStack: SVGElement[]\n __currentDefaultPath: string\n __currentPosition: { x?: number; y?: number }\n __transformMatrix: DOMMatrix\n __transformMatrixStack?: DOMMatrix[]\n // parsed fonts keyed by `font` string; each parse costs a DOM element and a\n // CSS parse, and exports ask per glyph\n __fontCache = new Map<string, CSSStyleDeclaration>()\n\n strokeStyle: any\n fillStyle: any\n lineWidth: any\n font: any\n textAlign: any\n textBaseline: any\n lineDash: any\n\n constructor(width: number, height: number, options: ContextOptions = {}) {\n this.width = width\n this.height = height\n this.canvas = this\n this.__document = options.document || document\n\n if (options.ctx) {\n this.__ctx = options.ctx\n } else {\n this.__canvas = this.__document.createElement('canvas')\n this.__ctx = this.__canvas.getContext('2d')!\n }\n\n this.__setDefaultStyles()\n this.__styleStack = [this.__getStyleState()]\n this.__groupStack = []\n\n this.__root = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg',\n )\n this.__root.setAttribute('version', '1.1')\n this.__root.setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n this.__root.setAttribute('width', String(width))\n this.__root.setAttribute('height', String(height))\n\n this.__currentElement = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'g',\n )\n this.__root.appendChild(this.__currentElement)\n\n this.__currentDefaultPath = ''\n this.__currentPosition = {}\n this.__transformMatrix = new DOMMatrix()\n\n this.resetTransform()\n }\n\n __createElement(\n elementName: string,\n properties: Record<string, any> = {},\n resetFill?: boolean,\n ): SVGElement {\n const element = this.__document.createElementNS(\n 'http://www.w3.org/2000/svg',\n elementName,\n )\n if (resetFill) {\n // placeholders: fill()/stroke() overwrite their own attribute, and\n // __applyStyleToCurrentElement drops the other when it is the svg default\n element.setAttribute('fill', 'none')\n element.setAttribute('stroke', 'none')\n }\n for (const key of Object.keys(properties)) {\n // __applyText passes optional attributes through unconditionally; skipping\n // unset ones keeps an invalid text-decoration=\"undefined\" (~28 bytes) off\n // every glyph\n const value = properties[key]\n if (value !== undefined && value !== null) {\n element.setAttribute(key, value)\n }\n }\n return element\n }\n\n __setDefaultStyles() {\n for (const key of Object.keys(STYLES)) {\n ;(this as any)[key] = STYLES[key].canvas\n }\n }\n\n __applyStyleState(styleState: Record<string, any>) {\n for (const key of Object.keys(styleState)) {\n ;(this as any)[key] = styleState[key]\n }\n }\n\n __getStyleState(): Record<string, any> {\n const styleState: Record<string, any> = {}\n for (const key of Object.keys(STYLES)) {\n styleState[key] = (this as any)[key]\n }\n return styleState\n }\n\n /**\n * A pure translation folds into the element's x/y, saving ~35 bytes per\n * glyph. Any other transform, such as a sequence-logo letter's scale, is\n * written as a matrix.\n */\n __applyTransformation(element: SVGElement, matrix?: DOMMatrix) {\n const { a, b, c, d, e, f } = matrix || this.getTransform()\n if (\n a === 1 &&\n b === 0 &&\n c === 0 &&\n d === 1 &&\n element.hasAttribute('x') &&\n element.hasAttribute('y')\n ) {\n if (e !== 0) {\n element.setAttribute('x', String(Number(element.getAttribute('x')) + e))\n }\n if (f !== 0) {\n element.setAttribute('y', String(Number(element.getAttribute('y')) + f))\n }\n return\n }\n element.setAttribute('transform', `matrix(${a} ${b} ${c} ${d} ${e} ${f})`)\n }\n\n __applyStyleToCurrentElement(type: string) {\n const currentElement = this.__currentElement\n\n for (const key of Object.keys(STYLES)) {\n const style = STYLES[key]\n const value = (this as any)[key]\n if (!style.apply?.includes(type) || style.svg === value) {\n continue\n }\n const matches =\n (style.svgAttr === 'stroke' || style.svgAttr === 'fill') &&\n typeof value === 'string' &&\n value.includes('rgba')\n ? rgbaRegex.exec(value)\n : null\n if (matches) {\n // SVG has no rgba(); the alpha goes in the -opacity attribute\n currentElement.setAttribute(\n style.svgAttr,\n `rgb(${matches[1]},${matches[2]},${matches[3]})`,\n )\n currentElement.setAttribute(`${style.svgAttr}-opacity`, matches[4]!)\n } else if (key === 'lineWidth') {\n const scale = this.__getTransformScale()\n currentElement.setAttribute(\n style.svgAttr,\n String(value * Math.max(scale.x, scale.y)),\n )\n } else {\n currentElement.setAttribute(style.svgAttr, value)\n }\n }\n\n // svg defaults stroke to none, so a fill drops stroke=\"none\". Fill defaults\n // to black, so a stroked element keeps fill=\"none\".\n if (type === 'fill' && currentElement.getAttribute('stroke') === 'none') {\n currentElement.removeAttribute('stroke')\n }\n }\n\n __closestGroupOrSvg(node?: SVGElement): SVGElement {\n node = node || this.__currentElement\n if (node.nodeName === 'g' || node.nodeName === 'svg') {\n return node\n }\n return this.__closestGroupOrSvg(node.parentNode as SVGElement)\n }\n\n getSvg(): SVGSVGElement {\n return this.__root\n }\n\n save() {\n const group = this.__createElement('g')\n const parent = this.__closestGroupOrSvg()\n this.__groupStack.push(parent)\n parent.appendChild(group)\n this.__currentElement = group\n this.__styleStack.push(this.__getStyleState())\n if (!this.__transformMatrixStack) {\n this.__transformMatrixStack = []\n }\n this.__transformMatrixStack.push(this.getTransform())\n }\n\n restore() {\n this.__currentElement = this.__groupStack.pop()!\n if (!this.__currentElement) {\n this.__currentElement = this.__root.childNodes[0] as SVGElement\n }\n this.__applyStyleState(this.__styleStack.pop())\n if (this.__transformMatrixStack && this.__transformMatrixStack.length > 0) {\n this.setTransform(this.__transformMatrixStack.pop()!)\n }\n }\n\n beginPath() {\n this.__currentDefaultPath = ''\n this.__currentPosition = {}\n const path = this.__createElement('path', {}, true)\n this.__closestGroupOrSvg().appendChild(path)\n this.__currentElement = path\n }\n\n __applyCurrentDefaultPath() {\n if (this.__currentElement.nodeName === 'path') {\n this.__currentElement.setAttribute('d', this.__currentDefaultPath)\n }\n }\n\n __addPathCommand(command: string) {\n this.__currentDefaultPath += ' '\n this.__currentDefaultPath += command\n }\n\n moveTo(x: number, y: number) {\n if (this.__currentElement.nodeName !== 'path') {\n this.beginPath()\n }\n this.__currentPosition = { x, y }\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(`M ${p.x} ${p.y}`)\n }\n\n closePath() {\n if (this.__currentDefaultPath) {\n this.__addPathCommand('Z')\n }\n }\n\n lineTo(x: number, y: number) {\n this.__currentPosition = { x, y }\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(\n this.__currentDefaultPath.includes('M')\n ? `L ${p.x} ${p.y}`\n : `M ${p.x} ${p.y}`,\n )\n }\n\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number) {\n this.__currentPosition = { x, y }\n const cp = this.__matrixTransform(cpx, cpy)\n const p = this.__matrixTransform(x, y)\n this.__addPathCommand(`Q ${cp.x} ${cp.y} ${p.x} ${p.y}`)\n }\n\n // paint-order matters only on an element with both fill and stroke: the\n // collapsed-clade triangle\n __applyPaintOrder(order: string, other: string) {\n const current = this.__currentElement\n if (\n current.nodeName === 'path' &&\n current.hasAttribute(other) &&\n current.getAttribute(other) !== 'none'\n ) {\n current.setAttribute('paint-order', order)\n }\n }\n\n stroke() {\n this.__applyPaintOrder('fill stroke markers', 'fill')\n this.__applyCurrentDefaultPath()\n this.__applyStyleToCurrentElement('stroke')\n }\n\n fill() {\n this.__applyPaintOrder('stroke fill markers', 'stroke')\n this.__applyCurrentDefaultPath()\n this.__applyStyleToCurrentElement('fill')\n }\n\n // A fill covering the whole context paints over what is under it, as on a\n // canvas; it does not clear the drawing.\n fillRect(x: number, y: number, width: number, height: number) {\n const rect = this.__createElement('rect', { x, y, width, height }, true)\n this.__closestGroupOrSvg().appendChild(rect)\n this.__currentElement = rect\n this.__applyTransformation(rect)\n this.__applyStyleToCurrentElement('fill')\n }\n\n strokeRect(x: number, y: number, width: number, height: number) {\n const rect = this.__createElement('rect', { x, y, width, height }, true)\n this.__closestGroupOrSvg().appendChild(rect)\n this.__currentElement = rect\n this.__applyTransformation(rect)\n this.__applyStyleToCurrentElement('stroke')\n }\n\n __parsedFont() {\n const hit = this.__fontCache.get(this.font)\n if (hit) {\n return hit\n }\n const el = document.createElement('span')\n el.setAttribute('style', `font:${this.font}`)\n this.__fontCache.set(this.font, el.style)\n return el.style\n }\n\n fillText(text: string, x: number, y: number) {\n const style = this.__parsedFont()\n const parent = this.__closestGroupOrSvg()\n const textElement = this.__createElement(\n 'text',\n {\n 'font-family': style.fontFamily,\n 'font-size': style.fontSize,\n 'font-style': omitDefault('font-style', style.fontStyle),\n 'font-weight': omitDefault('font-weight', style.fontWeight),\n x,\n y,\n 'text-anchor': getTextAnchor(this.textAlign),\n 'dominant-baseline': omitDefault(\n 'dominant-baseline',\n getDominantBaseline(this.textBaseline),\n ),\n },\n true,\n )\n\n textElement.appendChild(this.__document.createTextNode(text))\n this.__currentElement = textElement\n this.__applyTransformation(textElement)\n this.__applyStyleToCurrentElement('fill')\n parent.appendChild(textElement)\n }\n\n measureText(text: string): TextMetrics {\n this.__ctx.font = this.font\n return this.__ctx.measureText(text)\n }\n\n arc(\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n counterClockwise?: boolean,\n ) {\n if (startAngle === endAngle) {\n return\n }\n startAngle = startAngle % (2 * Math.PI)\n endAngle = endAngle % (2 * Math.PI)\n if (startAngle === endAngle) {\n endAngle =\n (endAngle + 2 * Math.PI - 0.001 * (counterClockwise ? -1 : 1)) %\n (2 * Math.PI)\n }\n const endX = x + radius * Math.cos(endAngle)\n const endY = y + radius * Math.sin(endAngle)\n const startX = x + radius * Math.cos(startAngle)\n const startY = y + radius * Math.sin(startAngle)\n const sweepFlag = counterClockwise ? 0 : 1\n let diff = endAngle - startAngle\n if (diff < 0) {\n diff += 2 * Math.PI\n }\n const largeArcFlag = counterClockwise\n ? diff > Math.PI\n ? 0\n : 1\n : diff > Math.PI\n ? 1\n : 0\n\n const { x: scaleX, y: scaleY } = this.__getTransformScale()\n const end = this.__matrixTransform(endX, endY)\n\n this.lineTo(startX, startY)\n this.__addPathCommand(\n `A ${radius * scaleX} ${radius * scaleY} 0 ${largeArcFlag} ${sweepFlag} ${end.x} ${end.y}`,\n )\n this.__currentPosition = { x: endX, y: endY }\n }\n\n setLineDash(dashArray: number[]) {\n this.lineDash = dashArray.length > 0 ? dashArray.join(',') : null\n }\n\n setTransform(\n a: number | DOMMatrix,\n b?: number,\n c?: number,\n d?: number,\n e?: number,\n f?: number,\n ) {\n this.__transformMatrix =\n a instanceof DOMMatrix\n ? new DOMMatrix([a.a, a.b, a.c, a.d, a.e, a.f])\n : new DOMMatrix([a, b!, c!, d!, e!, f!])\n }\n\n getTransform(): DOMMatrix {\n const { a, b, c, d, e, f } = this.__transformMatrix\n return new DOMMatrix([a, b, c, d, e, f])\n }\n\n resetTransform() {\n this.setTransform(1, 0, 0, 1, 0, 0)\n }\n\n scale(x: number, y?: number) {\n if (y === undefined) {\n y = x\n }\n if (isNaN(x) || isNaN(y) || !isFinite(x) || !isFinite(y)) {\n return\n }\n this.setTransform(this.getTransform().scale(x, y))\n }\n\n translate(x: number, y: number) {\n this.setTransform(this.getTransform().translate(x, y))\n }\n\n __matrixTransform(x: number, y: number): DOMPoint {\n return new DOMPoint(x, y).matrixTransform(this.__transformMatrix)\n }\n\n __getTransformScale(): { x: number; y: number } {\n return {\n x: Math.hypot(this.__transformMatrix.a, this.__transformMatrix.b),\n y: Math.hypot(this.__transformMatrix.c, this.__transformMatrix.d),\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "4BAiBA,SAASA,EAAcC,EAAiB,CACtC,IAAMC,EAAkC,CACtC,KAAM,QACN,MAAO,MACP,OAAQ,SACR,MAAO,QACP,IAAK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AAGA,EAAE,EAAGA,EAAE,EAAGA,EAAE,EAAGA,EAAE,CAAC,CAAC,EAC5C,IAAI,UAAU,CAACA,EAAGC,EAAIC,EAAIC,EAAIC,EAAIC,CAAE,CAAC,CAC7C,CAEA,cAAY,CACV,GAAM,CAAE,EAAAL,EAAG,EAAAC,EAAG,EAAAC,EAAG,EAAAC,EAAG,EAAAC,EAAG,EAAAC,CAAC,EAAK,KAAK,kBAClC,OAAO,IAAI,UAAU,CAACL,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,CAAC,CAAC,CACzC,CAEA,gBAAc,CACZ,KAAK,aAAa,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,CACpC,CAEA,MAAMW,EAAWC,EAAU,CACrBA,IAAM,SACRA,EAAID,GAEF,QAAMA,CAAC,GAAK,MAAMC,CAAC,GAAK,CAAC,SAASD,CAAC,GAAK,CAAC,SAASC,CAAC,IAGvD,KAAK,aAAa,KAAK,aAAY,EAAG,MAAMD,EAAGC,CAAC,CAAC,CACnD,CAEA,UAAUD,EAAWC,EAAS,CAC5B,KAAK,aAAa,KAAK,aAAY,EAAG,UAAUD,EAAGC,CAAC,CAAC,CACvD,CAEA,kBAAkBD,EAAWC,EAAS,CACpC,OAAO,IAAI,SAASD,EAAGC,CAAC,EAAE,gBAAgB,KAAK,iBAAiB,CAClE,CAEA,qBAAmB,CACjB,MAAO,CACL,EAAG,KAAK,MAAM,KAAK,kBAAkB,EAAG,KAAK,kBAAkB,CAAC,EAChE,EAAG,KAAK,MAAM,KAAK,kBAAkB,EAAG,KAAK,kBAAkB,CAAC,EAEpE",
|
|
6
6
|
"names": ["getTextAnchor", "textAlign", "mapping", "getDominantBaseline", "textBaseline", "TEXT_ATTR_DEFAULTS", "omitDefault", "attr", "value", "STYLES", "rgbaRegex", "Context", "width", "height", "options", "elementName", "properties", "resetFill", "element", "key", "styleState", "matrix", "a", "b", "c", "d", "e", "f", "type", "currentElement", "style", "matches", "scale", "node", "group", "parent", "path", "command", "x", "y", "p", "cpx", "cpy", "cp", "order", "other", "current", "rect", "hit", "el", "text", "textElement", "radius", "startAngle", "endAngle", "counterClockwise", "endX", "endY", "startX", "startY", "sweepFlag", "diff", "largeArcFlag", "scaleX", "scaleY", "end", "dashArray"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n}from"./chunk-CSCUNTGJ.js";import"./chunk-TSHN6J7U.js";import"./chunk-NWHZOZMG.js";import"./chunk-DEFUNIWW.js";import"./chunk-FCWXYIFC.js";import"./chunk-YUKJI2AH.js";import"./chunk-K55ZVN73.js";import"./chunk-IBBQUV2I.js";import{K as b,Z as c}from"./chunk-L6CBIH6H.js";import{G as a}from"./chunk-OVAXNTPN.js";import"./chunk-73KAPCJ2.js";import"./chunk-JF6CW6MO.js";import"./chunk-CVLB4VFP.js";import"./chunk-DNFD5II2.js";import"./chunk-BX4Z274Q.js";import"./chunk-J6KYLXRD.js";import"./chunk-FY3BTKY4.js";export{b as CHAR_WIDTH_RATIO,h as MSAModelF,g as MSAView,k as MSAViewer,m as defineMsaElement,f as expandSpec,d as installHeadlessRenderEnv,a as maxNeighborJoiningRows,l as mount,c as renderToSvg,e as residueLabel,i as resolveTheme,n as useMsaSvgFigure,j as viewerSnapshot};
|
|
2
|
+
//# sourceMappingURL=dist-N4ZJK63Q.js.map
|