jbrowse-plugin-graphgenomeviewer 10.0.7 → 10.0.8
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/chunks/{GraphGenomeView-TVPP3JXL.js → GraphGenomeView-7Y52T5N2.js} +2 -2
- package/dist/chunks/{GraphSettingsDialog-V3JXXA5N.js → GraphSettingsDialog-PJD5TQNZ.js} +2 -2
- package/dist/chunks/{LinearGraphDisplay-6JSUV5T7.js → LinearGraphDisplay-QHYAJXQS.js} +2 -2
- package/dist/chunks/chunk-26KRYRPL.js +2 -0
- package/dist/chunks/chunk-26KRYRPL.js.map +7 -0
- package/dist/chunks/chunk-FYJF6NGI.js +2 -0
- package/dist/chunks/chunk-FYJF6NGI.js.map +7 -0
- package/dist/chunks/{chunk-J6ZPLMS4.js → chunk-KWVUW7M3.js} +3 -3
- package/dist/chunks/{chunk-Z5U5JJOF.js → chunk-OJTJROER.js} +2 -2
- package/dist/chunks/{chunk-2GIPH53W.js → chunk-XTJFDEHU.js} +3 -3
- package/dist/chunks/{chunk-2GIPH53W.js.map → chunk-XTJFDEHU.js.map} +3 -3
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -1
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/GraphGenomeView/components/GraphCanvas.tsx +7 -1
- package/src/GraphGenomeView/components/HaplotypeSwitch.test.tsx +79 -0
- package/src/GraphGenomeView/components/HaplotypeSwitch.tsx +48 -0
- package/src/GraphGenomeView/components/LayoutSwitch.tsx +6 -59
- package/src/GraphGenomeView/components/keyControls.tsx +56 -0
- package/src/GraphGenomeView/model.geneNames.test.ts +30 -0
- package/src/GraphGenomeView/pane/graphViews.ts +10 -6
- package/src/GraphGenomeView/pane/walkRowViews.ts +3 -2
- package/src/GraphGenomeView/repeats/repeatFeatures.test.ts +13 -0
- package/src/GraphGenomeView/repeats/repeatFeatures.ts +5 -1
- package/src/version.ts +1 -1
- package/dist/chunks/chunk-OGTEEELR.js +0 -2
- package/dist/chunks/chunk-OGTEEELR.js.map +0 -7
- package/dist/chunks/chunk-Y44JPSDC.js +0 -2
- package/dist/chunks/chunk-Y44JPSDC.js.map +0 -7
- /package/dist/chunks/{GraphGenomeView-TVPP3JXL.js.map → GraphGenomeView-7Y52T5N2.js.map} +0 -0
- /package/dist/chunks/{GraphSettingsDialog-V3JXXA5N.js.map → GraphSettingsDialog-PJD5TQNZ.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-6JSUV5T7.js.map → LinearGraphDisplay-QHYAJXQS.js.map} +0 -0
- /package/dist/chunks/{chunk-J6ZPLMS4.js.map → chunk-KWVUW7M3.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5U5JJOF.js.map → chunk-OJTJROER.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as $}from"./chunk-
|
|
1
|
+
import{b as $}from"./chunk-FYJF6NGI.js";import"./chunk-OJTJROER.js";import"./chunk-GU6ICSQY.js";import{g as R,h as U}from"./chunk-KWVUW7M3.js";import"./chunk-IK5G3JHR.js";import{a as V}from"./chunk-XTJFDEHU.js";import"./chunk-UJE5ZJI5.js";import{q as v}from"./chunk-26KRYRPL.js";import"./chunk-YZY2352T.js";import"./chunk-IH6G574V.js";import"./chunk-7LYLVIJW.js";import"./chunk-BYY3V7KM.js";import"./chunk-DZRSGU6E.js";import"./chunk-JM4W4PKP.js";import"./chunk-LFE6TOIV.js";import"./chunk-P24MAMZH.js";import"./chunk-YBLNN5FU.js";import"./chunk-C56T4EVK.js";import"./chunk-FHO2KPEI.js";import"./chunk-JCKDLTK6.js";import"./chunk-D3QZGLZ3.js";import"./chunk-WKD7ALOU.js";import"./chunk-TQZH7NNB.js";import"./chunk-TMM73K4C.js";import"./chunk-D6TY2QEG.js";import"./chunk-YBLNN5FU.js";import"./chunk-EGZZ3ADM.js";import"./chunk-PISYAACJ.js";import{j as A,o as F}from"./chunk-5L276I7O.js";import{e as O,i as c}from"./chunk-J2PN6CG3.js";import{B as y,G as x,I as p,e as N,j as B,m as E,n as D,o as l,s as P,y as z}from"./chunk-H42TSPVA.js";import{a as L,b as e,c as n,d}from"./chunk-DUU6T2I5.js";var K=v()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},actions:{display:"flex",justifyContent:"flex-end",gap:8}}),_=d(function({model:t}){return e(l,{size:"small","data-testid":"graph-genome-choose-another",onClick:()=>{t.clearGraph()},children:"Choose another graph"})}),X=d(function({model:t}){let{classes:r}=K();return!t.error&&!t.loadCanceled?n(y,{className:r.paper,"data-testid":"graph-genome-loading",children:[n("div",{className:r.row,children:[e(B,{variant:"h6",message:t.statusMessage||void 0}),t.canCancelLoad?e(l,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{t.cancelLoad()},children:"Cancel"}):null]}),e(z,{variant:"indeterminate"})]}):t.error?n(y,{className:r.paper,children:[e(N,{error:t.error,onReset:()=>{t.retryLoad()}}),e("div",{className:r.actions,children:e(_,{model:t})})]}):e(y,{className:r.paper,"data-testid":"graph-genome-load-canceled",children:n("div",{className:r.row,children:[e(p,{variant:"h6",children:"Loading canceled"}),n("div",{className:r.actions,children:[e(_,{model:t}),e(l,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{t.retryLoad()},children:"Retry"})]})]})})}),I=X;var q=V(e("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7m2.85 11.1-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1"}),"LightbulbOutlined");var Z=v()({column:{display:"flex",flexDirection:"column",gap:12},actions:{display:"flex",justifyContent:"flex-end"}}),J=d(function({model:t,choices:r}){let{classes:T}=Z(),f=A(t),{assemblyManager:g}=f,[S,G]=c(r[0]?.trackId),[w,k]=c(),[C,h]=c(),a=r.find(o=>o.trackId===S)??r[0],i=a?.assembly,M=(i?g.get(i):void 0)?.regions?.[0],b=w??(a?R(f.views,a.assembly)??(M?U(a,M):""):"");O(()=>{i&&g.waitForAssembly(i).catch(()=>{})},[g,i]);async function W(){if(a)try{let o=await g.waitForAssembly(a.assembly),s=o?F(b,u=>o.isValidRefName(u)):void 0;!o||!s||!o.isValidRefName(s.refName)?h(`No sequence ${s?.refName??b} in ${a.assembly}`):t.showTrackInLinearView(a.trackId,a.assembly,b)}catch(o){h(String(o instanceof Error?o.message:o))}}return n("form",{className:T.column,"data-testid":"graph-track-picker",onSubmit:o=>{o.preventDefault(),W()},children:[e(D,{options:r,value:a??null,getOptionLabel:o=>o.name,isOptionEqualToValue:(o,s)=>o.trackId===s.trackId,onChange:(o,s)=>{s&&(G(s.trackId),k(void 0),h(void 0))},renderOption:({key:o,...s},u)=>e("li",{...s,children:n("div",{children:[e(p,{variant:"body2",children:u.name}),n(p,{variant:"caption",color:"text.secondary",children:[u.assembly," \xB7 ",u.reach]})]})},u.trackId),renderInput:o=>e(x,{...o,size:"small",label:"Graph track",helperText:a?`${a.assembly} \xB7 ${a.reach}`:""})}),e(x,{size:"small",label:"Region",name:"region",value:b,placeholder:"chr1:1,000,001-1,020,000",error:C!==void 0,helperText:C??"A sequence name, or name:start-end",onChange:o=>{k(o.target.value),h(void 0)}}),e("div",{className:T.actions,children:e(l,{type:"submit",variant:"contained","data-testid":"graph-track-show",disabled:!a||!b.trim(),children:"Show in linear genome view"})})]})}),H=J;var Q=`H VN:Z:1.0
|
|
2
2
|
S 1 ACGT
|
|
3
3
|
S 2 GGCC
|
|
4
4
|
S 3 TTAA
|
|
@@ -7,4 +7,4 @@ L 1 + 2 + 0M
|
|
|
7
7
|
L 1 + 3 + 0M
|
|
8
8
|
L 2 + 4 + 0M
|
|
9
9
|
L 3 + 4 + 0M`,Y=v()(m=>({column:{display:"flex",flexDirection:"column",gap:8},rowEnd:{display:"flex",gap:8,alignItems:"flex-end"},rowCenter:{display:"flex",gap:8,alignItems:"center"},flex1:{flex:1},paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto"},header:{marginBottom:12},tip:{marginBottom:16},divider:{marginBlock:16},footer:{marginTop:12,display:"flex",justifyContent:"flex-end"},dragging:{outline:`2px dashed ${m.palette.primary.main}`,outlineOffset:-4}})),ee=d(function({model:t}){let{classes:r,cx:T}=Y(),[f,g]=c(""),[S,G]=c(!1),{graphTracks:w}=t;function k(){let a=f.trim();a&&t.openGfaLocation({uri:a,locationType:"UriLocation"})}function C(a){let i=a.target.files?.[0];a.target.value="",i&&t.loadGFAFile(i,i.name)}function h(a){a.preventDefault(),G(!1);let i=a.dataTransfer.files[0];i&&t.loadGFAFile(i,i.name)}return n(y,{className:T(r.paper,S&&r.dragging),"data-testid":"graph-import-form",onDragOver:a=>{a.preventDefault(),G(a.dataTransfer.types.includes("Files"))},onDragLeave:a=>{(!(a.relatedTarget instanceof Node)||!a.currentTarget.contains(a.relatedTarget))&&G(!1)},onDrop:a=>{h(a)},children:[n(E,{severity:"info",icon:e(q,{fontSize:"inherit"}),className:r.tip,"data-testid":"graph-import-tip",children:["A pangenome graph usually reads best as a track in a linear genome view, which redraws it as you pan and zoom."," ",w.length>0?"Pick a graph track and a region below.":"Index it with gfa-to-tabix and open it with File \u2192 Open track."]}),w.length>0?n(L,{children:[e("div",{className:r.header,children:e(p,{variant:"h6",children:"Show a graph track"})}),e(H,{model:t,choices:w}),e(P,{className:r.divider}),e("div",{className:r.header,children:e(p,{variant:"subtitle1",children:"Or open a small GFA file"})})]}):e("div",{className:r.header,children:e(p,{variant:"h6",children:"Open a small GFA file"})}),n("div",{className:r.column,children:[n("div",{className:r.rowCenter,children:[n(l,{variant:"outlined",component:"label",size:"small",children:["Choose file",e("input",{type:"file",accept:".gfa,.gfa1,.gfa2,.gz",hidden:!0,onChange:a=>{C(a)}})]}),e(p,{variant:"caption",color:"text.secondary",children:"Or drop one here. The whole file is drawn at once."})]}),n("div",{className:r.rowEnd,children:[e(x,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:f,onChange:a=>{g(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&k()},className:r.flex1}),e(l,{variant:"contained",onClick:()=>{k()},disabled:!f.trim(),children:"Open"})]})]}),e("div",{className:r.footer,children:e(l,{size:"small",onClick:()=>{t.loadGFA(Q,"Example graph")},children:"Load 4-node example"})}),t.error?e(N,{error:t.error}):null]})}),j=ee;var ae=d(function({model:t}){return t.hasGraph?e($,{model:t}):t.canRetryLoad?e(I,{model:t}):n(L,{children:[t.isLoading?e(I,{model:t}):null,e("div",{hidden:t.isLoading,children:e(j,{model:t})})]})}),Ve=ae;export{Ve as default};
|
|
10
|
-
//# sourceMappingURL=GraphGenomeView-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-7Y52T5N2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=GraphSettingsDialog-
|
|
1
|
+
import{b as a}from"./chunk-OJTJROER.js";import"./chunk-26KRYRPL.js";import"./chunk-7LYLVIJW.js";import"./chunk-BYY3V7KM.js";import"./chunk-JCKDLTK6.js";import"./chunk-D3QZGLZ3.js";import"./chunk-TMM73K4C.js";import"./chunk-EGZZ3ADM.js";import"./chunk-PISYAACJ.js";import"./chunk-J2PN6CG3.js";import"./chunk-H42TSPVA.js";import"./chunk-DUU6T2I5.js";export{a as default};
|
|
2
|
+
//# sourceMappingURL=GraphSettingsDialog-PJD5TQNZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=LinearGraphDisplay-
|
|
1
|
+
import{a,b as i}from"./chunk-FYJF6NGI.js";import"./chunk-OJTJROER.js";import"./chunk-GU6ICSQY.js";import"./chunk-XTJFDEHU.js";import"./chunk-UJE5ZJI5.js";import"./chunk-26KRYRPL.js";import"./chunk-YZY2352T.js";import"./chunk-IH6G574V.js";import"./chunk-7LYLVIJW.js";import"./chunk-BYY3V7KM.js";import"./chunk-DZRSGU6E.js";import"./chunk-LFE6TOIV.js";import"./chunk-P24MAMZH.js";import"./chunk-YBLNN5FU.js";import"./chunk-C56T4EVK.js";import"./chunk-FHO2KPEI.js";import"./chunk-JCKDLTK6.js";import"./chunk-D3QZGLZ3.js";import"./chunk-WKD7ALOU.js";import"./chunk-TQZH7NNB.js";import"./chunk-TMM73K4C.js";import"./chunk-YBLNN5FU.js";import"./chunk-EGZZ3ADM.js";import"./chunk-PISYAACJ.js";import"./chunk-5L276I7O.js";import"./chunk-J2PN6CG3.js";import"./chunk-H42TSPVA.js";import{b as o,d as t}from"./chunk-DUU6T2I5.js";var e=JBrowseExports["@jbrowse/display-kit/DisplayChrome"];var s=e&&e.__esModule?e.default:e;var p=t(function({model:r}){return o(s,{model:r,factory:a,testid:"linear-graph-display","data-layout":r.chosenLayoutMode,"data-cut-tier":r.cutTier,"data-recuts":r.recuts,"data-node-count":r.hasGraph?r.nodeCount:void 0,"data-loading":r.isLoading?"":void 0,style:{width:r.paneWidth,height:r.height,overflow:"hidden"},children:n=>o(i,{model:r,handle:n})})}),c=p;export{c as default};
|
|
2
|
+
//# sourceMappingURL=LinearGraphDisplay-QHYAJXQS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as v}from"./chunk-7LYLVIJW.js";import{l as C,w as B,y as U}from"./chunk-JCKDLTK6.js";var H={"+":"-","-":"+"};function J(e){return new Map(e.graph.nodes.flatMap(n=>/[+-]$/.test(n.id)&&B(n)&&!U(n)?[[n.id,`${n.id.slice(0,-1)}${H[C(n.id)]}`]]:[]))}function $(e){let n=J(e),o=new Map([...n].map(([t,r])=>[r,t]));return n.size===0?{request:e,turnedBack:t=>t}:{request:{...e,graph:{nodes:e.graph.nodes.map(t=>({...t,id:n.get(t.id)??t.id})),edges:e.graph.edges.map(t=>n.has(t.from)||n.has(t.to)?{...t,from:n.get(t.from)??t.from,to:n.get(t.to)??t.to,fromStrand:t.fromStrand??C(t.from),toStrand:t.toStrand??C(t.to)}:t)}},turnedBack:t=>Object.fromEntries(Object.entries(t).map(([r,s])=>{let i=o.get(r);return i===void 0?[r,s]:[i,s.toReversed()]}))}}var y;function F(){return y??(y=import("./bandage-layout-UZEOCKMS.js").then(e=>e.default()).catch(e=>{throw y=void 0,e})),y}async function w(e){return(await F()).computeLayout(e.graph,e.options)}var G=[{value:"fmmm",label:"Bandage (FMMM)",description:"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm."},{value:"stress",label:"Stress",description:"Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference."}],Y=G.map(e=>e.value);function q(e){let n=$(e),o=v(n.request);return{...o,nodePositions:n.turnedBack(o.nodePositions)}}var z=async e=>{let n=performance.now();return{result:e.options.engine==="stress"?q(e):await w(e),duration:performance.now()-n}};function a(e,n){return typeof e.get=="function"?e.get(n):e[n]}function A(e,n){return e.find(o=>o.trackId===n)}function b(e){return`${e.trackId} ${e.name??""}`}var X=new Set(["BedAdapter","BedTabixAdapter","BigBedAdapter","VcfAdapter","VcfTabixAdapter"]),L=/repeat|tandem|\bstr\b|vntr|trf|trgt|vamos|expansion|microsat/i;function Dt(e,n){let o=n?A(e,n):void 0;return o||e.filter(r=>X.has(r.adapterType)).find(r=>L.test(b(r)))}var V=/^\w+=[^;]*(;\w+=[^;]*)*$/;function Q(e){let n=a(e,"name");if(!(typeof n!="string"||!V.test(n)))return Object.fromEntries(n.split(";").map(o=>{let t=o.indexOf("=");return[o.slice(0,t),o.slice(t+1)]}))}function u(e,n){let o=a(e,n);return o!==void 0?o:a(e,"INFO")?.[n]??Q(e)?.[n]}var j=["RUS","MOTIFS","RU","motifs","motif","sequence","consensus"],Z=["RUL","period","PERIOD","consensusSize","unit","unitLength"],ee=["TRID","REPID","VARID","ID","name","id"];function k(e,n){for(let o of n){let t=u(e,o),r=String((Array.isArray(t)?t[0]:t)??"").split(",")[0].trim();if(r!==""&&r!==".")return r}}var W=/^[ACGTURYSWKMBDHVN]+$/i;function te(e){let n=Number(k(e,Z));if(Number.isFinite(n)&&n>0)return Math.round(n);let o=k(e,j);return o&&W.test(o)?o.length:void 0}function m(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(o=>{let t=o===""||o===null||o===void 0?NaN:Number(o);return Number.isFinite(t)?t:void 0})}function R(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(o=>{let t=String(o??"").trim();return t===""||t==="."?void 0:t})}var N="<CNV:TR>";function ne(e){let n=R(a(e,"ALT"));if(!n.includes(N))return;let o=m(u(e,"RN")),t=R(u(e,"RUS")),r=m(u(e,"RUL")),s=m(u(e,"RUC")),i=m(u(e,"RB")),c=0;return n.map((f,l)=>{let p=o[l]??(f===N?1:0),d=0,h=0;for(let O=0;O<p;O++,c++){let E=t[c],M=r[c]??(E&&W.test(E)?E.length:void 0),P=s[c],D=i[c]??(M&&P!==void 0?Math.round(M*P):void 0);D!==void 0&&(d+=D,h++)}return f===N&&p>0&&h===p?d:void 0})}function oe(e,n,o){let t=e?.includes("|");return(e??"").split(/[/|]/).flatMap((r,s)=>{let i=r===""?NaN:Number(r),c=i>0?n[i-1]:o;return!Number.isInteger(i)||c===void 0?[]:[{bp:c,...t?{haplotype:s+1}:{}}]})}function re(e,n,o){let t=a(e,"samples"),r={};for(let[s,i]of Object.entries(t??{})){let c=m(i.SD),f=m(i.AL).flatMap((p,d)=>p!==void 0&&p>0?[c[d]===void 0?{bp:p}:{bp:p,spanningReads:c[d]}]:[]),l=f.length>0||!n?f:oe(R(i.GT)[0],n,o);l.length>0&&(r[s]=l)}return Object.keys(r).length>0?r:void 0}function se(e,n){let o=u(e,"start"),t=u(e,"end"),r=m(u(e,"SVLEN"))[0];return n&&r!==void 0?{start:o+1,end:o+1+r}:{start:o,end:t}}function Bt(e){let n=[],o=new Map;for(let t of e){let r=ne(t),{start:s,end:i}=se(t,r!==void 0),c=te(t);if(!(i>s)||c===void 0)continue;let f=u(t,"refName"),l=k(t,j),p=k(t,ee),d=`${f}:${s}-${i}`,h=(o.get(d)??0)+1;o.set(d,h),n.push({key:h===1?d:`${d} #${h}`,name:(p&&!V.test(p)?p:void 0)??(l&&l.length<=12?`(${l})n`:`${f}:${(s+1).toLocaleString("en-US")}-${i.toLocaleString("en-US")}`),refName:f,start:s,end:i,unit:c,motif:l,calls:re(t,r,i-s)})}return n.sort((t,r)=>t.start-r.start)}function S(e){let n=[];for(let o of[...e].sort((t,r)=>t.start-r.start)){let t=n.at(-1);t&&o.start<=t.end?t.end=Math.max(t.end,o.end):n.push({...o})}return n}function I(e){let n=[],o=new Map;for(let t of[...e].sort((r,s)=>r.start-s.start)){let r=`${t.refName} ${t.strand} ${t.name}`,s=o.get(r);if(s&&t.start<s.end)s.end=Math.max(s.end,t.end),s.exons=S([...s.exons,...t.exons]);else{let i={...t,exons:S(t.exons)};n.push(i),o.set(r,i)}}return n}var g=JBrowseExports["@jbrowse/core/configuration"],T=e=>g!=null&&e in Object(g)?g[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/configuration' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),Kt=T("ConfigurationReference"),Ht=T("ConfigurationSchema");var Jt=T("getConf");var _=T("readConfObject");var Yt=T("setConf");var qt=g&&g.__esModule?g.default:g;var ie=new Set(["Gff3TabixAdapter","Gff3Adapter","BedTabixAdapter","BedAdapter","GtfTabixAdapter","GtfAdapter","BigBedAdapter","NCListAdapter"]),ae=/gene|refseq|gencode|ensembl|annotation/i,ce=new Set(["BedTabixAdapter","BedAdapter"]);function tn(e,n){let o=n?A(e,n):void 0;if(o)return o;let t=e.filter(r=>ie.has(r.adapterType)&&!L.test(b(r)));return t.find(r=>ae.test(b(r)))??t.find(r=>!ce.has(r.adapterType))}var pe=/\bTEs?\b|transpos/i;function nn(e){return e&&pe.test(b(e))?"TE":"gene"}function on(e,n){let o=e.tracks?.find(t=>_(t.configuration,"trackId")===n)?.displays[0];return o?_(o.configuration,"filter")??[]:[]}var de=new Set(["chromosome","region","contig","supercontig","scaffold"]),ue=new Set(["exon","CDS","five_prime_UTR","three_prime_UTR","UTR"]);function K(e,n){let o=a(e,"type");typeof o=="string"&&ue.has(o)&&n.push({start:a(e,"start"),end:a(e,"end")});let t=a(e,"subfeatures");for(let r of t??[])K(r,n)}function rn(e){let n=[];for(let o of e){let t=a(o,"gene_name")??a(o,"name")??a(o,"gene")??a(o,"gene_id"),r=a(o,"start"),s=a(o,"end");if(!t||!(s>r)||de.has(a(o,"type")))continue;let i=[];K(o,i),n.push({name:t,refName:a(o,"refName"),start:r,end:s,strand:a(o,"strand")??0,exons:i.length?S(i):[{start:r,end:s}]})}return I(n)}var x=JBrowseExports["tss-react/mui"],fe=e=>x!=null&&e in Object(x)?x[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from 'tss-react/mui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var an=fe("makeStyles"),cn=x&&x.__esModule?x.default:x;export{Kt as a,Ht as b,Jt as c,_ as d,Yt as e,G as f,Y as g,z as h,X as i,Dt as j,Bt as k,ie as l,tn as m,nn as n,on as o,rn as p,an as q};
|
|
2
|
+
//# sourceMappingURL=chunk-26KRYRPL.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@14.0.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-BU3K4HBM.js", "../../node_modules/.pnpm/@jbrowse+graph-fmmm-layout@1.0.2/node_modules/@jbrowse/graph-fmmm-layout/esm/loadFmmm.js", "../../node_modules/.pnpm/@jbrowse+graph-fmmm-layout@1.0.2/node_modules/@jbrowse/graph-fmmm-layout/esm/fmmmLayout.js", "../../node_modules/.pnpm/@jbrowse+bandage-core@14.0.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-4TF4QRPB.js", "../../src/GraphGenomeView/trackFeatures.ts", "../../src/GraphGenomeView/repeats/repeatFeatures.ts", "../../node_modules/.pnpm/@jbrowse+bandage-core@14.0.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-7FQ7EVEE.js", "jbrowse-host:@jbrowse/core/configuration", "../../src/GraphGenomeView/genes/geneFeatures.ts", "jbrowse-host:tss-react/mui"],
|
|
4
|
+
"sourcesContent": ["import {\n drawnAlongStable,\n isBackbone\n} from \"./chunk-BUAMDOX6.js\";\nimport {\n ownStrand\n} from \"./chunk-ECUGYUKQ.js\";\n\n// src/layout/referenceReading.ts\nvar flip = { \"+\": \"-\", \"-\": \"+\" };\nfunction readingsAgainstIds(request) {\n return new Map(\n request.graph.nodes.flatMap(\n (node) => /[+-]$/.test(node.id) && isBackbone(node) && !drawnAlongStable(node) ? [[node.id, `${node.id.slice(0, -1)}${flip[ownStrand(node.id)]}`]] : []\n )\n );\n}\nfunction readAlongReference(request) {\n const readAs = readingsAgainstIds(request);\n const givenAs = new Map([...readAs].map(([id, reading]) => [reading, id]));\n return readAs.size === 0 ? { request, turnedBack: (lines) => lines } : {\n request: {\n ...request,\n graph: {\n nodes: request.graph.nodes.map((node) => ({\n ...node,\n id: readAs.get(node.id) ?? node.id\n })),\n edges: request.graph.edges.map(\n (edge) => readAs.has(edge.from) || readAs.has(edge.to) ? {\n ...edge,\n from: readAs.get(edge.from) ?? edge.from,\n to: readAs.get(edge.to) ?? edge.to,\n fromStrand: edge.fromStrand ?? ownStrand(edge.from),\n toStrand: edge.toStrand ?? ownStrand(edge.to)\n } : edge\n )\n }\n },\n turnedBack: (lines) => Object.fromEntries(\n Object.entries(lines).map(([id, line]) => {\n const given = givenAs.get(id);\n return given === void 0 ? [id, line] : [given, line.toReversed()];\n })\n )\n };\n}\n\nexport {\n readAlongReference\n};\n", "let cached;\nexport function loadFmmm() {\n cached !== null && cached !== void 0 ? cached : (cached = import('./bandage-layout.js')\n .then(mod => mod.default())\n .catch((e) => {\n cached = undefined;\n throw e;\n }));\n return cached;\n}\n", "import { loadFmmm } from \"./loadFmmm.js\";\nexport async function fmmmLayout(request) {\n const engine = await loadFmmm();\n return engine.computeLayout(request.graph, request.options);\n}\n", "import {\n readAlongReference\n} from \"./chunk-BU3K4HBM.js\";\n\n// src/layoutEngines.ts\nimport { fmmmLayout } from \"@jbrowse/graph-fmmm-layout\";\nimport { stressLayout } from \"@jbrowse/graph-stress-layout\";\nvar LAYOUT_ENGINES = [\n {\n value: \"fmmm\",\n label: \"Bandage (FMMM)\",\n description: \"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm.\"\n },\n {\n value: \"stress\",\n label: \"Stress\",\n description: \"Plain JS: the reference drawn straight and each variant placed against it, an allele as a lens, a repeat loop as a ring, a deletion as an arch; stress by stochastic gradient descent for components with no reference.\"\n }\n];\nvar LAYOUT_ENGINE_VALUES = LAYOUT_ENGINES.map((e) => e.value);\nfunction isLayoutEngineKind(value) {\n return LAYOUT_ENGINE_VALUES.some((v) => v === value);\n}\nfunction stressAlongReference(request) {\n const read = readAlongReference(request);\n const result = stressLayout(read.request);\n return { ...result, nodePositions: read.turnedBack(result.nodePositions) };\n}\nvar layoutEngine = async (request) => {\n const start = performance.now();\n const result = request.options.engine === \"stress\" ? stressAlongReference(request) : await fmmmLayout(request);\n return { result, duration: performance.now() - start };\n};\n\nexport {\n LAYOUT_ENGINES,\n LAYOUT_ENGINE_VALUES,\n isLayoutEngineKind,\n layoutEngine\n};\n", "import type { Feature } from '@jbrowse/core/util'\n\nexport type FeatureLike = Feature | Record<string, unknown>\n\nexport function ownField(f: FeatureLike, name: string): unknown {\n return typeof (f as Feature).get === 'function'\n ? (f as Feature).get(name)\n : (f as Record<string, unknown>)[name]\n}\n\nexport interface TrackChoice {\n trackId: string\n name?: string\n adapterType: string\n}\n\nexport function namedTrack<T extends TrackChoice>(tracks: T[], named: string) {\n return tracks.find(t => t.trackId === named)\n}\n\n// what a track-name hint such as /repeat|tandem/ is matched against\nexport function trackLabel(t: TrackChoice) {\n return `${t.trackId} ${t.name ?? ''}`\n}\n", "import { namedTrack, ownField, trackLabel } from '../trackFeatures'\n\nimport type { FeatureLike, TrackChoice } from '../trackFeatures'\n\nexport interface RepeatCall {\n bp: number\n // TRGT's `SD`. Zero means the allele is a copy of the one the reads did\n // support, so its length states nothing about a second haplotype; absent\n // where the genotyper writes no such field.\n spanningReads?: number\n // the PanSN haplotype a phased genotype puts this allele on\n haplotype?: number\n}\n\n// A tandem repeat array as the walk rows need it: its span on the reference,\n// which is what the bars measure between, and its unit length, which is what\n// they tile by. Read off whatever repeat annotation the session has, since the\n// tools all state the same two facts under different names: VCF 4.5's\n// `<CNV:TR>` allele gives `RUL` and `RUS` (one entry per repeat sequence,\n// grouped by `RN`), UCSC simpleRepeat and TRF give `period` and the consensus\n// `sequence`, TRGT gives `MOTIFS` and `TRID`, ExpansionHunter `RU` and `REPID`,\n// HipSTR and GangSTR `PERIOD`, vamos its `motifs`. A VCF record's INFO is\n// searched as well as its top level, and a list's first entry is the unit the\n// bars tile by: for a compound array that is the first repeat sequence, which\n// is the expanding one at every such locus in the common catalogues.\nexport interface RepeatArray {\n key: string\n name: string\n refName: string\n start: number\n end: number\n unit: number\n motif?: string\n // Each sample's genotyped alleles, from a genotyper's per-sample `AL`\n // (TRGT) or a genotype over VCF 4.5 <CNV:TR> alleles; absent from a\n // catalogue.\n calls?: Record<string, RepeatCall[]>\n}\n\nexport const REPEAT_ADAPTER_TYPES = new Set([\n 'BedAdapter',\n 'BedTabixAdapter',\n 'BigBedAdapter',\n 'VcfAdapter',\n 'VcfTabixAdapter',\n])\n\nexport const REPEAT_TRACK_HINT =\n /repeat|tandem|\\bstr\\b|vntr|trf|trgt|vamos|expansion|microsat/i\n\nexport function pickRepeatTrack<T extends TrackChoice>(\n tracks: T[],\n named: string,\n) {\n const chosen = named ? namedTrack(tracks, named) : undefined\n if (chosen) {\n return chosen\n }\n const candidates = tracks.filter(t => REPEAT_ADAPTER_TYPES.has(t.adapterType))\n return candidates.find(t => REPEAT_TRACK_HINT.test(trackLabel(t)))\n}\n\n// A TRGT repeat catalogue is a BED whose name column packs the record:\n// `ID=HTT;MOTIFS=CAG,CCG;STRUC=(CAG)nCAACAG(CCG)n`. Read as fields when it\n// has that shape.\nconst PACKED_NAME = /^\\w+=[^;]*(;\\w+=[^;]*)*$/\n\nfunction packedName(f: FeatureLike) {\n const name = ownField(f, 'name')\n if (typeof name !== 'string' || !PACKED_NAME.test(name)) {\n return undefined\n }\n return Object.fromEntries(\n name.split(';').map(pair => {\n const i = pair.indexOf('=')\n return [pair.slice(0, i), pair.slice(i + 1)]\n }),\n )\n}\n\n// A field at the feature's top level, in a VCF record's INFO, or in a packed\n// name column, in that order.\nfunction field(f: FeatureLike, name: string): unknown {\n const top = ownField(f, name)\n if (top !== undefined) {\n return top\n }\n const info = ownField(f, 'INFO') as Record<string, unknown> | undefined\n return info?.[name] ?? packedName(f)?.[name]\n}\n\nconst MOTIF_FIELDS = [\n 'RUS',\n 'MOTIFS',\n 'RU',\n 'motifs',\n 'motif',\n 'sequence',\n 'consensus',\n]\nconst PERIOD_FIELDS = [\n 'RUL',\n 'period',\n 'PERIOD',\n 'consensusSize',\n 'unit',\n 'unitLength',\n]\nconst NAME_FIELDS = ['TRID', 'REPID', 'VARID', 'ID', 'name', 'id']\n\n// The first entry of a list-valued field, whether it arrived parsed or as\n// the comma-joined text a VCF INFO or a BED column holds; VCF's missing \".\"\n// counts as absent.\nfunction first(f: FeatureLike, names: string[]) {\n for (const name of names) {\n const value = field(f, name)\n const one = String((Array.isArray(value) ? value[0] : value) ?? '')\n .split(',')[0]!\n .trim()\n if (one !== '' && one !== '.') {\n return one\n }\n }\n return undefined\n}\n\nconst IUPAC = /^[ACGTURYSWKMBDHVN]+$/i\n\n// The unit in bp: a stated period, else the length of the first motif.\nexport function repeatUnitOf(f: FeatureLike) {\n const period = Number(first(f, PERIOD_FIELDS))\n if (Number.isFinite(period) && period > 0) {\n return Math.round(period)\n }\n const motif = first(f, MOTIF_FIELDS)\n return motif && IUPAC.test(motif) ? motif.length : undefined\n}\n\n// A per-sample list field, parsed or as the comma-joined text a VCF column\n// holds. A missing entry stays missing: read as 0, an absent `SD` would make\n// every allele of every genotyper that writes no such field unspanned.\nfunction numbers(value: unknown) {\n const raw: unknown[] = Array.isArray(value)\n ? value\n : String(value ?? '').split(',')\n return raw.map(one => {\n const n =\n one === '' || one === null || one === undefined ? NaN : Number(one)\n return Number.isFinite(n) ? n : undefined\n })\n}\n\nfunction strings(value: unknown) {\n const raw: unknown[] = Array.isArray(value)\n ? value\n : String(value ?? '').split(',')\n return raw.map(one => {\n const text = String(one ?? '').trim()\n return text === '' || text === '.' ? undefined : text\n })\n}\n\nconst TANDEM_REPEAT = '<CNV:TR>'\n\n// Each ALT allele's length, off VCF 4.5's flattened list-of-lists: RN says how\n// many RUS/RUL/RUC/RB entries each allele takes, and the allele's bases are\n// its runs' RB, or unit length times count where RB is missing. An allele that\n// is not <CNV:TR>, or has a run stating neither, has none.\nfunction tandemAlleleBp(f: FeatureLike) {\n const alts = strings(ownField(f, 'ALT'))\n if (!alts.includes(TANDEM_REPEAT)) {\n return undefined\n }\n const rn = numbers(field(f, 'RN'))\n const rus = strings(field(f, 'RUS'))\n const rul = numbers(field(f, 'RUL'))\n const ruc = numbers(field(f, 'RUC'))\n const rb = numbers(field(f, 'RB'))\n let k = 0\n return alts.map((alt, i) => {\n const n = rn[i] ?? (alt === TANDEM_REPEAT ? 1 : 0)\n let bp = 0\n let known = 0\n for (let j = 0; j < n; j++, k++) {\n const motif = rus[k]\n const unitLength =\n rul[k] ?? (motif && IUPAC.test(motif) ? motif.length : undefined)\n const count = ruc[k]\n const runBp =\n rb[k] ??\n (unitLength && count !== undefined\n ? Math.round(unitLength * count)\n : undefined)\n if (runBp !== undefined) {\n bp += runBp\n known++\n }\n }\n return alt === TANDEM_REPEAT && n > 0 && known === n ? bp : undefined\n })\n}\n\n// A sample's alleles through its genotype: 0 is the reference's, an index\n// past it the ALT allele's. A phased genotype's k-th allele is PanSN\n// haplotype k, the order vg deconstruct writes an assembly's haplotypes in.\nfunction genotyped(\n gt: string | undefined,\n alleleBp: (number | undefined)[],\n referenceBp: number,\n) {\n const phased = gt?.includes('|')\n return (gt ?? '').split(/[/|]/).flatMap((index, k): RepeatCall[] => {\n const i = index === '' ? NaN : Number(index)\n const bp = i > 0 ? alleleBp[i - 1] : referenceBp\n if (!Number.isInteger(i) || bp === undefined) {\n return []\n }\n return [{ bp, ...(phased ? { haplotype: k + 1 } : {}) }]\n })\n}\n\nfunction callsOf(\n f: FeatureLike,\n alleleBp: (number | undefined)[] | undefined,\n referenceBp: number,\n) {\n const samples = ownField(f, 'samples') as\n Record<string, Record<string, unknown>> | undefined\n const called: Record<string, RepeatCall[]> = {}\n for (const [sample, fields] of Object.entries(samples ?? {})) {\n const reads = numbers(fields.SD)\n const lengths = numbers(fields.AL).flatMap((bp, i) =>\n bp !== undefined && bp > 0\n ? [reads[i] === undefined ? { bp } : { bp, spanningReads: reads[i] }]\n : [],\n )\n const calls =\n lengths.length > 0 || !alleleBp\n ? lengths\n : genotyped(strings(fields.GT)[0], alleleBp, referenceBp)\n if (calls.length > 0) {\n called[sample] = calls\n }\n }\n return Object.keys(called).length > 0 ? called : undefined\n}\n\n// A <CNV:TR> record's POS is the base before the array and SVLEN the\n// reference allele's length, while a VCF feature starts at that padding base.\nfunction spanOf(f: FeatureLike, tandem: boolean) {\n const start = field(f, 'start') as number\n const end = field(f, 'end') as number\n const svlen = numbers(field(f, 'SVLEN'))[0]\n return tandem && svlen !== undefined\n ? { start: start + 1, end: start + 1 + svlen }\n : { start, end }\n}\n\nexport function repeatArraysFrom(features: FeatureLike[]): RepeatArray[] {\n const arrays: RepeatArray[] = []\n const onSpan = new Map<string, number>()\n for (const f of features) {\n const alleleBp = tandemAlleleBp(f)\n const { start, end } = spanOf(f, alleleBp !== undefined)\n const unit = repeatUnitOf(f)\n if (!(end > start) || unit === undefined) {\n continue\n }\n const refName = field(f, 'refName') as string\n const motif = first(f, MOTIF_FIELDS)\n const stated = first(f, NAME_FIELDS)\n const span = `${refName}:${start}-${end}`\n const nth = (onSpan.get(span) ?? 0) + 1\n onSpan.set(span, nth)\n arrays.push({\n key: nth === 1 ? span : `${span} #${nth}`,\n name:\n (stated && !PACKED_NAME.test(stated) ? stated : undefined) ??\n (motif && motif.length <= 12\n ? `(${motif})n`\n : `${refName}:${(start + 1).toLocaleString('en-US')}-${end.toLocaleString('en-US')}`),\n refName,\n start,\n end,\n unit,\n motif,\n calls: callsOf(f, alleleBp, end - start),\n })\n }\n return arrays.sort((a, b) => a.start - b.start)\n}\n", "// src/genes/geneFiles.ts\nvar GENE_TYPE = /(gene|gene_segment|RNA|transcript)$/i;\nvar isGene = (type) => GENE_TYPE.test(type) || type === \"CDS\" || type === \"exon\";\nfunction mergedIntervals(intervals) {\n const out = [];\n for (const iv of [...intervals].sort((a, b) => a.start - b.start)) {\n const last = out.at(-1);\n if (last && iv.start <= last.end) {\n last.end = Math.max(last.end, iv.end);\n } else {\n out.push({ ...iv });\n }\n }\n return out;\n}\nfunction strandOf(s) {\n return s === \"+\" ? 1 : s === \"-\" ? -1 : 0;\n}\nfunction unescape(value) {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\nfunction attributes(column) {\n const out = /* @__PURE__ */ new Map();\n for (const pair of column.split(\";\")) {\n const eq = pair.indexOf(\"=\");\n if (eq > 0) {\n out.set(pair.slice(0, eq).trim(), unescape(pair.slice(eq + 1).trim()));\n }\n }\n return out;\n}\nfunction gff3Row(line) {\n const cols = line.split(\"\t\");\n const start = Number(cols[3]);\n const end = Number(cols[4]);\n if (cols.length < 9 || !Number.isInteger(start) || !Number.isInteger(end)) {\n return void 0;\n }\n return {\n refName: cols[0],\n type: cols[2],\n start: start - 1,\n end,\n strand: strandOf(cols[6]),\n attrs: attributes(cols[8])\n };\n}\nfunction genesFromGff3Lines(lines) {\n const rows = [];\n for (const line of lines) {\n if (line.startsWith(\"##FASTA\")) {\n break;\n }\n const row = line.startsWith(\"#\") ? void 0 : gff3Row(line);\n if (row) {\n rows.push(row);\n }\n }\n const parentOf = /* @__PURE__ */ new Map();\n for (const { attrs } of rows) {\n const id = attrs.get(\"ID\");\n const parent = attrs.get(\"Parent\")?.split(\",\")[0];\n if (id && parent) {\n parentOf.set(id, parent);\n }\n }\n const rootOf = (row) => {\n let id = row.attrs.get(\"Parent\")?.split(\",\")[0] ?? row.attrs.get(\"ID\");\n if (!id) {\n return row.attrs.get(\"gene_id\");\n }\n const seen = /* @__PURE__ */ new Set();\n while (id && parentOf.has(id) && !seen.has(id)) {\n seen.add(id);\n id = parentOf.get(id);\n }\n return id;\n };\n const groups = /* @__PURE__ */ new Map();\n rows.forEach((row, i) => {\n const root = rootOf(row) ?? `#${i}`;\n const key = `${row.refName}\t${root}`;\n const group = groups.get(key) ?? groups.set(key, { rows: [] }).get(key);\n group.rows.push(row);\n if (!row.attrs.has(\"Parent\") && !group.top) {\n group.top = row;\n }\n });\n const genes = [];\n for (const [key, { top, rows: members }] of groups) {\n if (top && !isGene(top.type)) {\n continue;\n }\n const first = top ?? members[0];\n const start = top?.start ?? members.reduce((least, r) => Math.min(least, r.start), Infinity);\n const end = top?.end ?? members.reduce((most, r) => Math.max(most, r.end), -Infinity);\n const a = first.attrs;\n const spans = (type) => members.filter((r) => r.type === type).map((r) => ({ start: r.start, end: r.end }));\n const exons = spans(\"exon\");\n const coding = spans(\"CDS\");\n const transcribed = members.some(\n (r) => r !== top && r.type !== \"exon\" && r.type !== \"CDS\"\n );\n genes.push({\n name: a.get(\"Name\") ?? a.get(\"gene_name\") ?? a.get(\"gene\") ?? a.get(\"gene_id\") ?? key.split(\"\t\")[1],\n refName: first.refName,\n start,\n end,\n strand: first.strand,\n // A range read holds only the rows over its window, so a gene with\n // transcripts but no exon or CDS there is intronic in it. Only a gene\n // with no transcripts, as a bacterium's gene and CDS, is one exon.\n exons: exons.length ? mergedIntervals(exons) : transcribed ? mergedIntervals(coding) : [{ start, end }]\n });\n }\n return genes;\n}\nfunction mergeOverlappingByName(genes) {\n const out = [];\n const open = /* @__PURE__ */ new Map();\n for (const g of [...genes].sort((a, b) => a.start - b.start)) {\n const key = `${g.refName}\t${g.strand}\t${g.name}`;\n const last = open.get(key);\n if (last && g.start < last.end) {\n last.end = Math.max(last.end, g.end);\n last.exons = mergedIntervals([...last.exons, ...g.exons]);\n } else {\n const gene = { ...g, exons: mergedIntervals(g.exons) };\n out.push(gene);\n open.set(key, gene);\n }\n }\n return out;\n}\nvar BED_HEADER = /^(#|track\\s|browser\\s)/;\nfunction genesFromBed(text) {\n const rows = [];\n for (const line of text.split(\"\\n\")) {\n const cols = line.replace(/\\r$/, \"\").split(\"\t\");\n const start = Number(cols[1]);\n const end = Number(cols[2]);\n if (BED_HEADER.test(line) || cols.length < 3 || !Number.isInteger(start) || !(end > start)) {\n continue;\n }\n const refName = cols[0];\n const name = cols[3] && cols[3] !== \".\" ? cols[3] : `${refName}:${start + 1}-${end}`;\n const sizes = cols[10]?.split(\",\").filter((s) => s !== \"\").map(Number);\n const starts = cols[11]?.split(\",\").filter((s) => s !== \"\").map(Number);\n const blocks = sizes?.length && sizes.length === starts?.length ? sizes.map((size, i) => ({\n start: start + starts[i],\n end: start + starts[i] + size\n })) : [{ start, end }];\n rows.push({\n name,\n refName,\n start,\n end,\n strand: strandOf(cols[5]),\n exons: blocks\n });\n }\n return mergeOverlappingByName(rows);\n}\nfunction sniffedFormat(text) {\n const first = text.split(\"\\n\", 1e3).find((l) => l.trim() !== \"\" && !BED_HEADER.test(l));\n const cols = first?.split(\"\t\") ?? [];\n return /^\\d+$/.test(cols[1] ?? \"\") && /^\\d+$/.test(cols[2] ?? \"\") ? \"bed\" : \"gff3\";\n}\nfunction genesFromText(text, format = sniffedFormat(text)) {\n return format === \"bed\" ? genesFromBed(text) : genesFromGff3Lines(text.split(/\\r?\\n/));\n}\n\nexport {\n mergedIntervals,\n genesFromGff3Lines,\n mergeOverlappingByName,\n genesFromBed,\n genesFromText\n};\n", "const host = JBrowseExports[\"@jbrowse/core/configuration\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/configuration\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const ConfigurationReference = /* @__PURE__ */ read(\"ConfigurationReference\")\nexport const ConfigurationSchema = /* @__PURE__ */ read(\"ConfigurationSchema\")\nexport const ConfigurationSchemaUnion = /* @__PURE__ */ read(\"ConfigurationSchemaUnion\")\nexport const DEFAULT_FORMAT_DETAILS_DEPTH = /* @__PURE__ */ read(\"DEFAULT_FORMAT_DETAILS_DEPTH\")\nexport const FormatAboutConfigSchemaFactory = /* @__PURE__ */ read(\"FormatAboutConfigSchemaFactory\")\nexport const FormatDetailsConfigSchemaFactory = /* @__PURE__ */ read(\"FormatDetailsConfigSchemaFactory\")\nexport const applyConfSettings = /* @__PURE__ */ read(\"applyConfSettings\")\nexport const applyRetiredSpellings = /* @__PURE__ */ read(\"applyRetiredSpellings\")\nexport const arraySlotUnion = /* @__PURE__ */ read(\"arraySlotUnion\")\nexport const bamIndexFields = /* @__PURE__ */ read(\"bamIndexFields\")\nexport const bamIndexSchema = /* @__PURE__ */ read(\"bamIndexSchema\")\nexport const canonicalSpelling = /* @__PURE__ */ read(\"canonicalSpelling\")\nexport const changesKeyedField = /* @__PURE__ */ read(\"changesKeyedField\")\nexport const declaredSnapshot = /* @__PURE__ */ read(\"declaredSnapshot\")\nexport const evaluateForFeature = /* @__PURE__ */ read(\"evaluateForFeature\")\nexport const evaluateJexl = /* @__PURE__ */ read(\"evaluateJexl\")\nexport const expandTabixShorthand = /* @__PURE__ */ read(\"expandTabixShorthand\")\nexport const expandUriShorthand = /* @__PURE__ */ read(\"expandUriShorthand\")\nexport const fillIndexType = /* @__PURE__ */ read(\"fillIndexType\")\nexport const fillLocations = /* @__PURE__ */ read(\"fillLocations\")\nexport const fullConfSnapshot = /* @__PURE__ */ read(\"fullConfSnapshot\")\nexport const getConf = /* @__PURE__ */ read(\"getConf\")\nexport const getConfigurationSchemaDefinition = /* @__PURE__ */ read(\"getConfigurationSchemaDefinition\")\nexport const getConfigurationSchemaMetadata = /* @__PURE__ */ read(\"getConfigurationSchemaMetadata\")\nexport const getConfigurationSchemaUnion = /* @__PURE__ */ read(\"getConfigurationSchemaUnion\")\nexport const getSlotDefinition = /* @__PURE__ */ read(\"getSlotDefinition\")\nexport const getTypeNamesFromExplicitlyTypedUnion = /* @__PURE__ */ read(\"getTypeNamesFromExplicitlyTypedUnion\")\nexport const hydrateTrackConfig = /* @__PURE__ */ read(\"hydrateTrackConfig\")\nexport const indexSnapshot = /* @__PURE__ */ read(\"indexSnapshot\")\nexport const indexSuffix = /* @__PURE__ */ read(\"indexSuffix\")\nexport const isBareConfigurationSchemaType = /* @__PURE__ */ read(\"isBareConfigurationSchemaType\")\nexport const isCallbackValue = /* @__PURE__ */ read(\"isCallbackValue\")\nexport const isConfigurationModel = /* @__PURE__ */ read(\"isConfigurationModel\")\nexport const isConfigurationSchemaType = /* @__PURE__ */ read(\"isConfigurationSchemaType\")\nexport const isConfigurationSlot = /* @__PURE__ */ read(\"isConfigurationSlot\")\nexport const isConstantEntry = /* @__PURE__ */ read(\"isConstantEntry\")\nexport const isCsiLocation = /* @__PURE__ */ read(\"isCsiLocation\")\nexport const isKeyedWrites = /* @__PURE__ */ read(\"isKeyedWrites\")\nexport const isSlotDefinitionEntry = /* @__PURE__ */ read(\"isSlotDefinitionEntry\")\nexport const keyedBase = /* @__PURE__ */ read(\"keyedBase\")\nexport const keyedWritesAt = /* @__PURE__ */ read(\"keyedWritesAt\")\nexport const liftPlot = /* @__PURE__ */ read(\"liftPlot\")\nexport const liftRetiredSpellings = /* @__PURE__ */ read(\"liftRetiredSpellings\")\nexport const makeSlotFacade = /* @__PURE__ */ read(\"makeSlotFacade\")\nexport const mergeConfSettings = /* @__PURE__ */ read(\"mergeConfSettings\")\nexport const mergeFormatCallbacks = /* @__PURE__ */ read(\"mergeFormatCallbacks\")\nexport const parsePlot = /* @__PURE__ */ read(\"parsePlot\")\nexport const partitionAdvanced = /* @__PURE__ */ read(\"partitionAdvanced\")\nexport const plotKeysOf = /* @__PURE__ */ read(\"plotKeysOf\")\nexport const plotList = /* @__PURE__ */ read(\"plotList\")\nexport const plotOf = /* @__PURE__ */ read(\"plotOf\")\nexport const plotWrites = /* @__PURE__ */ read(\"plotWrites\")\nexport const preProcessConfigSnapshot = /* @__PURE__ */ read(\"preProcessConfigSnapshot\")\nexport const preProcessSnapshotWith = /* @__PURE__ */ read(\"preProcessSnapshotWith\")\nexport const readConfObject = /* @__PURE__ */ read(\"readConfObject\")\nexport const readConfigValue = /* @__PURE__ */ read(\"readConfigValue\")\nexport const refuseOnWrite = /* @__PURE__ */ read(\"refuseOnWrite\")\nexport const refusingUndeclaredKeys = /* @__PURE__ */ read(\"refusingUndeclaredKeys\")\nexport const requestedIndexType = /* @__PURE__ */ read(\"requestedIndexType\")\nexport const requirementProblems = /* @__PURE__ */ read(\"requirementProblems\")\nexport const setConf = /* @__PURE__ */ read(\"setConf\")\nexport const shorthandTargets = /* @__PURE__ */ read(\"shorthandTargets\")\nexport const shorthandTargetsOf = /* @__PURE__ */ read(\"shorthandTargetsOf\")\nexport const slotChoices = /* @__PURE__ */ read(\"slotChoices\")\nexport const slotValueRefusal = /* @__PURE__ */ read(\"slotValueRefusal\")\nexport const staleKeyedMembers = /* @__PURE__ */ read(\"staleKeyedMembers\")\nexport const tabixIndexFields = /* @__PURE__ */ read(\"tabixIndexFields\")\nexport const tabixIndexSchema = /* @__PURE__ */ read(\"tabixIndexSchema\")\nexport const tabixIndexSnapshot = /* @__PURE__ */ read(\"tabixIndexSnapshot\")\nexport const toCallbackValue = /* @__PURE__ */ read(\"toCallbackValue\")\nexport const toFixedValue = /* @__PURE__ */ read(\"toFixedValue\")\nexport const writesWholeAt = /* @__PURE__ */ read(\"writesWholeAt\")\nexport default host && host.__esModule ? host.default : host", "import {\n mergeOverlappingByName,\n mergedIntervals,\n} from '@jbrowse/bandage-core/genes/geneFiles'\nimport { readConfObject } from '@jbrowse/core/configuration'\n\nimport { REPEAT_TRACK_HINT } from '../repeats/repeatFeatures'\nimport { namedTrack, ownField, trackLabel } from '../trackFeatures'\n\nimport type { FeatureLike, TrackChoice } from '../trackFeatures'\nimport type { GeneModel } from '@jbrowse/bandage-core/genes/genePins'\nimport type { AnyConfigurationModel } from '@jbrowse/core/configuration'\n\n// The adapters whose tracks hold gene models, in the order the session's\n// tracks are searched when no track is named.\nexport const GENE_ADAPTER_TYPES = new Set([\n 'Gff3TabixAdapter',\n 'Gff3Adapter',\n 'BedTabixAdapter',\n 'BedAdapter',\n 'GtfTabixAdapter',\n 'GtfAdapter',\n 'BigBedAdapter',\n 'NCListAdapter',\n])\n\nconst GENE_TRACK_HINT = /gene|refseq|gencode|ensembl|annotation/i\n\n// A BED track is as often peaks or repeats as genes, so one counts only where\n// its name says it is annotation\nconst BED_ADAPTER_TYPES = new Set(['BedTabixAdapter', 'BedAdapter'])\n\n// Which of the session's tracks to read genes from: the named one while the\n// assembly has it (a saved pick can name a track since removed), else the\n// first gene-bearing track on the assembly whose name says it is annotation,\n// else the first non-BED gene-bearing track. A track whose name says repeats is\n// never picked unnamed, as \"RepeatMasker annotation\" would be.\nexport function pickGeneTrack<T extends TrackChoice>(\n tracks: T[],\n named: string,\n) {\n const chosen = named ? namedTrack(tracks, named) : undefined\n if (chosen) {\n return chosen\n }\n const candidates = tracks.filter(\n t =>\n GENE_ADAPTER_TYPES.has(t.adapterType) &&\n !REPEAT_TRACK_HINT.test(trackLabel(t)),\n )\n return (\n candidates.find(t => GENE_TRACK_HINT.test(trackLabel(t))) ??\n candidates.find(t => !BED_ADAPTER_TYPES.has(t.adapterType))\n )\n}\n\nconst TE_TRACK_HINT = /\\bTEs?\\b|transpos/i\n\n// What a walk row's boxes are, for the key: TEs where the annotation track's\n// name says so, else genes\nexport function annotationNoun(track: TrackChoice | undefined) {\n return track && TE_TRACK_HINT.test(trackLabel(track)) ? 'TE' : 'gene'\n}\n\ninterface LaneView {\n tracks?: readonly {\n configuration: AnyConfigurationModel\n displays: readonly { configuration: AnyConfigurationModel }[]\n }[]\n}\n\n// The `filter` of the gene track's lane in the view the graph is drawn in, so\n// the chips name what the lane draws. None where the view shows no such lane,\n// or has no tracks, as a graph genome view of its own.\nexport function laneFilters(view: object, trackId: string | undefined) {\n const lane = (view as LaneView).tracks?.find(\n t => readConfObject(t.configuration, 'trackId') === trackId,\n )?.displays[0]\n return lane\n ? ((readConfObject(lane.configuration, 'filter') as string[] | undefined) ??\n [])\n : []\n}\n\n// Records spanning a whole sequence, the types the GFF3 adapter declines to\n// widen a fetch for. RefSeq opens every molecule with a `region` named\n// ANONYMOUS.\nconst WHOLE_SEQUENCE_TYPES = new Set([\n 'chromosome',\n 'region',\n 'contig',\n 'supercontig',\n 'scaffold',\n])\n\n// JBrowse's BED parser splits a coding BED12 block into CDS and UTR parts and\n// keeps `exon` for non-coding ones, so all of them are exon\nconst EXON_PARTS = new Set([\n 'exon',\n 'CDS',\n 'five_prime_UTR',\n 'three_prime_UTR',\n 'UTR',\n])\n\nfunction exonsOf(f: FeatureLike, into: { start: number; end: number }[]) {\n const type = ownField(f, 'type')\n if (typeof type === 'string' && EXON_PARTS.has(type)) {\n into.push({\n start: ownField(f, 'start') as number,\n end: ownField(f, 'end') as number,\n })\n }\n const children = ownField(f, 'subfeatures') as FeatureLike[] | undefined\n for (const child of children ?? []) {\n exonsOf(child, into)\n }\n}\n\n// Genes from a track's features: every top-level feature but a whole-sequence\n// record, named by the first of gene_name, name, gene and gene_id it carries,\n// with the exons found anywhere under it merged. A feature with no exons is one exon,\n// its whole span. A BED track gives one feature per transcript, so a name's\n// overlapping features merge, while its copies down the contig stay apart.\n// UCSC's ncbiRefSeq.gff gene records carry their symbol only as gene_id. A\n// feature with none of those names is left out: its raw ID, RefSeq's\n// `id-NC_000913.3:1978503..1979270`, only restates where it is.\nexport function geneModelsFrom(features: FeatureLike[]): GeneModel[] {\n const genes: GeneModel[] = []\n for (const f of features) {\n const name =\n (ownField(f, 'gene_name') as string | undefined) ??\n (ownField(f, 'name') as string | undefined) ??\n (ownField(f, 'gene') as string | undefined) ??\n (ownField(f, 'gene_id') as string | undefined)\n const start = ownField(f, 'start') as number\n const end = ownField(f, 'end') as number\n if (\n !name ||\n !(end > start) ||\n WHOLE_SEQUENCE_TYPES.has(ownField(f, 'type') as string)\n ) {\n continue\n }\n const exons: { start: number; end: number }[] = []\n exonsOf(f, exons)\n genes.push({\n name,\n refName: ownField(f, 'refName') as string,\n start,\n end,\n strand: (ownField(f, 'strand') as number | undefined) ?? 0,\n exons: exons.length ? mergedIntervals(exons) : [{ start, end }],\n })\n }\n return mergeOverlappingByName(genes)\n}\n", "const host = JBrowseExports[\"tss-react/mui\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"tss-react/mui\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host"],
|
|
5
|
+
"mappings": "8FASA,IAAIA,EAAO,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AC,EACA,QAASN,EAASH,EAAG,SAAS,EAC9B,MAAAU,EACA,IAAAC,EACA,OAASR,EAASH,EAAG,QAAQ,GAA4B,EACzD,MAAOY,EAAM,OAASC,EAAgBD,CAAK,EAAI,CAAC,CAAE,MAAAF,EAAO,IAAAC,CAAI,CAAC,CAChE,CAAC,CACH,CACA,OAAOG,EAAuBN,CAAK,CACrC,CC5JA,IAAMO,EAAO,eAAe,eAAe,EACrCC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MAAM,kCAAoCA,EAAO,+HAA8I,CAC3M,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAGC,IAAMC,GAA6BC,GAAK,YAAY,EACpDC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA",
|
|
6
|
+
"names": ["flip", "readingsAgainstIds", "request", "node", "isBackbone", "drawnAlongStable", "ownStrand", "readAlongReference", "readAs", "givenAs", "id", "reading", "lines", "edge", "line", "given", "cached", "loadFmmm", "mod", "fmmmLayout", "request", "loadFmmm", "LAYOUT_ENGINES", "LAYOUT_ENGINE_VALUES", "stressAlongReference", "request", "read", "readAlongReference", "result", "stressLayout", "layoutEngine", "start", "fmmmLayout", "ownField", "f", "name", "namedTrack", "tracks", "named", "t", "trackLabel", "REPEAT_ADAPTER_TYPES", "REPEAT_TRACK_HINT", "pickRepeatTrack", "tracks", "named", "chosen", "namedTrack", "t", "trackLabel", "PACKED_NAME", "packedName", "f", "name", "ownField", "pair", "i", "field", "top", "MOTIF_FIELDS", "PERIOD_FIELDS", "NAME_FIELDS", "first", "names", "value", "one", "IUPAC", "repeatUnitOf", "period", "motif", "numbers", "n", "strings", "text", "TANDEM_REPEAT", "tandemAlleleBp", "alts", "rn", "rus", "rul", "ruc", "rb", "k", "alt", "bp", "known", "j", "unitLength", "count", "runBp", "genotyped", "gt", "alleleBp", "referenceBp", "phased", "index", "callsOf", "samples", "called", "sample", "fields", "reads", "lengths", "calls", "spanOf", "tandem", "start", "end", "svlen", "repeatArraysFrom", "features", "arrays", "onSpan", "unit", "refName", "stated", "span", "nth", "a", "b", "mergedIntervals", "intervals", "out", "iv", "a", "b", "last", "mergeOverlappingByName", "genes", "out", "open", "g", "a", "b", "key", "last", "mergedIntervals", "gene", "host", "read", "name", "ConfigurationReference", "ConfigurationSchema", "getConf", "read", "readConfObject", "read", "setConf", "read", "configuration_default", "host", "GENE_ADAPTER_TYPES", "GENE_TRACK_HINT", "BED_ADAPTER_TYPES", "pickGeneTrack", "tracks", "named", "chosen", "namedTrack", "candidates", "t", "REPEAT_TRACK_HINT", "trackLabel", "TE_TRACK_HINT", "annotationNoun", "track", "laneFilters", "view", "trackId", "lane", "readConfObject", "WHOLE_SEQUENCE_TYPES", "EXON_PARTS", "exonsOf", "f", "into", "type", "ownField", "children", "child", "geneModelsFrom", "features", "genes", "name", "start", "end", "exons", "mergedIntervals", "mergeOverlappingByName", "host", "read", "name", "makeStyles", "read", "mui_default", "host"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as W,b as gt}from"./chunk-OJTJROER.js";import{A as Nt,B as X,C as re,D as _t,E as K,F as ve,G as ae,a as yt,b as bt,c as vt,d as wt,f as St,g as xt,h as D,i as kt,j as Pt,k as Mt,m as Rt,n as Ct,o as be,p as Lt,q as It,r as Et,s as Gt,t as Tt,v as oe,x as Ht,z as At}from"./chunk-GU6ICSQY.js";import{$ as ye,B as nt,C as at,E as it,F as st,G as lt,H as ct,I as pt,J as ut,X as ft,Y as ht,a as M,ba as mt,c as $e,f as qe,g as Je,p as tt}from"./chunk-XTJFDEHU.js";import{q as H}from"./chunk-26KRYRPL.js";import{$b as _,Ba as ge,Gb as ne,Ha as te,J as me,La as Ke,Na as je,Ob as $,Pb as Qe,Qb as et,Rb as ot,S as Ve,Sb as rt,Ya as Ue,Z as Ye,a as Y,b as Ie,d as Ee,ea as Ze,ed as dt}from"./chunk-YZY2352T.js";import{x as Fe}from"./chunk-IH6G574V.js";import{M as fe,Q as he}from"./chunk-BYY3V7KM.js";import{c as Ce}from"./chunk-P24MAMZH.js";import{w as Re}from"./chunk-JCKDLTK6.js";import{d as I}from"./chunk-WKD7ALOU.js";import{C as Le}from"./chunk-TQZH7NNB.js";import{j as J}from"./chunk-5L276I7O.js";import{a as We,e as G,f as De,g as Xe,h as C,i as L}from"./chunk-J2PN6CG3.js";import{A as Be,E as Oe,H as ee,I as Z,b as O,c as Ge,e as de,k as Te,o as He,p as Ae,t as Ne,w as Q,x as _e,z as ze}from"./chunk-H42TSPVA.js";import{a as k,b as n,c as f,d}from"./chunk-DUU6T2I5.js";function zt(t){return Promise.resolve(new _(t))}var z=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],En=t=>z!=null&&t in Object(z)?z[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/render-core/useRenderingBackend' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Bt=En("useRenderingBackend"),Fo=z&&z.__esModule?z.default:z;var we=bt(1),Ot=d(function({model:e}){let[o,a]=L(null);return G(()=>{if(!o)return;let r=new _(o),c=Y(()=>{Ue(dt()),r.resize(e.paneWidth,e.canvasHeight),e.paintHover(r,e.drawnBatch)});return()=>{c(),r.dispose()}},[o,e]),n("canvas",{ref:a,"data-testid":"graph-hover-layer",style:{...we,clipPath:e.drawingClip}})});var ie=d(function({row:e,at:o,hint:a,after:r,column:c}){let l=c===void 0?void 0:{paddingLeft:c+5};return e.swatch?f("div",{title:[e.title,a].filter(Boolean).join(" \xB7 ")||void 0,children:[f("div",{style:re,children:[n("span",{style:{display:"flex",flex:"none",justifyContent:"center",width:c},children:n(oe,{swatch:e.swatch})}),f("span",{children:[e.strong?n("strong",{children:e.strong}):null,e.label]}),e.sizer===void 0?null:f("span",{style:Gn,children:[n("span",{style:Tn,"aria-hidden":!0,"data-testid":"graph-key-sizer",children:be(e.sizer)}),n("span",{style:Hn,"data-testid":"graph-key-count",children:be(e.count)})]}),r]}),o?n("div",{style:l,"data-testid":"graph-walk-at",children:o}):e.under?n("div",{style:l,children:e.under}):null]}):n("div",{style:_t,children:e.label})}),Gn={display:"grid"},Tn={gridArea:"1 / 1",visibility:"hidden"},Hn={gridArea:"1 / 1",width:0,minWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},An={pointerEvents:"auto",cursor:"pointer",border:"none",background:"none",padding:"0 2px",font:"inherit",textDecoration:"underline"},Wt=d(function({model:e,sections:o}){if(o.length===0)return null;let a=o.flatMap(l=>l.rows),r=Ct(a),c=Rt(a);return n("div",{style:{...X,lineHeight:`${r}px`},children:o.map(({testid:l,rows:p,heading:s,spaced:u},m)=>f(We,{children:[s?n("div",{style:{...ae,paddingTop:m===0?0:ve},children:s}):null,n("div",{"data-testid":l,style:u?{paddingTop:ve}:void 0,children:p.map(g=>n(ie,{row:g,column:c,at:g.walk?e.hoveredOn(g.walk):void 0,after:g.closesBubble?n("button",{type:"button",style:An,"data-testid":"graph-close-bubble",onClick:()=>{e.closeBubbles()},children:"close"}):null},g.key))})]},l))})});var Nn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:ot,lineHeight:"normal"},_n={height:rt,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},zn={position:"relative"},Bn={gridColumn:"1 / -1",height:ht,padding:"2px 6px",boxSizing:"border-box",display:"flex",gap:14,fontSize:11,lineHeight:"15px"},On=d(function({model:e,lift:o,index:a,width:r,height:c,cell:l,handlers:p,canvasStyle:s}){let[u,m]=L(null),[g,S]=L(null),E=o.walks[0];G(()=>{if(!u||!g)return;let N=new _(u),B=new _(g),U=Ie(()=>e.facetDrawings?.[a]),F,V=[Y(()=>{let R=e.facetGrid;R&&N.resize(R.width,R.height);let T=U.get();T&&(T!==F&&(N.uploadGeometry(T.batch),F=T),e.applySelection(N),e.paint(N))}),Y(()=>{let R=e.facetGrid;R&&B.resize(R.width,R.height);let T=U.get();T&&e.paintHover(B,T.batch)})];return()=>{for(let R of V)R();N.dispose(),B.dispose()}},[u,g,e,a]);let A=e.walkLabel(E.name);return f("div",{style:l,children:[n("button",{type:"button",style:_n,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([E.name]),e.setFacet("")},children:n(ie,{row:It(e,E),hint:`click to lift ${A} alone`,at:e.hoveredOn(E)})}),f("div",{style:zn,children:[n("canvas",{ref:m,"data-testid":"graph-facet-canvas",style:{...s,width:r,height:c,display:"block"},...p}),n("canvas",{ref:S,style:we})]})]})}),Wn=d(function({model:e,handlers:o,canvasStyle:a}){let r=e.facetPanels,c=e.facetGrid,l=e.facetPlacement;if(!r||!c||!l)return null;let{columns:p,width:s,height:u}=c;return f("div",{"data-testid":"graph-facet-panels",style:{...Nn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${p}, ${s}px)`,background:te},children:[r.map((m,g)=>n(On,{model:e,lift:m,index:g,width:s,height:u,cell:{gridRow:Math.floor(l.cells[g]/p)+1,gridColumn:l.cells[g]%p+1},handlers:o,canvasStyle:a},m.walks[0].name)),n("div",{style:{...Bn,gridRow:Math.floor(l.cells.reduce((m,g)=>Math.max(m,g),-1/0)/p)+2},"data-testid":"graph-facet-key",children:Et(e).map(m=>n(ie,{row:m},m.key))})]})}),Dt=Wn;var Xt=M(n("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2m2 10H3v4c0 1.1.9 2 2 2h4v-2H5zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2"}),"CropFree");var Ft=M([n("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"},"0"),n("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var Vt=M(n("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14M7 9h5v1H7z"}),"ZoomOut");var Dn=d(function({model:e}){let o=e.colorSchemeLock;return n(W,{label:"Color",size:"small",sx:{minWidth:100},disabled:o!==void 0,title:o?.why,shown:o?.value,value:e.chosenColorScheme,options:nt.map(({value:a})=>({value:a,label:e.colorSchemeLabel(a)})),testId:"graph-color-select",onChange:a=>{e.setColorScheme(a)}})}),Yt=Dn;var Zt=H()(t=>({stats:{marginLeft:"auto"},perf:{color:t.palette.text.secondary,fontVariantNumeric:"tabular-nums"}}));function Se(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var Xn=d(function({model:e}){let{classes:o}=Zt(),{lastFetchMs:a,lastLayoutMs:r,lastGeometryMs:c}=e,l=a!==void 0||r!==void 0||c!==void 0;return e.showPerf&&l?f(Z,{variant:"caption",className:o.perf,"data-testid":"graph-perf-stats",children:["fetch ",Se(a)," \xB7 layout ",Se(r)," \xB7 geom"," ",Se(c)]}):null}),Fn=d(function({model:e}){let{classes:o}=Zt();return f("div",{className:o.stats,"data-testid":"graph-stats","data-node-count":e.nodeCount,"data-edge-count":e.edgeCount,"data-path-count":e.pathCount,"data-fetch-ms":e.lastFetchMs??"","data-layout-ms":e.lastLayoutMs??"","data-geometry-ms":e.lastGeometryMs??"","data-geometry-strokes":e.lastGeometryStrokeCount??"",children:[f(Z,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",n(Xn,{model:e})]})}),$t=Fn;var Vn=d(function({model:e}){let{graph:o}=e;return n(W,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:$e.map(({value:a,label:r,description:c,available:l})=>({value:a,label:r,description:c,disabled:o?!l(o):!1})),onChange:a=>{e.switchLayout(a)}})}),Kt=Vn;var Yn=d(function({model:e}){return e.chosenLayoutMode!=="walkrows"||e.repeatChoices.length===0?null:n(W,{label:"Repeat",size:"small",sx:{minWidth:130,maxWidth:260},testId:"graph-repeat-select",value:e.selectedRepeat?.key??"",options:e.repeatOptions,onChange:o=>{e.setRepeatKey(o)}})}),jt=Yn;var Ut=M(n("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var qt=M(n("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var Zn=d(function({model:e}){let o=e.highlightMenuItems({picks:!1});return n(O,{size:"small",tooltip:"Graph options",menuItems:[...o.length>0?[{label:"Haplotypes",icon:qe,subMenu:o}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show",icon:at,subMenu:[...e.showMenuItems(),...e.modeDrawsNodes&&e.walkChoices.length>1?[{type:"checkbox",label:"Show walk rows under the graph",checked:e.walkStrip,onClick:()=>{e.setWalkStrip(!e.walkStrip)}}]:[],{type:"checkbox",label:"Show timings",checked:e.showPerf,onClick:()=>{e.setShowPerf(!e.showPerf)}}]},{type:"divider"},{label:"Graph settings...",icon:Je,helpText:"Subgraph node limit; node width and path colors; the force-directed layout engine",onClick:()=>{J(e).queueDialog(a=>[gt,{model:e,onClose:a}])}},{type:"divider"},{label:"Close graph",icon:Ut,onClick:()=>{e.clearGraph()}}],children:n(qt,{})})}),Jt=Zn;var $n=H()({formControl:{minWidth:130,maxWidth:260}}),Kn=d(function({model:e}){let{classes:o}=$n(),a=De(),{walkChoices:r}=e;if(r.length===0||!e.liftsWalks)return null;let c=new Set(r.map(s=>s.name)),l=new Map(r.map(s=>[s.name,s.label])),p=e.walkLayers.map(s=>s.walk).filter(s=>c.has(s));return r.length>je?n(He,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{J(e).queueDialog(s=>[Ke,{model:e,onClose:s}])},children:p.length>0?`${p.length} of ${r.length} haplotypes`:"Highlight haplotypes..."}):f(Ne,{size:"small",className:o.formControl,children:[n(_e,{id:a,children:"Highlight"}),n(Oe,{labelId:a,multiple:!0,value:p,label:"Highlight","data-testid":"graph-walk-select",renderValue:s=>s.map(u=>l.get(u)).join(", "),onChange:s=>{let{value:u}=s.target;e.liftAmongChoices(typeof u=="string"?u.split(","):u)},children:r.map(({name:s,label:u})=>f(Be,{value:s,dense:!0,children:[n(Ae,{size:"small",checked:p.includes(s)}),n(ze,{primary:u})]},s))})]})}),Qt=Kn;var jn=H()(t=>({toolbar:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:`1px solid ${t.palette.divider}`}})),Un=d(function({model:e}){return n(Z,{variant:"body2",children:e.zoomPercent})}),qn=d(function({model:e}){let{classes:o}=jn(),a=r=>{e.zoom(r,e.viewBox.width/2,e.viewBox.height/2)};return f("div",{className:o.toolbar,children:[n(Kt,{model:e}),n(Yt,{model:e}),n(Qt,{model:e}),n(jt,{model:e}),n(ee,{title:"Zoom in",children:n(Q,{size:"small",onClick:()=>{a(1.5)},children:n(Ft,{})})}),n(ee,{title:"Zoom out",children:n(Q,{size:"small",onClick:()=>{a(1/1.5)},children:n(Vt,{})})}),n(ee,{title:"Zoom to fit",children:n(Q,{size:"small",onClick:()=>{e.refitView()},children:n(Xt,{})})}),n(Un,{model:e}),n($t,{model:e}),n(Jt,{model:e})]})}),en=qn;var Jn="#1c1c22",Qn="#eef1f3",eo="#1a56c4",se=H()({row:{...X,display:"flex",alignItems:"center",gap:6,color:Jn},heading:ae,joined:{display:"flex","& > button + button":{marginLeft:-1},"& > button:first-of-type":{borderRadius:"3px 0 0 3px"},"& > button:last-of-type":{borderRadius:"0 3px 3px 0"}},button:{display:"flex",alignItems:"center",gap:4,font:"inherit",color:"inherit",background:X.background,border:`1px solid ${K}`,borderRadius:3,padding:"0 6px",cursor:"pointer","&:hover":{background:Qn},"&:disabled":{color:K,cursor:"default"},"&:focus-visible":{outline:`2px solid ${eo}`,outlineOffset:1,position:"relative",zIndex:1}},on:{color:X.background,background:K,"&:hover":{background:K}}}),le=d(function(e){return n("button",{type:"button",...e})});var to=d(function({model:e}){let{classes:o,cx:a}=se(),{walkChoices:r}=e,c=e.walkLayers.filter(l=>r.some(p=>p.name===l.walk)).length;return e.highlightMenuItems().length>0?f("div",{className:o.row,role:"group","aria-label":"Haplotypes","data-testid":"graph-haplotype-switch",children:[n("span",{className:o.heading,children:"Haplotypes"}),f(O,{ButtonComponent:le,menuItems:()=>e.highlightMenuItems(),className:a(o.button,c>0&&o.on),title:"Highlight haplotypes","aria-haspopup":"menu",children:[n("span",{children:c>0?`${c} of ${r.length}`:"highlight"}),n("span",{"aria-hidden":!0,children:"\u25BE"})]})]}):null}),tn=to;var no={position:"absolute",bottom:ft,lineHeight:"normal",background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6};function xe({label:t,readout:e}){return f(k,{children:[n("strong",{children:t})," \u2014 ",e]})}function oo(t,e){if(e)return{testId:"graph-chip-tooltip",body:xe(e)};let o=t.hoveredNode?t.hoverNodeById?.get(t.hoveredNode):void 0;if(o){let l=et(o),p=t.hoverDrawing?.members.get(o.id),s=tt(o),u=t.graphRegion,m=t.hoveredSpan,g=u&&m&&!Re(o)?`${u.assemblyName} ${$({refName:u.refName,...m})}`:void 0,S=me(t.genePins,o.id),E=S.length>0?f(k,{children:[n("br",{}),n("em",{children:S.join(", ")})]}):null;return l?{body:f(k,{children:[l,E]})}:{body:f(k,{children:[n("strong",{children:o.name}),p?` and ${p.length-1} more`:""," \u2014"," ",o.length.toLocaleString()," bp, depth ",o.depth.toFixed(1),s?f(k,{children:[n("br",{}),s.sample," ",$(s)," (rank ",o.stable?.rank,")"]}):null,g?f(k,{children:[n("br",{}),"Reference ",g]}):null,E,o.moved?f(k,{children:[n("br",{}),"End of a component too large to draw here"]}):null]})}}let a=t.hoveredEdge===null?void 0:t.graph?.edges[t.hoveredEdge];if(a){let l=Qe(a,t.deletions.find(s=>s.edgeIndex===t.hoveredEdge),s=>t.nodeById?.get(s)?.name??s),p=t.graph?Ce(t.graph):void 0;return{body:l.deletion?f(k,{children:[`skips ${l.deletion.bp} of ${p??"the reference"} sequence`,n("br",{}),l.deletion.where]}):f(k,{children:["Edge: ",l.ends]})}}let r=t.hoveredWalkRowText;if(r)return{testId:"graph-walk-row-tooltip",body:xe(r)};let c=t.hoveredTubeText;return c?{testId:"graph-tube-tooltip",body:xe(c)}:void 0}var ro=d(function({model:e,chip:o}){let a=oo(e,o);return a?n("div",{style:{...no,right:e.tooltipRightPx},"data-testid":a.testId,children:a.body}):null}),nn=ro;var ao=d(function({model:e}){let{classes:o,cx:a}=se(),r=e.forceEngineRows(),c=!r.some(l=>l.row.checked);return f("div",{className:o.row,role:"group","aria-label":"Layout","data-testid":"graph-layout-switch",children:[n("span",{className:o.heading,children:"Layout"}),n("span",{className:o.joined,children:r.map(({name:l,about:p,row:s})=>n("button",{type:"button",className:a(o.button,s.checked&&o.on),"aria-pressed":s.checked,disabled:s.disabled,title:s.disabled?s.disabledHelpText:`${s.label}. ${p}`,onClick:s.onClick,children:l},l))}),f(O,{ButtonComponent:le,menuItems:()=>e.layoutMenuItems(),className:a(o.button,c&&o.on),title:"Every layout","aria-haspopup":"menu",children:[n("span",{children:c?e.layoutLabel():"more"}),n("span",{"aria-hidden":!0,children:"\u25BE"})]})]})}),on=ao;var rn=M(n("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var an=M(n("path",{d:"M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z"}),"FilterListOff");var sn=M(n("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var io={x:0,y:0};function so(t,e){let{own:o,reference:a,highlight:r}=t.nodeLaunchTargets(e);return[{label:"Node details",icon:sn,onClick:()=>{t.showNodeDetails(e)}},...mt({own:o,reference:a,highlight:r,onShowLinear:c=>{t.showInLinearView(c)},onHighlight:t.canHighlightInLinearView?c=>{t.highlightInLinearView(c)}:void 0})]}function lo(t,e,o){let a=o??t.walkRowBars,r=t.walkRowLaunchTarget(e,a),c=r?.assembly,l=e>0?a?.rows[e-1]:void 0,p=l?.sample,s=t.abridged.find(g=>g.name===l?.name),u=!o&&t.walkRowBars,m=t.walkRowSamples;return[r&&c?{label:`Linear genome view \u2014 ${c} ${$(r.location)}`,icon:ye,onClick:()=>{t.showInLinearView({location:r.location,assembly:c})}}:{label:"Linear genome view",icon:ye,disabled:!0,disabledHelpText:r?`No assembly in this session is ${r.location.haplotype??r.label}`:"This walk states no contig coordinates",onClick:()=>{}},...o&&l&&s?[{label:"Load its steps",subLabel:Le(s,l.label),onClick:()=>{t.expandWalk(l.name)}}]:[],...l&&t.liftsWalks&&t.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${l.label}`,checked:t.walkLayers.some(g=>g.walk===l.name),onClick:()=>{t.toggleWalk(l.name)}}]:[],...u&&p&&!(m?.length===1&&m[0]===p)?[{label:`Show only ${p}`,icon:rn,onClick:()=>{t.setWalkRowSamples([p])}}]:[],...u&&m?[{label:"Show every sample",icon:an,onClick:()=>{t.setWalkRowSamples(void 0)}}]:[]]}var ce=d(function({model:e,at:o,onClose:a}){return n(Ge,{anchor:o,offset:io,onClose:a,menuItems:()=>o===void 0?[]:"nodeId"in o?so(e,o.nodeId):lo(e,o.row,o.bars)})});var co=d(function({model:e}){return n(k,{children:e.passBars.map(o=>n("svg",{"data-testid":"graph-pass-bar",width:e.paneWidth,height:pt,style:{display:"block",borderTop:"1px solid #ddd"},children:n(D,{el:ut(o,e.walkLabel(o.walk),e.paneWidth)})},o.walk))})}),ln=co;var po={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},uo={position:"absolute",pointerEvents:"none",background:"rgba(255,255,255,0.92)",border:"1px solid #ccc",borderRadius:3,padding:"1px 6px",fontSize:11,whiteSpace:"nowrap",zIndex:4},fo=d(function({bars:e,frame:o,ramp:a,rowGenes:r,inks:c}){let l=xt(),p=Xe(()=>Ze(e,o,{ramp:a,rowGenes:r,idPrefix:l,markUnloaded:!0,inks:c}),[e,o,a,r,l,c]);return n(D,{el:p})}),ho=d(function({model:e}){let o=e.walkStripRows,a=e.walkStripFrame,r=e.stripHover,c=o?[o.reference,...o.rows]:[],l=r?c.findIndex(g=>g.name===r.row):-1,p=c[l],s=o&&a&&p?Ve(o,l,a):void 0;if(!o||!a||!r||!p||!s||a.labelled&&!s.cut)return null;let u=(o.origin+r.offset)*a.scaleX+a.translateX,m=u>a.width/2?{right:a.width-u+12}:{left:u+12};return f("div",{"data-testid":"graph-walk-strip-tip",style:{...uo,...m,top:l*a.rowPx+a.translateY-18},children:[p.label," \xB7 ",s.text]})}),mo=d(function({model:e,bars:o,frame:a}){return n(D,{el:st(o,a,e.walkStripMarks)})}),go=d(function({model:e}){let o=e.walkStripRows,a=e.walkStripFrame,[r,c]=L();if(!o||!a)return null;let l=s=>{let u=s.currentTarget.getBoundingClientRect();return it(o,a,s.clientX-u.left,s.clientY-u.top)},p=Ye(o,{ramp:e.referenceRampDomain,rampCss:Fe,genes:ct(a,e.walkRowGenes,e.walkRowGeneGaps),annotation:e.walkRowAnnotation,markUnloaded:!0,inks:e.walkStripInks});return f("div",{"data-testid":"graph-walk-strip",style:{position:"relative",borderTop:"1px solid #ddd"},onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{I(e)&&(e.setPointerInPane(!1),e.setStripHover(null))},children:[f("svg",{width:a.width,height:a.height,style:{display:"block"},onMouseLeave:()=>{I(e)&&e.setStripHover(null)},onMouseMove:s=>{let u=l(s);s.currentTarget.style.cursor=u&&u.index>0?"pointer":"",e.setStripHover(u?{row:u.row.name,offset:u.offset}:null)},onClick:s=>{let u=l(s);u&&u.index>0&&e.toggleWalk(u.row.name)},onContextMenu:s=>{let u=l(s);u&&(s.preventDefault(),c({clientX:s.clientX,clientY:s.clientY,row:u.index}))},children:[n(fo,{bars:o,frame:a,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes,inks:e.walkStripInks}),n(mo,{model:e,bars:o,frame:a}),n(D,{el:lt(o,a,new Set(e.walkLayers.map(s=>s.walk)))})]}),n(ho,{model:e}),f("div",{style:po,"data-testid":"graph-walk-strip-key",children:[p.map(s=>f("div",{style:re,children:[n(oe,{swatch:Lt(s.swatch)}),n("span",{children:s.label})]},s.label)),n("span",{style:{color:"#777"},children:"Ticks mark where each walk passes the node under the pointer; click a haplotype's bar to lift its walk"})]}),n(ce,{model:e,at:r&&{...r,bars:o},onClose:()=>{c(void 0)}})]})}),cn=go;var yo=d(function({model:e}){let o=e.walkStripLocator;return o?f(vt,{model:e,zIndex:4,overflow:"visible",testId:"graph-walk-strip-locator",children:[n("circle",{cx:o.x,cy:o.y,r:11,fill:"none",stroke:"white",strokeWidth:4}),n("circle",{cx:o.x,cy:o.y,r:11,fill:"none",stroke:"#111",strokeWidth:1.75})]}):null}),pn=yo;var bo=1.1,vo=100,wo=40,So=800,xo=10,un=2;function ke(t){let e=t.deltaY*(t.deltaMode===1?wo:t.deltaMode===2?So:1),o=(t.ctrlKey?xo:1)*e/vo;return bo**-Math.max(-un,Math.min(un,o))}var ko=40,Po=100,Mo=24,dn=Math.log(16);function Ro(t,e){let o=t*Math.exp(-Math.max(0,e)/Mo);return Math.abs(o)<.001?t:t-o}function Co(t,e){let o=Math.abs(t.deltaX)>Math.abs(t.deltaY);return t.ctrlKey||t.metaKey||!o&&(!e||e.scrollZoom)?"zoom":o?"pan":"page"}function mn(t,e,o){G(()=>{if(!t)return;let a=-1/0,r={backlog:0,x:0,y:0,frame:0,last:0},c=p=>{let s=Ro(r.backlog,Math.min(100,p-r.last));r.backlog-=s,r.last=p,r.frame=r.backlog?requestAnimationFrame(c):0,I(o)&&o.zoom(Math.exp(s),r.x,r.y)},l=p=>{if(o.hostPlacesX||o.followsHostView)return;let m=((p.target instanceof Element?p.target.closest("canvas"):null)??(o.facetPanels?null:e))?.getBoundingClientRect();if(m&&p.clientY-m.top<o.referenceStripZonePx)return;let g=Co(p,o.host);if(g!=="page"){if(o.host&&p.stopPropagation(),p.preventDefault(),g==="pan"){if(p.timeStamp-a>Po){let S=p.deltaMode===1?ko:1;o.setTransform(o.scale,o.translateX-p.deltaX*S,o.translateY)}return}a=p.timeStamp,m&&(r.x=p.clientX-m.left,r.y=p.clientY-m.top,r.backlog=Math.max(-dn,Math.min(dn,r.backlog+Math.log(ke(p)))),r.frame||(r.last=performance.now()-1e3/60,r.frame=requestAnimationFrame(c)))}};return t.addEventListener("wheel",l,{passive:!1}),()=>{cancelAnimationFrame(r.frame),t.removeEventListener("wheel",l)}},[t,e,o])}var fn=3,Pe="data-gesture-owner",j=t=>({x:t.clientX,y:t.clientY});function hn(t){let[e,o]=[...t.values()];return{spread:Math.hypot(e.x-o.x,e.y-o.y),mid:{x:(e.x+o.x)/2,y:(e.y+o.y)/2}}}function gn(t){let e=C({x:0,y:0}),o=C({x:0,y:0}),a=C(!1),r=C(void 0),c=i=>r.current!==void 0&&i.pointerId!==r.current,l=C(new Map),p=C(null),s=C(null),u=C(!1),m=C(null),g=C(!1),S=C({frame:0,pan:null,hover:null,pinch:!1});G(()=>()=>{cancelAnimationFrame(S.current.frame)},[]);let[E,A]=L(),[N,B]=L(!1),[U,F]=L(void 0);function V(i){let h=i.currentTarget.getBoundingClientRect();return{x:i.clientX-h.left,y:i.clientY-h.top}}function R(i,h){if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(i,h);let y=t.referenceStripNodeAt(i,h);if(y)return y;let{nodePositions:b}=t;if(!b)return null;let{x:v,y:w}=ge(i,h,t,t.axisScale);return fe(b,v,w,t.axisScale,t.positionsVersion,t.nodeInk,t.drawnFold)}function T(i,h){let{nodePositions:y,graph:b}=t;if(!y||!b)return null;let{x:v,y:w}=ge(i,h,t,t.axisScale);return he(y,b,v,w,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded,t.drawnFold)}function bn(i){i.button===0&&i.preventDefault()}function vn(i){if(i.button!==0)return;let h=l.current;if(c(i)){t.isPanning&&!g.current&&i.pointerType==="touch"&&h.size===1&&(i.currentTarget.setPointerCapture(i.pointerId),h.set(i.pointerId,j(i)),s.current=hn(h),a.current=!0);return}a.current=!1,o.current={x:i.clientX,y:i.clientY},i.currentTarget.removeAttribute(Pe);let y=t.followsHostView,{x:b,y:v}=V(i),w=v<t.referenceStripZonePx,P=t.hostPlacesX||t.layoutResult?.tubeMap||w?null:R(b,v);t.hostPlacesX||y&&i.shiftKey||t.followsWindow&&!P||(i.currentTarget.setPointerCapture(i.pointerId),r.current=i.pointerId,p.current=i.currentTarget,h.clear(),h.set(i.pointerId,j(i)),y&&P&&i.currentTarget.setAttribute(Pe,""),g.current=y,u.current=w&&!y,P?t.setDraggingNode(P):t.setPanning(!0),e.current={x:i.clientX,y:i.clientY})}function Me(){let i=s.current,h=p.current;if(!i||!h)return;let y=hn(l.current),b=h.getBoundingClientRect();i.spread>0&&y.spread>0&&t.zoom(y.spread/i.spread,i.mid.x-b.left,i.mid.y-b.top),t.setTransform(t.scale,t.translateX+y.mid.x-i.mid.x,t.translateY+y.mid.y-i.mid.y),s.current=y}function wn(){let i=S.current,{pan:h,hover:y,pinch:b}=i;if(i.frame=0,i.pan=null,i.hover=null,i.pinch=!1,b&&Me(),h&&u.current?t.host?.horizontalScroll(-h.dx):h&&g.current?t.setTransform(t.scale,t.translateX,t.translateY+h.dy):h&&t.setTransform(t.scale,t.translateX+h.dx,t.translateY+h.dy),!y)return;let{x:v,y:w}=y,P=t.facetPanels?void 0:Pt(t.overlayLabels,v,w);F(x=>x?.label===P?.label&&x?.readout===P?.readout?x:P),Ee(()=>{if(t.walkRowBars){let x=t.walkRowAt(v,w);t.setHoveredWalkRow(x===void 0?null:t.walkRowList[x].name)}if(t.nodePositions&&t.graph){let x=R(v,w);t.setHoveredPanel(t.tubeMapPanelAt(w)),t.setHoveredNode(x,{x:v,y:w}),B(x!==null&&!t.hostPlacesX&&!t.layoutResult?.tubeMap&&w>=t.referenceStripZonePx),t.setHoveredTube(x===null&&t.layoutResult?.tubeMap?t.tubeAt(v,w):null),t.setHoveredEdge(x||t.layoutResult?.tubeMap||!t.hoverLightsEverything?null:T(v,w))}})}function q(){S.current.frame||(S.current.frame=requestAnimationFrame(wn))}function Sn(){let i=S.current;cancelAnimationFrame(i.frame),i.frame=0,i.pan=null,i.hover=null,i.pinch=!1}function xn(i){let h=l.current;if(s.current&&h.has(i.pointerId)){h.set(i.pointerId,j(i)),S.current.pinch=!0,q();return}if(c(i)||m.current)return;let y=i.clientX-e.current.x,b=i.clientY-e.current.y;e.current={x:i.clientX,y:i.clientY},Math.hypot(i.clientX-o.current.x,i.clientY-o.current.y)>fn&&(a.current=!0);let v=S.current;if(t.draggingNode)t.moveNode(t.draggingNode,y/t.scaleX,b/t.scaleY);else if(t.isPanning)v.pan={dx:(v.pan?.dx??0)+y,dy:(v.pan?.dy??0)+b},q();else{let w=i.currentTarget.getBoundingClientRect();v.hover={x:i.clientX-w.left,y:i.clientY-w.top},q()}}function pe(i){let h=l.current;if(s.current&&h.has(i.pointerId)){S.current.pinch&&(S.current.pinch=!1,Me()),h.delete(i.pointerId),s.current=null;let[[y,b]]=[...h];r.current=y,e.current=b;return}c(i)||(r.current=void 0,h.clear(),I(t)&&t.stopDragging())}function kn(i){c(i)||(F(void 0),B(!1),m.current?S.current.hover=null:(r.current=void 0,l.current.clear(),s.current=null,Sn(),I(t)&&t.stopDragging()),I(t)&&t.clearHover())}function Pn(i){let{x:h,y}=V(i),b=R(h,y),{clientX:v,clientY:w}=i;if(b){i.preventDefault(),A({clientX:v,clientY:w,nodeId:b});return}let P=t.walkRowAt(h,y);P!==void 0&&(i.preventDefault(),A({clientX:v,clientY:w,row:P}))}function Mn(i){if(!a.current){let{x:h,y}=V(i),b=R(h,y);t.setSelectedNode(b),b&&t.showNodeDetails(b)}}G(()=>()=>{m.current?.end()},[]);function Rn(i){if(i.button!==0||t.hostPlacesX||t.followsHostView||!(i.target instanceof Element)||!i.target.closest(`[${yt}]`))return;m.current?.end(),u.current=!1,g.current=!1;let h=i.pointerId,y=j(i),b=y,v={moved:!1,end:()=>{window.removeEventListener("pointermove",w,!0),window.removeEventListener("pointerup",P,!0),window.removeEventListener("pointercancel",P,!0),v.moved&&I(t)&&t.stopDragging()}};function w(x){if(x.pointerId!==h)return;if(!v.moved){if(Math.hypot(x.clientX-y.x,x.clientY-y.y)<=fn)return;v.moved=!0,t.setPanning(!0)}let ue=S.current;ue.pan={dx:(ue.pan?.dx??0)+x.clientX-b.x,dy:(ue.pan?.dy??0)+x.clientY-b.y},b=j(x),q()}function P(x){x.pointerId===h&&(v.end(),setTimeout(()=>{m.current===v&&(m.current=null)},0))}m.current=v,window.addEventListener("pointermove",w,!0),window.addEventListener("pointerup",P,!0),window.addEventListener("pointercancel",P,!0)}function Cn(i){m.current?.moved&&(m.current=null,i.stopPropagation())}let Ln={cursor:t.isPanning||t.draggingNode?"grabbing":N?"move":"grab",touchAction:t.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},In=t.host!==void 0&&!t.hostPlacesX&&!t.followsHostView?{[Pe]:"",onMouseDown:i=>{i.stopPropagation()}}:{};return{canvasStyle:Ln,surfaceProps:In,handlers:{onMouseDown:bn,onPointerDown:vn,onPointerMove:xn,onPointerUp:pe,onPointerCancel:pe,onLostPointerCapture:pe,onPointerLeave:kn,onClick:Mn,onContextMenu:Pn},contextMenu:E,hoveredChip:U,labelHandlers:{onPointerDown:Rn,onClickCapture:Cn},closeContextMenu:()=>{A(void 0)}}}var Lo={position:"relative"},Io={position:"relative",lineHeight:0,isolation:"isolate"},Eo={position:"absolute",left:0,right:0,bottom:0,zIndex:0},Go={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},To={position:"absolute",left:6,transform:"translateY(-50%)",background:"rgba(255,255,255,0.82)",padding:"0 4px",borderRadius:3,fontSize:11,lineHeight:"16px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:4},Ho=d(function({model:e}){return n(k,{children:e.visibleRowLabels.map(({label:o,y:a,top:r})=>n("div",{"data-testid":"graph-row-label",style:{...To,top:r},children:o},a))})}),Ao={position:"absolute",display:"flex",flexDirection:"column",borderRadius:3,overflowX:"hidden",overflowY:"auto",zIndex:4},No={position:"absolute",transform:"translate(-50%, -50%)",background:"rgba(255,255,255,0.78)",padding:"0 3px",borderRadius:3,fontSize:10,lineHeight:"13px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:3},_o=d(function({model:e,children:o}){let a=C(null),r=e.legendAtRest,c=e.keyShape;return G(()=>{e.setKeyShapeOf(()=>JSON.stringify(Gt(e)))},[e]),G(()=>{let l=a.current;if(!l||!r)return;let p=new ResizeObserver(()=>{s()}),s=()=>{for(let u of l.children)p.observe(u);I(e)&&e.legendAtRest&&e.setLegendSize({width:l.offsetWidth,height:l.scrollHeight},c)};return p.observe(l),s(),()=>{p.disconnect()}},[e,r,c]),f("div",{ref:a,style:{...Ao,top:ne+e.referenceStripZonePx,right:ne,maxHeight:e.canvasHeight-2*ne-e.referenceStripZonePx},children:[o,n(Wt,{model:e,sections:Tt(e)})]})}),zo=d(function({model:e}){return n(k,{children:e.overlayLabels.sizes.map(({key:o,text:a,x:r,y:c})=>n("div",{"data-testid":"graph-size-label",style:{...No,left:r,top:c},children:a},o))})}),yn=d(function({model:e,handle:{canvasRef:o,canvas:a},ownChrome:r}){let{handlers:c,canvasStyle:l,surfaceProps:p,labelHandlers:s,contextMenu:u,closeContextMenu:m,hoveredChip:g}=gn(e),[S,E]=L(null);mn(S,a,e);let A=e.facetPanels!==void 0;return f("div",{style:Lo,...p,children:[r?n(en,{model:e}):null,f("div",{ref:E,style:Io,...s,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{I(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?n("div",{style:{...Eo,top:e.referenceStripZonePx,background:te}}):null,n("canvas",{ref:o,"data-testid":"graph-genome-canvas",style:{...l,width:e.paneWidth,height:e.canvasHeight,clipPath:e.drawingClip,display:"block",position:"relative",zIndex:1},...c}),A?n(Dt,{model:e,handlers:c,canvasStyle:l}):f(k,{children:[n(At,{model:e}),n(Ot,{model:e}),n(Ht,{model:e}),n(St,{model:e}),n(Ho,{model:e}),n(zo,{model:e}),n(wt,{model:e}),n(kt,{model:e}),n(Mt,{model:e}),n(Nt,{model:e}),n(pn,{model:e}),n(_o,{model:e,children:r?null:f(k,{children:[n(on,{model:e}),n(tn,{model:e})]})})]}),r?n("div",{style:Go,children:n(Te,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null,n(nn,{model:e,chip:g})]}),n(ln,{model:e}),e.walkStripShown?n(cn,{model:e}):null,n(ce,{model:e,at:u,onClose:m}),r?.renderError?n(de,{error:r.renderError,onReset:r.retryRender}):null,r&&e.error?n(de,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),Bo=d(function({model:e}){let{canvasRef:o,canvas:a,error:r,retry:c}=Bt(zt,e);return n(yn,{model:e,handle:{canvasRef:o,canvas:a},ownChrome:{renderError:r,retryRender:c}})}),Oo=d(function({model:e,handle:o}){return o?n(yn,{model:e,handle:o}):n(Bo,{model:e})}),pl=Oo;export{zt as a,pl as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FYJF6NGI.js.map
|