jbrowse-plugin-graphgenomeviewer 7.2.0 → 7.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/chunks/GbzBaseSyntenyAdapter-FXMGIM7Z.js +2 -0
- package/dist/chunks/{GbzBaseSyntenyAdapter-NB6WBBZH.js.map → GbzBaseSyntenyAdapter-FXMGIM7Z.js.map} +3 -3
- package/dist/chunks/{GraphGenomeView-4O5F5I37.js → GraphGenomeView-WJ3FIDY2.js} +2 -2
- package/dist/chunks/{GraphTrackSettingsDialog-WZEJAF7F.js → GraphTrackSettingsDialog-ZW7ALMDV.js} +2 -2
- package/dist/chunks/{HighlightColorDialog-SRT2FPXP.js → HighlightColorDialog-VBZRUKD5.js} +2 -2
- package/dist/chunks/{LinearGraphDisplay-Z33PVCJL.js → LinearGraphDisplay-SPOPTJEN.js} +2 -2
- package/dist/chunks/MinigraphBubbleAdapter-QCOMFPLL.js +2 -0
- package/dist/chunks/{MinigraphBubbleAdapter-HDLUZ6YF.js.map → MinigraphBubbleAdapter-QCOMFPLL.js.map} +1 -1
- package/dist/chunks/RgfaTabixAdapter-O3NMNRZ2.js +2 -0
- package/dist/chunks/RgfaTabixAdapter-O3NMNRZ2.js.map +7 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-7VDCNSFD.js +2 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-7VDCNSFD.js.map +7 -0
- package/dist/chunks/chunk-2M4XYSLG.js +2 -0
- package/dist/chunks/chunk-2M4XYSLG.js.map +7 -0
- package/dist/chunks/{chunk-JLGPQO5L.js → chunk-2O3YVA2I.js} +2 -2
- package/dist/chunks/{chunk-CWNJR5XB.js → chunk-44CJ2N3N.js} +1 -1
- package/dist/chunks/{chunk-CWNJR5XB.js.map → chunk-44CJ2N3N.js.map} +1 -1
- package/dist/chunks/chunk-6KUHGRHU.js +2 -0
- package/dist/chunks/chunk-6KUHGRHU.js.map +7 -0
- package/dist/chunks/chunk-6MUBJVBG.js +2 -0
- package/dist/chunks/chunk-6MUBJVBG.js.map +7 -0
- package/dist/chunks/{chunk-GUXZESDR.js → chunk-7HWHWPRW.js} +1 -1
- package/dist/chunks/{chunk-GUXZESDR.js.map → chunk-7HWHWPRW.js.map} +1 -1
- package/dist/chunks/chunk-B2EP6FOQ.js +3 -0
- package/dist/chunks/chunk-B2EP6FOQ.js.map +7 -0
- package/dist/chunks/{chunk-44HZPYGC.js → chunk-BXRTG7FU.js} +2 -2
- package/dist/chunks/{chunk-44HZPYGC.js.map → chunk-BXRTG7FU.js.map} +1 -1
- package/dist/chunks/{chunk-HLKZCTQ3.js → chunk-DBPEUVUC.js} +1 -1
- package/dist/chunks/{chunk-HLKZCTQ3.js.map → chunk-DBPEUVUC.js.map} +1 -1
- package/dist/chunks/{chunk-FME624X3.js → chunk-DUR437TH.js} +2 -2
- package/dist/chunks/{chunk-FME624X3.js.map → chunk-DUR437TH.js.map} +1 -1
- package/dist/chunks/{chunk-6WA6WF6A.js → chunk-FIRQAKMX.js} +1 -1
- package/dist/chunks/{chunk-6WA6WF6A.js.map → chunk-FIRQAKMX.js.map} +1 -1
- package/dist/chunks/chunk-JCAZTNYG.js +2 -0
- package/dist/chunks/chunk-JCAZTNYG.js.map +7 -0
- package/dist/chunks/chunk-N74HGPAW.js +3 -0
- package/dist/chunks/chunk-N74HGPAW.js.map +7 -0
- package/dist/chunks/chunk-PEDWEPNK.js +2 -0
- package/dist/chunks/chunk-PEDWEPNK.js.map +7 -0
- package/dist/chunks/chunk-PYQG3JHP.js +3 -0
- package/dist/chunks/chunk-PYQG3JHP.js.map +7 -0
- package/dist/chunks/chunk-RFDSEB2X.js +4 -0
- package/dist/chunks/chunk-RFDSEB2X.js.map +7 -0
- package/dist/chunks/{chunk-O7Y7LYN6.js → chunk-RW775LQN.js} +2 -2
- package/dist/chunks/{chunk-O7Y7LYN6.js.map → chunk-RW775LQN.js.map} +1 -1
- package/dist/chunks/{chunk-N4WBX2OS.js → chunk-VQ77X5QU.js} +2 -2
- package/dist/chunks/{chunk-N4WBX2OS.js.map → chunk-VQ77X5QU.js.map} +1 -1
- package/dist/chunks/{chunk-LXCMWL7B.js → chunk-WUSKVEA6.js} +2 -2
- package/dist/chunks/{chunk-LXCMWL7B.js.map → chunk-WUSKVEA6.js.map} +1 -1
- package/dist/chunks/{chunk-ZNT7TQLN.js → chunk-YKSUKPYY.js} +2 -2
- package/dist/chunks/chunk-YKSUKPYY.js.map +7 -0
- package/dist/chunks/{renderSvg-RRWCAEGF.js → renderSvg-WD6YDV2I.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +4 -4
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +3 -3
- package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +2 -2
- package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts +1 -1
- package/src/GetSubgraph.ts +1 -1
- package/src/GraphGenomeView/genes/genes.test.ts +20 -2
- package/src/GraphGenomeView/legendSections.test.ts +1 -1
- package/src/GraphGenomeView/legendSections.ts +1 -7
- package/src/GraphGenomeView/model.test.ts +1 -2
- package/src/GraphGenomeView/pane/graphViews.ts +24 -35
- package/src/GraphGenomeView/pane/loadActions.ts +4 -3
- package/src/GraphGenomeView/pane/paneBase.ts +1 -1
- package/src/GraphGenomeView/subgraphLoad.test.ts +41 -1
- package/src/GraphGenomeView/walkRowsCut.ts +10 -44
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.test.ts +23 -4
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.ts +2 -3
- package/src/RgfaTabixAdapter/bubbleTier.test.ts +1 -1
- package/src/RgfaTabixAdapter/test_data/walks3_inversion.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks3_inversion.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/walkCut.ts +20 -0
- package/src/RgfaTabixAdapter/walkFiles.test.ts +2 -2
- package/src/RgfaTabixAdapter/walkReader.ts +1 -1
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +77 -1
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +2 -2
- package/src/WalkTabixSyntenyAdapter/walkLanes.ts +55 -18
- package/src/version.ts +1 -1
- package/dist/chunks/GbzBaseSyntenyAdapter-NB6WBBZH.js +0 -2
- package/dist/chunks/MinigraphBubbleAdapter-HDLUZ6YF.js +0 -2
- package/dist/chunks/RgfaTabixAdapter-XZRTWQMZ.js +0 -3
- package/dist/chunks/RgfaTabixAdapter-XZRTWQMZ.js.map +0 -7
- package/dist/chunks/WalkTabixSyntenyAdapter-WBHOZLAN.js +0 -2
- package/dist/chunks/WalkTabixSyntenyAdapter-WBHOZLAN.js.map +0 -7
- package/dist/chunks/chunk-BWP3XYKD.js +0 -2
- package/dist/chunks/chunk-BWP3XYKD.js.map +0 -7
- package/dist/chunks/chunk-EDSIYH4H.js +0 -2
- package/dist/chunks/chunk-EDSIYH4H.js.map +0 -7
- package/dist/chunks/chunk-III4GT4G.js +0 -2
- package/dist/chunks/chunk-III4GT4G.js.map +0 -7
- package/dist/chunks/chunk-N5GYTUIL.js +0 -3
- package/dist/chunks/chunk-N5GYTUIL.js.map +0 -7
- package/dist/chunks/chunk-PA4HKAUJ.js +0 -2
- package/dist/chunks/chunk-PA4HKAUJ.js.map +0 -7
- package/dist/chunks/chunk-PFAHNHMM.js +0 -2
- package/dist/chunks/chunk-PFAHNHMM.js.map +0 -7
- package/dist/chunks/chunk-UFQTIWSN.js +0 -4
- package/dist/chunks/chunk-UFQTIWSN.js.map +0 -7
- package/dist/chunks/chunk-VDHDEEMF.js +0 -2
- package/dist/chunks/chunk-VDHDEEMF.js.map +0 -7
- package/dist/chunks/chunk-WGVATZLM.js +0 -3
- package/dist/chunks/chunk-WGVATZLM.js.map +0 -7
- package/dist/chunks/chunk-ZNT7TQLN.js.map +0 -7
- package/src/RgfaTabixAdapter/rgfaBed.test.ts +0 -254
- package/src/RgfaTabixAdapter/rgfaBed.ts +0 -314
- package/src/RgfaTabixAdapter/rgfaCut.ts +0 -139
- package/src/RgfaTabixAdapter/walkRowRuns.test.ts +0 -192
- package/src/RgfaTabixAdapter/walkRowRuns.ts +0 -520
- /package/dist/chunks/{GraphGenomeView-4O5F5I37.js.map → GraphGenomeView-WJ3FIDY2.js.map} +0 -0
- /package/dist/chunks/{GraphTrackSettingsDialog-WZEJAF7F.js.map → GraphTrackSettingsDialog-ZW7ALMDV.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-SRT2FPXP.js.map → HighlightColorDialog-VBZRUKD5.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-Z33PVCJL.js.map → LinearGraphDisplay-SPOPTJEN.js.map} +0 -0
- /package/dist/chunks/{chunk-JLGPQO5L.js.map → chunk-2O3YVA2I.js.map} +0 -0
- /package/dist/chunks/{renderSvg-RRWCAEGF.js.map → renderSvg-WD6YDV2I.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as X,b as ut}from"./chunk-FME624X3.js";import{a as et,b as tt,c as te,d as nt,e as ot,f as ne,h as rt,i as at,j as it,k as st,m as oe,n as lt,o as dt,p as ft,r as ht,t as mt,u as gt}from"./chunk-UFQTIWSN.js";import{O as Ue,P as Je,S as ue,U as Qe,V as ct,W as pt,a as x,d as Te,i as Ne,j as We,k as Oe,l as De,m as J,n as Xe,o as Be,x as Fe,y as Ze}from"./chunk-N5GYTUIL.js";import{n as D}from"./chunk-HLKZCTQ3.js";import{E as ze,Fb as N,Jb as ce,L as _e,Lb as pe,M as Ve,N as Ye,Nb as ee,a as V,b as be,da as le,dc as qe,ha as Q,la as je,na as Ke,x as Ae,xa as $e}from"./chunk-WGVATZLM.js";import{k as He}from"./chunk-III4GT4G.js";import{e as I}from"./chunk-NDRLCGPC.js";import{j as $}from"./chunk-TENPGIPX.js";import{d as G,e as Ie,f as Ge,g as k,h as R}from"./chunk-YU7T5WOQ.js";import{D as Ee,G as U,H as Y,b as we,c as xe,e as se,k as Se,o as Pe,p as Me,s as ke,v as q,w as Re,y as Ce,z as Le}from"./chunk-UGCNPRKC.js";import{a as L,b as n,c as f,d as h}from"./chunk-JMBDTNUR.js";var W=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],ln=t=>W!=null&&t in Object(W)?W[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 vt=ln("useRenderingBackend"),lo=W&&W.__esModule?W.default:W;var de=tt(1);function fe({model:t}){let[e,o]=R(null);return G(()=>{if(!e)return;let i=new N(e),a=V(()=>{$e(qe()),i.resize(t.paneWidth,t.canvasHeight),t.paintHover(i,t.drawnBatch)});return()=>{a(),i.dispose()}},[e,t]),n("canvas",{ref:o,"data-testid":"graph-hover-layer",style:de})}var yt={background:"rgba(255,255,255,0.82)",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},re={display:"flex",alignItems:"center",gap:5},bt={color:"#666"};function ae({row:t,at:e,hint:o,after:i}){return t.swatch?f("div",{title:[t.title,o].filter(Boolean).join(" \xB7 ")||void 0,children:[f("div",{style:re,children:[n(oe,{swatch:t.swatch}),f("span",{children:[t.strong?n("strong",{children:t.strong}):null,t.label]}),i]}),e?n("div",{"data-testid":"graph-walk-at",children:e}):t.under?n("div",{children:t.under}):null]}):n("div",{style:bt,children:t.label})}var cn={pointerEvents:"auto",cursor:"pointer",border:"none",background:"none",padding:"0 2px",font:"inherit",textDecoration:"underline"},wt=h(function({model:e}){return n(L,{children:st(e).map(({testid:o,rows:i})=>n("div",{style:yt,"data-testid":o,children:i.map(a=>n(ae,{row:a,at:a.walk?e.hoveredOn(a.walk):void 0,after:a.closesBubble?n("button",{type:"button",style:cn,"data-testid":"graph-close-bubble",onClick:()=>{e.closeBubbles()},children:"close"}):null},a.key))},o))})});var pn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:Ve,lineHeight:"normal"},un={height:Ye,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},dn={position:"relative"},fn={gridColumn:"1 / -1",height:Je,padding:"2px 6px",boxSizing:"border-box",display:"flex",gap:14,fontSize:11,lineHeight:"15px"},hn=h(function({model:e,lift:o,width:i,height:a,cell:p,handlers:c,canvasStyle:l}){let[s,d]=R(null),[y,w]=R(null),E=o.walks[0];G(()=>{if(!s||!y)return;let T=new N(s),A=new N(y),O=be(()=>e.buildDrawing(o,!1)),B,F=[V(()=>{let M=e.facetGrid;M&&T.resize(M.width,M.height);let H=O.get();H&&(H!==B&&(T.uploadGeometry(H.batch),B=H),e.applySelection(T),e.paint(T))}),V(()=>{let M=e.facetGrid;M&&A.resize(M.width,M.height);let H=O.get();H&&e.paintHover(A,H.batch)})];return()=>{for(let M of F)M();T.dispose(),A.dispose()}},[s,y,e,o]);let z=e.walkLabel(E.name);return f("div",{style:p,children:[n("button",{type:"button",style:un,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([E.name]),e.setFacet("")},children:n(ae,{row:at(e,E),hint:`click to lift ${z} alone`,at:e.hoveredOn(E)})}),f("div",{style:dn,children:[n("canvas",{ref:d,"data-testid":"graph-facet-canvas",style:{...l,width:i,height:a,display:"block"},...c}),n("canvas",{ref:w,style:de})]})]})}),mn=h(function({model:e,handlers:o,canvasStyle:i}){let a=e.facetPanels,p=e.facetGrid,c=e.facetPlacement;if(!a||!p||!c)return null;let{columns:l,width:s,height:d}=p;return f("div",{"data-testid":"graph-facet-panels",style:{...pn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${l}, ${s}px)`,background:Q},children:[a.map((y,w)=>n(hn,{model:e,lift:y,width:s,height:d,cell:{gridRow:Math.floor(c.cells[w]/l)+1,gridColumn:c.cells[w]%l+1},handlers:o,canvasStyle:i},y.walks[0].name)),n("div",{style:{...fn,gridRow:Math.floor(Math.max(...c.cells)/l)+2},"data-testid":"graph-facet-key",children:it(e).map(y=>n(ae,{row:y},y.key))})]})}),xt=mn;var St=x(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 Pt=x([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 Mt=x(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 gn=h(function({model:e}){let o=e.colorSchemeLock;return n(X,{label:"Color",size:"small",sx:{minWidth:100},disabled:o!==void 0,title:o?.why,shown:o?.value,value:e.chosenColorScheme,options:Fe.map(({value:i})=>({value:i,label:e.colorSchemeLabel(i)})),testId:"graph-color-select",onChange:i=>{e.setColorScheme(i)}})}),kt=gn;var Rt=D()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function he(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var vn=h(function({model:e}){let{classes:o}=Rt(),{lastFetchMs:i,lastLayoutMs:a,lastGeometryMs:p}=e,c=i!==void 0||a!==void 0||p!==void 0;return e.showPerf&&c?f(Y,{variant:"caption",className:o.perf,"data-testid":"graph-perf-stats",children:["fetch ",he(i)," \xB7 layout ",he(a)," \xB7 geom"," ",he(p)]}):null}),yn=h(function({model:e}){let{classes:o}=Rt();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(Y,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",n(vn,{model:e})]})}),Ct=yn;var bn=h(function({model:e}){let{graph:o}=e;return n(X,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:Te.map(({value:i,label:a,description:p,available:c})=>({value:i,label:a,description:p,disabled:o?!c(o):!1})),onChange:i=>{e.switchLayout(i)}})}),Lt=bn;var wn=h(function({model:e}){return e.chosenLayoutMode!=="walkrows"||e.repeatChoices.length===0?null:n(X,{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)}})}),Et=wn;var It=x(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 Gt=x(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 xn=h(function({model:e}){let o=e.highlightMenuItems({picks:!1});return n(we,{size:"small",tooltip:"Graph options",menuItems:[...o.length>0?[{label:"Haplotypes",icon:ct,subMenu:o}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show...",icon:Ze,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:pt,helpText:"Subgraph node limit; node width and path colors; the force-directed layout engine",onClick:()=>{$(e).queueDialog(i=>[ut,{model:e,onClose:i}])}},{type:"divider"},{label:"Close graph",icon:It,onClick:()=>{e.clearGraph()}}],children:n(Gt,{})})}),Tt=xn;var Sn=D()({formControl:{minWidth:130,maxWidth:260}}),Pn=h(function({model:e}){let{classes:o}=Sn(),i=Ie(),{walkChoices:a}=e;if(a.length===0||!e.liftsWalks)return null;let p=new Set(a.map(s=>s.name)),c=new Map(a.map(s=>[s.name,s.label])),l=e.walkLayers.map(s=>s.walk).filter(s=>p.has(s));return a.length>Ke?n(Pe,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{$(e).queueDialog(s=>[je,{model:e,onClose:s}])},children:l.length>0?`${l.length} of ${a.length} haplotypes`:"Highlight haplotypes..."}):f(ke,{size:"small",className:o.formControl,children:[n(Re,{id:i,children:"Highlight"}),n(Ee,{labelId:i,multiple:!0,value:l,label:"Highlight","data-testid":"graph-walk-select",renderValue:s=>s.map(d=>c.get(d)).join(", "),onChange:s=>{let{value:d}=s.target;e.liftAmongChoices(typeof d=="string"?d.split(","):d)},children:a.map(({name:s,label:d})=>f(Le,{value:s,dense:!0,children:[n(Me,{size:"small",checked:l.includes(s)}),n(Ce,{primary:d})]},s))})]})}),Ht=Pn;var Mn=D()({toolbar:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),kn=h(function({model:e}){return n(Y,{variant:"body2",children:e.zoomPercent})}),Rn=h(function({model:e}){let{classes:o}=Mn(),i=a=>{e.zoom(a,e.viewBox.width/2,e.viewBox.height/2)};return f("div",{className:o.toolbar,children:[n(Lt,{model:e}),n(kt,{model:e}),n(Ht,{model:e}),n(Et,{model:e}),n(U,{title:"Zoom in",children:n(q,{size:"small",onClick:()=>{i(1.5)},children:n(Pt,{})})}),n(U,{title:"Zoom out",children:n(q,{size:"small",onClick:()=>{i(1/1.5)},children:n(Mt,{})})}),n(U,{title:"Zoom to fit",children:n(q,{size:"small",onClick:()=>{e.refitView()},children:n(St,{})})}),n(kn,{model:e}),n(Ct,{model:e}),n(Tt,{model:e})]})}),At=Rn;var Cn={position:"absolute",bottom:Ue,lineHeight:"normal",background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6};function me({label:t,readout:e}){return f(L,{children:[n("strong",{children:t})," \u2014 ",e]})}function Ln(t,e){if(e)return{testId:"graph-chip-tooltip",body:me(e)};let o=t.hoveredNode?t.hoverNodeById?.get(t.hoveredNode):void 0;if(o){let c=t.hoverDrawing?.members.get(o.id),l=Be(o);return{body:f(L,{children:[n("strong",{children:o.name}),c?` and ${c.length-1} more`:""," \u2014"," ",o.length.toLocaleString()," bp, depth ",o.depth.toFixed(1),l?f(L,{children:[n("br",{}),l.sample," ",J(l)," (rank ",o.stable?.rank,")"]}):null]})}}let i=t.hoveredEdge===null?void 0:t.graph?.edges[t.hoveredEdge];if(i){let c=Xe(i,t.deletions.find(l=>l.edgeIndex===t.hoveredEdge),l=>t.nodeById?.get(l)?.name??l);return{body:c.deletion?f(L,{children:[n("strong",{children:"Deletion"})," ",c.deletion.bp,n("br",{}),c.deletion.where]}):f(L,{children:["Edge: ",c.ends]})}}let a=t.hoveredWalkRowText;if(a)return{testId:"graph-walk-row-tooltip",body:me(a)};let p=t.hoveredTubeText;return p?{testId:"graph-tube-tooltip",body:me(p)}:void 0}var En=h(function({model:e,chip:o}){let i=Ln(e,o);return i?n("div",{style:{...Cn,right:e.tooltipRightPx},"data-testid":i.testId,children:i.body}):null}),zt=En;var _t=x(n("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var Nt=x(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 Wt=x(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 In={x:0,y:0};function Gn(t,e){let{own:o,reference:i,highlight:a}=t.nodeLaunchTargets(e);return[{label:"Node details",icon:Wt,onClick:()=>{t.showNodeDetails(e)}},...Qe({own:o,reference:i,highlight:a,onShowLinear:p=>{t.showInLinearView(p)},onHighlight:t.canHighlightInLinearView?p=>{t.highlightInLinearView(p)}:void 0})]}function Tn(t,e,o){let i=o??t.walkRowBars,a=t.walkRowLaunchTarget(e,i),p=a?.assembly,c=e>0?i?.rows[e-1]:void 0,l=c?.sample,s=!o&&t.walkRowBars,d=t.walkRowSamples;return[a&&p?{label:`Linear genome view \u2014 ${p} ${J(a.location)}`,icon:ue,onClick:()=>{t.showInLinearView({location:a.location,assembly:p})}}:{label:"Linear genome view",icon:ue,disabled:!0,disabledHelpText:a?`No assembly in this session is ${a.location.haplotype??a.label}`:"This walk states no contig coordinates",onClick:()=>{}},...c&&t.liftsWalks&&t.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${c.label}`,checked:t.walkLayers.some(y=>y.walk===c.name),onClick:()=>{t.toggleWalk(c.name)}}]:[],...s&&l&&!(d?.length===1&&d[0]===l)?[{label:`Show only ${l}`,icon:_t,onClick:()=>{t.setWalkRowSamples([l])}}]:[],...s&&d?[{label:"Show every sample",icon:Nt,onClick:()=>{t.setWalkRowSamples(void 0)}}]:[]]}function Z({model:t,at:e,onClose:o}){return n(xe,{anchor:e,offset:In,onClose:o,menuItems:()=>e===void 0?[]:"nodeId"in e?Gn(t,e.nodeId):Tn(t,e.row,e.bars)})}var Hn={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},An={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},zn=h(function({bars:e,frame:o,ramp:i,rowGenes:a}){let p=ot(),c=Ge(()=>_e(e,o,{ramp:i,rowGenes:a,idPrefix:p}),[e,o,i,a,p]);return n(ne,{el:c})}),_n=h(function({model:e}){let o=e.walkStripRows,i=e.walkStripFrame,a=e.stripHover,p=o?[o.reference,...o.rows]:[],c=a?p.findIndex(y=>y.name===a.row):-1,l=p[c];if(!o||!i||i.labelled||!a||!l)return null;let s=(o.origin+a.offset)*i.scaleX+i.translateX,d=s>i.width/2?{right:i.width-s+12}:{left:s+12};return f("div",{"data-testid":"graph-walk-strip-tip",style:{...An,...d,top:c*i.rowPx+i.translateY-18},children:[l.label," \xB7"," ",Ae(l,c===0?void 0:o.reference)]})}),Nn=h(function({model:e,bars:o,frame:i}){return n(ne,{el:We(o,i,e.walkStripMarks)})}),Wn=h(function({model:e}){let o=e.walkStripRows,i=e.walkStripFrame,[a,p]=R();if(!o||!i)return null;let c=s=>{let d=s.currentTarget.getBoundingClientRect();return Ne(o,i,s.clientX-d.left,s.clientY-d.top)},l=ze(o,{ramp:e.referenceRampDomain,rampCss:He,genes:De(i,e.walkRowGenes,e.walkRowGeneGaps)});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:i.width,height:i.height,style:{display:"block"},onMouseMove:s=>{let d=c(s);s.currentTarget.style.cursor=d&&d.index>0?"pointer":"",e.setStripHover(d?{row:d.row.name,offset:d.offset}:null)},onClick:s=>{let d=c(s);d&&d.index>0&&e.toggleWalk(d.row.name)},onContextMenu:s=>{let d=c(s);d&&(s.preventDefault(),p({clientX:s.clientX,clientY:s.clientY,row:d.index}))},children:[n(zn,{bars:o,frame:i,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),n(Nn,{model:e,bars:o,frame:i}),n(ne,{el:Oe(o,i,new Set(e.walkLayers.map(s=>s.walk)))})]}),n(_n,{model:e}),f("div",{style:Hn,"data-testid":"graph-walk-strip-key",children:[l.map(s=>f("div",{style:re,children:[n(oe,{swatch:rt(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(Z,{model:e,at:a&&{...a,bars:o},onClose:()=>{p(void 0)}})]})}),Ot=Wn;var On=h(function({model:e}){let o=e.walkStripLocator;return o?f(te,{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}),Dt=On;var Dn=1.1,Xn=100,Bn=40,Fn=800,Vn=10,Xt=2;function ge(t){let e=t.deltaY*(t.deltaMode===1?Bn:t.deltaMode===2?Fn:1),o=(t.ctrlKey?Vn:1)*e/Xn;return Dn**-Math.max(-Xt,Math.min(Xt,o))}var Yn=40,Zn=100,jn=24,Bt=Math.log(16);function Kn(t,e){let o=t*Math.exp(-e/jn);return Math.abs(o)<.001?t:t-o}function $n(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 Yt(t,e,o){G(()=>{if(!t)return;let i=-1/0,a={backlog:0,x:0,y:0,frame:0,last:0},p=l=>{let s=Kn(a.backlog,Math.min(100,l-a.last));a.backlog-=s,a.last=l,a.frame=a.backlog?requestAnimationFrame(p):0,I(o)&&o.zoom(Math.exp(s),a.x,a.y)},c=l=>{if(o.hostPlacesX||o.followsHostView)return;let y=((l.target instanceof Element?l.target.closest("canvas"):null)??(o.facetPanels?null:e))?.getBoundingClientRect();if(y&&l.clientY-y.top<o.referenceStripZonePx)return;let w=$n(l,o.host);if(w!=="page"){if(o.host&&l.stopPropagation(),l.preventDefault(),w==="pan"){if(l.timeStamp-i>Zn){let E=l.deltaMode===1?Yn:1;o.setTransform(o.scale,o.translateX-l.deltaX*E,o.translateY)}return}i=l.timeStamp,y&&(a.x=l.clientX-y.left,a.y=l.clientY-y.top,a.backlog=Math.max(-Bt,Math.min(Bt,a.backlog+Math.log(ge(l)))),a.frame||(a.last=performance.now()-1e3/60,a.frame=requestAnimationFrame(p)))}};return t.addEventListener("wheel",c,{passive:!1}),()=>{cancelAnimationFrame(a.frame),t.removeEventListener("wheel",c)}},[t,e,o])}var Ft=3,ve="data-gesture-owner",j=t=>({x:t.clientX,y:t.clientY});function Vt(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 Zt(t){let e=k({x:0,y:0}),o=k({x:0,y:0}),i=k(!1),a=k(void 0),p=r=>a.current!==void 0&&r.pointerId!==a.current,c=k(new Map),l=k(null),s=k(null),d=k(!1),y=k(!1),w=k({frame:0,pan:null,hover:null,pinch:!1});G(()=>()=>{cancelAnimationFrame(w.current.frame)},[]);let[E,z]=R(),[T,A]=R(!1),[O,B]=R(void 0);function F(r){let u=r.currentTarget.getBoundingClientRect();return{x:r.clientX-u.left,y:r.clientY-u.top}}function M(r,u){if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(r,u);let m=t.referenceStripNodeAt(r,u);if(m)return m;let{nodePositions:g}=t;if(!g)return null;let{x:v,y:b}=le(r,u,t,t.axisScale);return ce(g,v,b,t.axisScale,t.positionsVersion,t.nodeInk)}function H(r,u){let{nodePositions:m,graph:g}=t;if(!m||!g)return null;let{x:v,y:b}=le(r,u,t,t.axisScale);return pe(m,g,v,b,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded)}function $t(r){r.button===0&&r.preventDefault()}function qt(r){if(r.button!==0)return;let u=c.current;if(p(r)){t.isPanning&&!y.current&&r.pointerType==="touch"&&u.size===1&&(r.currentTarget.setPointerCapture(r.pointerId),u.set(r.pointerId,j(r)),s.current=Vt(u),i.current=!0);return}i.current=!1,o.current={x:r.clientX,y:r.clientY},r.currentTarget.removeAttribute(ve);let m=t.followsHostView;if(t.hostPlacesX||m&&r.shiftKey)return;r.currentTarget.setPointerCapture(r.pointerId),a.current=r.pointerId,l.current=r.currentTarget,u.clear(),u.set(r.pointerId,j(r));let{x:g,y:v}=F(r),b=v<t.referenceStripZonePx,S=t.layoutResult?.tubeMap||b?null:M(g,v);m&&S&&r.currentTarget.setAttribute(ve,""),y.current=m,d.current=b&&!m,S?t.setDraggingNode(S):t.setPanning(!0),e.current={x:r.clientX,y:r.clientY}}function ye(){let r=s.current,u=l.current;if(!r||!u)return;let m=Vt(c.current),g=u.getBoundingClientRect();r.spread>0&&m.spread>0&&t.zoom(m.spread/r.spread,r.mid.x-g.left,r.mid.y-g.top),t.setTransform(t.scale,t.translateX+m.mid.x-r.mid.x,t.translateY+m.mid.y-r.mid.y),s.current=m}function Ut(){let r=w.current,{pan:u,hover:m,pinch:g}=r;if(r.frame=0,r.pan=null,r.hover=null,r.pinch=!1,g&&ye(),u&&d.current?t.host?.horizontalScroll(-u.dx):u&&y.current?t.setTransform(t.scale,t.translateX,t.translateY+u.dy):u&&t.setTransform(t.scale,t.translateX+u.dx,t.translateY+u.dy),!m)return;let{x:v,y:b}=m,S=t.facetPanels?void 0:dt(t.overlayLabels,v,b);B(P=>P?.label===S?.label&&P?.readout===S?.readout?P:S);let C=t.walkRowBars;if(C){let P=t.walkRowAt(v,b);t.setHoveredWalkRow(P===void 0?null:[C.reference,...C.rows][P].name)}if(t.nodePositions&&t.graph){let P=M(v,b);t.setHoveredPanel(t.tubeMapPanelAt(b)),t.setHoveredNode(P,{x:v,y:b}),A(P!==null&&!t.hostPlacesX&&!t.layoutResult?.tubeMap&&b>=t.referenceStripZonePx),t.setHoveredTube(P===null&&t.layoutResult?.tubeMap?t.tubeAt(v,b):null),t.setHoveredEdge(P||t.layoutResult?.tubeMap||!t.hoverLightsEverything?null:H(v,b))}}function K(){w.current.frame||(w.current.frame=requestAnimationFrame(Ut))}function Jt(){let r=w.current;cancelAnimationFrame(r.frame),r.frame=0,r.pan=null,r.hover=null,r.pinch=!1}function Qt(r){let u=c.current;if(s.current&&u.has(r.pointerId)){u.set(r.pointerId,j(r)),w.current.pinch=!0,K();return}if(p(r))return;let m=r.clientX-e.current.x,g=r.clientY-e.current.y;e.current={x:r.clientX,y:r.clientY},Math.hypot(r.clientX-o.current.x,r.clientY-o.current.y)>Ft&&(i.current=!0);let v=w.current;if(t.draggingNode)t.moveNode(t.draggingNode,m/t.scaleX,g/t.scaleY);else if(t.isPanning)v.pan={dx:(v.pan?.dx??0)+m,dy:(v.pan?.dy??0)+g},K();else{let b=r.currentTarget.getBoundingClientRect();v.hover={x:r.clientX-b.left,y:r.clientY-b.top},K()}}function ie(r){let u=c.current;if(s.current&&u.has(r.pointerId)){w.current.pinch&&(w.current.pinch=!1,ye()),u.delete(r.pointerId),s.current=null;let[[m,g]]=[...u];a.current=m,e.current=g;return}p(r)||(a.current=void 0,u.clear(),I(t)&&t.stopDragging())}function en(r){p(r)||(a.current=void 0,c.current.clear(),s.current=null,Jt(),B(void 0),A(!1),I(t)&&(t.stopDragging(),t.clearHover()))}function tn(r){let{x:u,y:m}=F(r),g=M(u,m),{clientX:v,clientY:b}=r;if(g){r.preventDefault(),z({clientX:v,clientY:b,nodeId:g});return}let S=t.walkRowAt(u,m);S!==void 0&&(r.preventDefault(),z({clientX:v,clientY:b,row:S}))}function nn(r){if(!i.current){let{x:u,y:m}=F(r),g=M(u,m);t.setSelectedNode(g),g&&t.showNodeDetails(g)}}let _=k(null);G(()=>()=>{_.current?.end()},[]);function on(r){if(r.button!==0||t.hostPlacesX||t.followsHostView||!(r.target instanceof Element)||!r.target.closest(`[${et}]`))return;_.current?.end();let u=r.pointerId,m=j(r),g=m,v={moved:!1,end:()=>{window.removeEventListener("pointermove",b,!0),window.removeEventListener("pointerup",S,!0),window.removeEventListener("pointercancel",S,!0),v.moved&&I(t)&&t.stopDragging()}};function b(C){if(C.pointerId!==u)return;if(!v.moved){if(Math.hypot(C.clientX-m.x,C.clientY-m.y)<=Ft)return;v.moved=!0,t.setPanning(!0)}let P=w.current;P.pan={dx:(P.pan?.dx??0)+C.clientX-g.x,dy:(P.pan?.dy??0)+C.clientY-g.y},g=j(C),K()}function S(C){C.pointerId===u&&(v.end(),setTimeout(()=>{_.current===v&&(_.current=null)},0))}_.current=v,window.addEventListener("pointermove",b,!0),window.addEventListener("pointerup",S,!0),window.addEventListener("pointercancel",S,!0)}function rn(r){_.current?.moved&&(_.current=null,r.stopPropagation())}let an={cursor:t.isPanning||t.draggingNode?"grabbing":T?"move":"grab",touchAction:t.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},sn=t.host!==void 0&&!t.hostPlacesX&&!t.followsHostView?{[ve]:"",onMouseDown:r=>{r.stopPropagation()}}:{};return{canvasStyle:an,surfaceProps:sn,handlers:{onMouseDown:$t,onPointerDown:qt,onPointerMove:Qt,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onPointerLeave:en,onClick:nn,onContextMenu:tn},contextMenu:E,hoveredChip:O,labelHandlers:{onPointerDown:on,onClickCapture:rn},closeContextMenu:()=>{z(void 0)}}}function jt(t){return Promise.resolve(new N(t))}var qn={position:"relative"},Un={position:"relative",lineHeight:0,isolation:"isolate"},Jn={position:"absolute",left:0,right:0,bottom:0,zIndex:0},Qn={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},eo={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},to=h(function({model:e}){return n(L,{children:e.visibleRowLabels.map(({label:o,y:i,top:a})=>n("div",{"data-testid":"graph-row-label",style:{...eo,top:a},children:o},i))})}),no={position:"absolute",top:ee,right:ee,display:"flex",flexDirection:"column",borderRadius:3,overflow:"hidden",zIndex:4},Kt={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},oo={...Kt,color:"#18181c",fontWeight:600},ro=h(function({model:e}){let o=k(null),i=e.legendAtRest;return G(()=>{let a=o.current;if(!a||!i)return;let p=()=>{I(e)&&e.legendAtRest&&e.setLegendSize({width:a.offsetWidth,height:a.offsetHeight})};p();let c=new ResizeObserver(p);return c.observe(a),()=>{c.disconnect()}},[e,i]),n("div",{ref:o,style:{...no,top:ee+e.referenceStripZonePx},children:n(wt,{model:e})})}),ao=h(function({model:e}){let o=e.overlayLabels.sizes,i=o.flatMap(({key:a,leader:p})=>p?[{key:a,...p}]:[]);return f(L,{children:[i.length>0?n(te,{model:e,zIndex:2,overflow:"visible",children:i.map(({key:a,arcX:p,arcY:c,labelX:l,labelY:s})=>n("line",{"data-testid":"graph-label-leader",x1:p,y1:c,x2:l,y2:s,stroke:"#18181c",strokeWidth:1},a))}):null,o.map(({key:a,text:p,x:c,y:l,kind:s})=>n("div",{"data-testid":"graph-size-label",style:{...s==="deletion"?oo:Kt,left:c,top:l},children:p},a))]})}),io=h(function({model:e,ownChrome:o=!0}){let{canvasRef:i,canvas:a,error:p,retry:c}=vt(jt,e),{handlers:l,canvasStyle:s,surfaceProps:d,labelHandlers:y,contextMenu:w,closeContextMenu:E,hoveredChip:z}=Zt(e),[T,A]=R(null);Yt(T,a,e);let O=e.facetPanels!==void 0;return f("div",{style:qn,...d,children:[o?n(At,{model:e}):null,f("div",{ref:A,style:Un,...y,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{I(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?n("div",{style:{...Jn,top:e.referenceStripZonePx,background:Q}}):null,n("canvas",{ref:i,"data-testid":"graph-genome-canvas",style:{...s,width:e.paneWidth,height:e.canvasHeight,display:"block",position:"relative",zIndex:1},...l}),O?n(xt,{model:e,handlers:l,canvasStyle:s}):f(L,{children:[n(mt,{model:e}),n(fe,{model:e}),n(ht,{model:e}),n(to,{model:e}),n(ao,{model:e}),n(nt,{model:e}),n(lt,{model:e}),n(ft,{model:e}),n(gt,{model:e}),n(Dt,{model:e}),n(ro,{model:e})]}),o?n("div",{style:Qn,children:n(Se,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null,n(zt,{model:e,chip:z})]}),e.walkStripShown?n(Ot,{model:e}):null,n(Z,{model:e,at:w,onClose:E}),p?n(se,{error:p,onReset:c}):null,o&&e.error?n(se,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),zi=io;export{zi as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as X,b as ut}from"./chunk-DUR437TH.js";import{a as et,b as tt,c as te,d as nt,e as ot,f as ne,h as rt,i as at,j as it,k as st,m as oe,n as lt,o as dt,p as ft,r as ht,t as mt,u as gt}from"./chunk-RFDSEB2X.js";import{N as Ue,O as Je,R as ue,T as Qe,U as ct,V as pt,a as x,c as Te,h as Ne,i as We,j as Oe,k as De,l as J,m as Xe,n as Be,w as Fe,x as Ze}from"./chunk-N74HGPAW.js";import{n as D}from"./chunk-DBPEUVUC.js";import{E as ze,Eb as N,Jb as ce,L as _e,Lb as pe,M as Ve,N as Ye,Nb as ee,a as V,b as be,da as le,dc as qe,ha as Q,la as je,na as Ke,x as Ae,xa as $e}from"./chunk-PYQG3JHP.js";import{k as He}from"./chunk-2M4XYSLG.js";import{e as I}from"./chunk-NDRLCGPC.js";import{j as $}from"./chunk-TENPGIPX.js";import{d as G,e as Ie,f as Ge,g as k,h as R}from"./chunk-YU7T5WOQ.js";import{D as Ee,G as U,H as Y,b as we,c as xe,e as se,k as Se,o as Pe,p as Me,s as ke,v as q,w as Re,y as Ce,z as Le}from"./chunk-UGCNPRKC.js";import{a as L,b as n,c as f,d as h}from"./chunk-JMBDTNUR.js";var W=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],ln=t=>W!=null&&t in Object(W)?W[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 vt=ln("useRenderingBackend"),lo=W&&W.__esModule?W.default:W;var de=tt(1);function fe({model:t}){let[e,o]=R(null);return G(()=>{if(!e)return;let i=new N(e),a=V(()=>{$e(qe()),i.resize(t.paneWidth,t.canvasHeight),t.paintHover(i,t.drawnBatch)});return()=>{a(),i.dispose()}},[e,t]),n("canvas",{ref:o,"data-testid":"graph-hover-layer",style:de})}var yt={background:"rgba(255,255,255,0.82)",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},re={display:"flex",alignItems:"center",gap:5},bt={color:"#666"};function ae({row:t,at:e,hint:o,after:i}){return t.swatch?f("div",{title:[t.title,o].filter(Boolean).join(" \xB7 ")||void 0,children:[f("div",{style:re,children:[n(oe,{swatch:t.swatch}),f("span",{children:[t.strong?n("strong",{children:t.strong}):null,t.label]}),i]}),e?n("div",{"data-testid":"graph-walk-at",children:e}):t.under?n("div",{children:t.under}):null]}):n("div",{style:bt,children:t.label})}var cn={pointerEvents:"auto",cursor:"pointer",border:"none",background:"none",padding:"0 2px",font:"inherit",textDecoration:"underline"},wt=h(function({model:e}){return n(L,{children:st(e).map(({testid:o,rows:i})=>n("div",{style:yt,"data-testid":o,children:i.map(a=>n(ae,{row:a,at:a.walk?e.hoveredOn(a.walk):void 0,after:a.closesBubble?n("button",{type:"button",style:cn,"data-testid":"graph-close-bubble",onClick:()=>{e.closeBubbles()},children:"close"}):null},a.key))},o))})});var pn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:Ve,lineHeight:"normal"},un={height:Ye,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},dn={position:"relative"},fn={gridColumn:"1 / -1",height:Je,padding:"2px 6px",boxSizing:"border-box",display:"flex",gap:14,fontSize:11,lineHeight:"15px"},hn=h(function({model:e,lift:o,width:i,height:a,cell:p,handlers:c,canvasStyle:l}){let[s,d]=R(null),[y,w]=R(null),E=o.walks[0];G(()=>{if(!s||!y)return;let T=new N(s),A=new N(y),O=be(()=>e.buildDrawing(o,!1)),B,F=[V(()=>{let M=e.facetGrid;M&&T.resize(M.width,M.height);let H=O.get();H&&(H!==B&&(T.uploadGeometry(H.batch),B=H),e.applySelection(T),e.paint(T))}),V(()=>{let M=e.facetGrid;M&&A.resize(M.width,M.height);let H=O.get();H&&e.paintHover(A,H.batch)})];return()=>{for(let M of F)M();T.dispose(),A.dispose()}},[s,y,e,o]);let z=e.walkLabel(E.name);return f("div",{style:p,children:[n("button",{type:"button",style:un,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([E.name]),e.setFacet("")},children:n(ae,{row:at(e,E),hint:`click to lift ${z} alone`,at:e.hoveredOn(E)})}),f("div",{style:dn,children:[n("canvas",{ref:d,"data-testid":"graph-facet-canvas",style:{...l,width:i,height:a,display:"block"},...c}),n("canvas",{ref:w,style:de})]})]})}),mn=h(function({model:e,handlers:o,canvasStyle:i}){let a=e.facetPanels,p=e.facetGrid,c=e.facetPlacement;if(!a||!p||!c)return null;let{columns:l,width:s,height:d}=p;return f("div",{"data-testid":"graph-facet-panels",style:{...pn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${l}, ${s}px)`,background:Q},children:[a.map((y,w)=>n(hn,{model:e,lift:y,width:s,height:d,cell:{gridRow:Math.floor(c.cells[w]/l)+1,gridColumn:c.cells[w]%l+1},handlers:o,canvasStyle:i},y.walks[0].name)),n("div",{style:{...fn,gridRow:Math.floor(Math.max(...c.cells)/l)+2},"data-testid":"graph-facet-key",children:it(e).map(y=>n(ae,{row:y},y.key))})]})}),xt=mn;var St=x(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 Pt=x([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 Mt=x(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 gn=h(function({model:e}){let o=e.colorSchemeLock;return n(X,{label:"Color",size:"small",sx:{minWidth:100},disabled:o!==void 0,title:o?.why,shown:o?.value,value:e.chosenColorScheme,options:Fe.map(({value:i})=>({value:i,label:e.colorSchemeLabel(i)})),testId:"graph-color-select",onChange:i=>{e.setColorScheme(i)}})}),kt=gn;var Rt=D()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function he(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var vn=h(function({model:e}){let{classes:o}=Rt(),{lastFetchMs:i,lastLayoutMs:a,lastGeometryMs:p}=e,c=i!==void 0||a!==void 0||p!==void 0;return e.showPerf&&c?f(Y,{variant:"caption",className:o.perf,"data-testid":"graph-perf-stats",children:["fetch ",he(i)," \xB7 layout ",he(a)," \xB7 geom"," ",he(p)]}):null}),yn=h(function({model:e}){let{classes:o}=Rt();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(Y,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",n(vn,{model:e})]})}),Ct=yn;var bn=h(function({model:e}){let{graph:o}=e;return n(X,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:Te.map(({value:i,label:a,description:p,available:c})=>({value:i,label:a,description:p,disabled:o?!c(o):!1})),onChange:i=>{e.switchLayout(i)}})}),Lt=bn;var wn=h(function({model:e}){return e.chosenLayoutMode!=="walkrows"||e.repeatChoices.length===0?null:n(X,{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)}})}),Et=wn;var It=x(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 Gt=x(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 xn=h(function({model:e}){let o=e.highlightMenuItems({picks:!1});return n(we,{size:"small",tooltip:"Graph options",menuItems:[...o.length>0?[{label:"Haplotypes",icon:ct,subMenu:o}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show...",icon:Ze,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:pt,helpText:"Subgraph node limit; node width and path colors; the force-directed layout engine",onClick:()=>{$(e).queueDialog(i=>[ut,{model:e,onClose:i}])}},{type:"divider"},{label:"Close graph",icon:It,onClick:()=>{e.clearGraph()}}],children:n(Gt,{})})}),Tt=xn;var Sn=D()({formControl:{minWidth:130,maxWidth:260}}),Pn=h(function({model:e}){let{classes:o}=Sn(),i=Ie(),{walkChoices:a}=e;if(a.length===0||!e.liftsWalks)return null;let p=new Set(a.map(s=>s.name)),c=new Map(a.map(s=>[s.name,s.label])),l=e.walkLayers.map(s=>s.walk).filter(s=>p.has(s));return a.length>Ke?n(Pe,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{$(e).queueDialog(s=>[je,{model:e,onClose:s}])},children:l.length>0?`${l.length} of ${a.length} haplotypes`:"Highlight haplotypes..."}):f(ke,{size:"small",className:o.formControl,children:[n(Re,{id:i,children:"Highlight"}),n(Ee,{labelId:i,multiple:!0,value:l,label:"Highlight","data-testid":"graph-walk-select",renderValue:s=>s.map(d=>c.get(d)).join(", "),onChange:s=>{let{value:d}=s.target;e.liftAmongChoices(typeof d=="string"?d.split(","):d)},children:a.map(({name:s,label:d})=>f(Le,{value:s,dense:!0,children:[n(Me,{size:"small",checked:l.includes(s)}),n(Ce,{primary:d})]},s))})]})}),Ht=Pn;var Mn=D()({toolbar:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),kn=h(function({model:e}){return n(Y,{variant:"body2",children:e.zoomPercent})}),Rn=h(function({model:e}){let{classes:o}=Mn(),i=a=>{e.zoom(a,e.viewBox.width/2,e.viewBox.height/2)};return f("div",{className:o.toolbar,children:[n(Lt,{model:e}),n(kt,{model:e}),n(Ht,{model:e}),n(Et,{model:e}),n(U,{title:"Zoom in",children:n(q,{size:"small",onClick:()=>{i(1.5)},children:n(Pt,{})})}),n(U,{title:"Zoom out",children:n(q,{size:"small",onClick:()=>{i(1/1.5)},children:n(Mt,{})})}),n(U,{title:"Zoom to fit",children:n(q,{size:"small",onClick:()=>{e.refitView()},children:n(St,{})})}),n(kn,{model:e}),n(Ct,{model:e}),n(Tt,{model:e})]})}),At=Rn;var Cn={position:"absolute",bottom:Ue,lineHeight:"normal",background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6};function me({label:t,readout:e}){return f(L,{children:[n("strong",{children:t})," \u2014 ",e]})}function Ln(t,e){if(e)return{testId:"graph-chip-tooltip",body:me(e)};let o=t.hoveredNode?t.hoverNodeById?.get(t.hoveredNode):void 0;if(o){let c=t.hoverDrawing?.members.get(o.id),l=Be(o);return{body:f(L,{children:[n("strong",{children:o.name}),c?` and ${c.length-1} more`:""," \u2014"," ",o.length.toLocaleString()," bp, depth ",o.depth.toFixed(1),l?f(L,{children:[n("br",{}),l.sample," ",J(l)," (rank ",o.stable?.rank,")"]}):null]})}}let i=t.hoveredEdge===null?void 0:t.graph?.edges[t.hoveredEdge];if(i){let c=Xe(i,t.deletions.find(l=>l.edgeIndex===t.hoveredEdge),l=>t.nodeById?.get(l)?.name??l);return{body:c.deletion?f(L,{children:[n("strong",{children:"Deletion"})," ",c.deletion.bp,n("br",{}),c.deletion.where]}):f(L,{children:["Edge: ",c.ends]})}}let a=t.hoveredWalkRowText;if(a)return{testId:"graph-walk-row-tooltip",body:me(a)};let p=t.hoveredTubeText;return p?{testId:"graph-tube-tooltip",body:me(p)}:void 0}var En=h(function({model:e,chip:o}){let i=Ln(e,o);return i?n("div",{style:{...Cn,right:e.tooltipRightPx},"data-testid":i.testId,children:i.body}):null}),zt=En;var _t=x(n("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var Nt=x(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 Wt=x(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 In={x:0,y:0};function Gn(t,e){let{own:o,reference:i,highlight:a}=t.nodeLaunchTargets(e);return[{label:"Node details",icon:Wt,onClick:()=>{t.showNodeDetails(e)}},...Qe({own:o,reference:i,highlight:a,onShowLinear:p=>{t.showInLinearView(p)},onHighlight:t.canHighlightInLinearView?p=>{t.highlightInLinearView(p)}:void 0})]}function Tn(t,e,o){let i=o??t.walkRowBars,a=t.walkRowLaunchTarget(e,i),p=a?.assembly,c=e>0?i?.rows[e-1]:void 0,l=c?.sample,s=!o&&t.walkRowBars,d=t.walkRowSamples;return[a&&p?{label:`Linear genome view \u2014 ${p} ${J(a.location)}`,icon:ue,onClick:()=>{t.showInLinearView({location:a.location,assembly:p})}}:{label:"Linear genome view",icon:ue,disabled:!0,disabledHelpText:a?`No assembly in this session is ${a.location.haplotype??a.label}`:"This walk states no contig coordinates",onClick:()=>{}},...c&&t.liftsWalks&&t.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${c.label}`,checked:t.walkLayers.some(y=>y.walk===c.name),onClick:()=>{t.toggleWalk(c.name)}}]:[],...s&&l&&!(d?.length===1&&d[0]===l)?[{label:`Show only ${l}`,icon:_t,onClick:()=>{t.setWalkRowSamples([l])}}]:[],...s&&d?[{label:"Show every sample",icon:Nt,onClick:()=>{t.setWalkRowSamples(void 0)}}]:[]]}function Z({model:t,at:e,onClose:o}){return n(xe,{anchor:e,offset:In,onClose:o,menuItems:()=>e===void 0?[]:"nodeId"in e?Gn(t,e.nodeId):Tn(t,e.row,e.bars)})}var Hn={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},An={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},zn=h(function({bars:e,frame:o,ramp:i,rowGenes:a}){let p=ot(),c=Ge(()=>_e(e,o,{ramp:i,rowGenes:a,idPrefix:p}),[e,o,i,a,p]);return n(ne,{el:c})}),_n=h(function({model:e}){let o=e.walkStripRows,i=e.walkStripFrame,a=e.stripHover,p=o?[o.reference,...o.rows]:[],c=a?p.findIndex(y=>y.name===a.row):-1,l=p[c];if(!o||!i||i.labelled||!a||!l)return null;let s=(o.origin+a.offset)*i.scaleX+i.translateX,d=s>i.width/2?{right:i.width-s+12}:{left:s+12};return f("div",{"data-testid":"graph-walk-strip-tip",style:{...An,...d,top:c*i.rowPx+i.translateY-18},children:[l.label," \xB7"," ",Ae(l,c===0?void 0:o.reference)]})}),Nn=h(function({model:e,bars:o,frame:i}){return n(ne,{el:We(o,i,e.walkStripMarks)})}),Wn=h(function({model:e}){let o=e.walkStripRows,i=e.walkStripFrame,[a,p]=R();if(!o||!i)return null;let c=s=>{let d=s.currentTarget.getBoundingClientRect();return Ne(o,i,s.clientX-d.left,s.clientY-d.top)},l=ze(o,{ramp:e.referenceRampDomain,rampCss:He,genes:De(i,e.walkRowGenes,e.walkRowGeneGaps)});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:i.width,height:i.height,style:{display:"block"},onMouseMove:s=>{let d=c(s);s.currentTarget.style.cursor=d&&d.index>0?"pointer":"",e.setStripHover(d?{row:d.row.name,offset:d.offset}:null)},onClick:s=>{let d=c(s);d&&d.index>0&&e.toggleWalk(d.row.name)},onContextMenu:s=>{let d=c(s);d&&(s.preventDefault(),p({clientX:s.clientX,clientY:s.clientY,row:d.index}))},children:[n(zn,{bars:o,frame:i,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),n(Nn,{model:e,bars:o,frame:i}),n(ne,{el:Oe(o,i,new Set(e.walkLayers.map(s=>s.walk)))})]}),n(_n,{model:e}),f("div",{style:Hn,"data-testid":"graph-walk-strip-key",children:[l.map(s=>f("div",{style:re,children:[n(oe,{swatch:rt(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(Z,{model:e,at:a&&{...a,bars:o},onClose:()=>{p(void 0)}})]})}),Ot=Wn;var On=h(function({model:e}){let o=e.walkStripLocator;return o?f(te,{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}),Dt=On;var Dn=1.1,Xn=100,Bn=40,Fn=800,Vn=10,Xt=2;function ge(t){let e=t.deltaY*(t.deltaMode===1?Bn:t.deltaMode===2?Fn:1),o=(t.ctrlKey?Vn:1)*e/Xn;return Dn**-Math.max(-Xt,Math.min(Xt,o))}var Yn=40,Zn=100,jn=24,Bt=Math.log(16);function Kn(t,e){let o=t*Math.exp(-e/jn);return Math.abs(o)<.001?t:t-o}function $n(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 Yt(t,e,o){G(()=>{if(!t)return;let i=-1/0,a={backlog:0,x:0,y:0,frame:0,last:0},p=l=>{let s=Kn(a.backlog,Math.min(100,l-a.last));a.backlog-=s,a.last=l,a.frame=a.backlog?requestAnimationFrame(p):0,I(o)&&o.zoom(Math.exp(s),a.x,a.y)},c=l=>{if(o.hostPlacesX||o.followsHostView)return;let y=((l.target instanceof Element?l.target.closest("canvas"):null)??(o.facetPanels?null:e))?.getBoundingClientRect();if(y&&l.clientY-y.top<o.referenceStripZonePx)return;let w=$n(l,o.host);if(w!=="page"){if(o.host&&l.stopPropagation(),l.preventDefault(),w==="pan"){if(l.timeStamp-i>Zn){let E=l.deltaMode===1?Yn:1;o.setTransform(o.scale,o.translateX-l.deltaX*E,o.translateY)}return}i=l.timeStamp,y&&(a.x=l.clientX-y.left,a.y=l.clientY-y.top,a.backlog=Math.max(-Bt,Math.min(Bt,a.backlog+Math.log(ge(l)))),a.frame||(a.last=performance.now()-1e3/60,a.frame=requestAnimationFrame(p)))}};return t.addEventListener("wheel",c,{passive:!1}),()=>{cancelAnimationFrame(a.frame),t.removeEventListener("wheel",c)}},[t,e,o])}var Ft=3,ve="data-gesture-owner",j=t=>({x:t.clientX,y:t.clientY});function Vt(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 Zt(t){let e=k({x:0,y:0}),o=k({x:0,y:0}),i=k(!1),a=k(void 0),p=r=>a.current!==void 0&&r.pointerId!==a.current,c=k(new Map),l=k(null),s=k(null),d=k(!1),y=k(!1),w=k({frame:0,pan:null,hover:null,pinch:!1});G(()=>()=>{cancelAnimationFrame(w.current.frame)},[]);let[E,z]=R(),[T,A]=R(!1),[O,B]=R(void 0);function F(r){let u=r.currentTarget.getBoundingClientRect();return{x:r.clientX-u.left,y:r.clientY-u.top}}function M(r,u){if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(r,u);let m=t.referenceStripNodeAt(r,u);if(m)return m;let{nodePositions:g}=t;if(!g)return null;let{x:v,y:b}=le(r,u,t,t.axisScale);return ce(g,v,b,t.axisScale,t.positionsVersion,t.nodeInk)}function H(r,u){let{nodePositions:m,graph:g}=t;if(!m||!g)return null;let{x:v,y:b}=le(r,u,t,t.axisScale);return pe(m,g,v,b,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded)}function $t(r){r.button===0&&r.preventDefault()}function qt(r){if(r.button!==0)return;let u=c.current;if(p(r)){t.isPanning&&!y.current&&r.pointerType==="touch"&&u.size===1&&(r.currentTarget.setPointerCapture(r.pointerId),u.set(r.pointerId,j(r)),s.current=Vt(u),i.current=!0);return}i.current=!1,o.current={x:r.clientX,y:r.clientY},r.currentTarget.removeAttribute(ve);let m=t.followsHostView;if(t.hostPlacesX||m&&r.shiftKey)return;r.currentTarget.setPointerCapture(r.pointerId),a.current=r.pointerId,l.current=r.currentTarget,u.clear(),u.set(r.pointerId,j(r));let{x:g,y:v}=F(r),b=v<t.referenceStripZonePx,S=t.layoutResult?.tubeMap||b?null:M(g,v);m&&S&&r.currentTarget.setAttribute(ve,""),y.current=m,d.current=b&&!m,S?t.setDraggingNode(S):t.setPanning(!0),e.current={x:r.clientX,y:r.clientY}}function ye(){let r=s.current,u=l.current;if(!r||!u)return;let m=Vt(c.current),g=u.getBoundingClientRect();r.spread>0&&m.spread>0&&t.zoom(m.spread/r.spread,r.mid.x-g.left,r.mid.y-g.top),t.setTransform(t.scale,t.translateX+m.mid.x-r.mid.x,t.translateY+m.mid.y-r.mid.y),s.current=m}function Ut(){let r=w.current,{pan:u,hover:m,pinch:g}=r;if(r.frame=0,r.pan=null,r.hover=null,r.pinch=!1,g&&ye(),u&&d.current?t.host?.horizontalScroll(-u.dx):u&&y.current?t.setTransform(t.scale,t.translateX,t.translateY+u.dy):u&&t.setTransform(t.scale,t.translateX+u.dx,t.translateY+u.dy),!m)return;let{x:v,y:b}=m,S=t.facetPanels?void 0:dt(t.overlayLabels,v,b);B(P=>P?.label===S?.label&&P?.readout===S?.readout?P:S);let C=t.walkRowBars;if(C){let P=t.walkRowAt(v,b);t.setHoveredWalkRow(P===void 0?null:[C.reference,...C.rows][P].name)}if(t.nodePositions&&t.graph){let P=M(v,b);t.setHoveredPanel(t.tubeMapPanelAt(b)),t.setHoveredNode(P,{x:v,y:b}),A(P!==null&&!t.hostPlacesX&&!t.layoutResult?.tubeMap&&b>=t.referenceStripZonePx),t.setHoveredTube(P===null&&t.layoutResult?.tubeMap?t.tubeAt(v,b):null),t.setHoveredEdge(P||t.layoutResult?.tubeMap||!t.hoverLightsEverything?null:H(v,b))}}function K(){w.current.frame||(w.current.frame=requestAnimationFrame(Ut))}function Jt(){let r=w.current;cancelAnimationFrame(r.frame),r.frame=0,r.pan=null,r.hover=null,r.pinch=!1}function Qt(r){let u=c.current;if(s.current&&u.has(r.pointerId)){u.set(r.pointerId,j(r)),w.current.pinch=!0,K();return}if(p(r))return;let m=r.clientX-e.current.x,g=r.clientY-e.current.y;e.current={x:r.clientX,y:r.clientY},Math.hypot(r.clientX-o.current.x,r.clientY-o.current.y)>Ft&&(i.current=!0);let v=w.current;if(t.draggingNode)t.moveNode(t.draggingNode,m/t.scaleX,g/t.scaleY);else if(t.isPanning)v.pan={dx:(v.pan?.dx??0)+m,dy:(v.pan?.dy??0)+g},K();else{let b=r.currentTarget.getBoundingClientRect();v.hover={x:r.clientX-b.left,y:r.clientY-b.top},K()}}function ie(r){let u=c.current;if(s.current&&u.has(r.pointerId)){w.current.pinch&&(w.current.pinch=!1,ye()),u.delete(r.pointerId),s.current=null;let[[m,g]]=[...u];a.current=m,e.current=g;return}p(r)||(a.current=void 0,u.clear(),I(t)&&t.stopDragging())}function en(r){p(r)||(a.current=void 0,c.current.clear(),s.current=null,Jt(),B(void 0),A(!1),I(t)&&(t.stopDragging(),t.clearHover()))}function tn(r){let{x:u,y:m}=F(r),g=M(u,m),{clientX:v,clientY:b}=r;if(g){r.preventDefault(),z({clientX:v,clientY:b,nodeId:g});return}let S=t.walkRowAt(u,m);S!==void 0&&(r.preventDefault(),z({clientX:v,clientY:b,row:S}))}function nn(r){if(!i.current){let{x:u,y:m}=F(r),g=M(u,m);t.setSelectedNode(g),g&&t.showNodeDetails(g)}}let _=k(null);G(()=>()=>{_.current?.end()},[]);function on(r){if(r.button!==0||t.hostPlacesX||t.followsHostView||!(r.target instanceof Element)||!r.target.closest(`[${et}]`))return;_.current?.end();let u=r.pointerId,m=j(r),g=m,v={moved:!1,end:()=>{window.removeEventListener("pointermove",b,!0),window.removeEventListener("pointerup",S,!0),window.removeEventListener("pointercancel",S,!0),v.moved&&I(t)&&t.stopDragging()}};function b(C){if(C.pointerId!==u)return;if(!v.moved){if(Math.hypot(C.clientX-m.x,C.clientY-m.y)<=Ft)return;v.moved=!0,t.setPanning(!0)}let P=w.current;P.pan={dx:(P.pan?.dx??0)+C.clientX-g.x,dy:(P.pan?.dy??0)+C.clientY-g.y},g=j(C),K()}function S(C){C.pointerId===u&&(v.end(),setTimeout(()=>{_.current===v&&(_.current=null)},0))}_.current=v,window.addEventListener("pointermove",b,!0),window.addEventListener("pointerup",S,!0),window.addEventListener("pointercancel",S,!0)}function rn(r){_.current?.moved&&(_.current=null,r.stopPropagation())}let an={cursor:t.isPanning||t.draggingNode?"grabbing":T?"move":"grab",touchAction:t.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},sn=t.host!==void 0&&!t.hostPlacesX&&!t.followsHostView?{[ve]:"",onMouseDown:r=>{r.stopPropagation()}}:{};return{canvasStyle:an,surfaceProps:sn,handlers:{onMouseDown:$t,onPointerDown:qt,onPointerMove:Qt,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onPointerLeave:en,onClick:nn,onContextMenu:tn},contextMenu:E,hoveredChip:O,labelHandlers:{onPointerDown:on,onClickCapture:rn},closeContextMenu:()=>{z(void 0)}}}function jt(t){return Promise.resolve(new N(t))}var qn={position:"relative"},Un={position:"relative",lineHeight:0,isolation:"isolate"},Jn={position:"absolute",left:0,right:0,bottom:0,zIndex:0},Qn={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},eo={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},to=h(function({model:e}){return n(L,{children:e.visibleRowLabels.map(({label:o,y:i,top:a})=>n("div",{"data-testid":"graph-row-label",style:{...eo,top:a},children:o},i))})}),no={position:"absolute",top:ee,right:ee,display:"flex",flexDirection:"column",borderRadius:3,overflow:"hidden",zIndex:4},Kt={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},oo={...Kt,color:"#18181c",fontWeight:600},ro=h(function({model:e}){let o=k(null),i=e.legendAtRest;return G(()=>{let a=o.current;if(!a||!i)return;let p=()=>{I(e)&&e.legendAtRest&&e.setLegendSize({width:a.offsetWidth,height:a.offsetHeight})};p();let c=new ResizeObserver(p);return c.observe(a),()=>{c.disconnect()}},[e,i]),n("div",{ref:o,style:{...no,top:ee+e.referenceStripZonePx},children:n(wt,{model:e})})}),ao=h(function({model:e}){let o=e.overlayLabels.sizes,i=o.flatMap(({key:a,leader:p})=>p?[{key:a,...p}]:[]);return f(L,{children:[i.length>0?n(te,{model:e,zIndex:2,overflow:"visible",children:i.map(({key:a,arcX:p,arcY:c,labelX:l,labelY:s})=>n("line",{"data-testid":"graph-label-leader",x1:p,y1:c,x2:l,y2:s,stroke:"#18181c",strokeWidth:1},a))}):null,o.map(({key:a,text:p,x:c,y:l,kind:s})=>n("div",{"data-testid":"graph-size-label",style:{...s==="deletion"?oo:Kt,left:c,top:l},children:p},a))]})}),io=h(function({model:e,ownChrome:o=!0}){let{canvasRef:i,canvas:a,error:p,retry:c}=vt(jt,e),{handlers:l,canvasStyle:s,surfaceProps:d,labelHandlers:y,contextMenu:w,closeContextMenu:E,hoveredChip:z}=Zt(e),[T,A]=R(null);Yt(T,a,e);let O=e.facetPanels!==void 0;return f("div",{style:qn,...d,children:[o?n(At,{model:e}):null,f("div",{ref:A,style:Un,...y,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{I(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?n("div",{style:{...Jn,top:e.referenceStripZonePx,background:Q}}):null,n("canvas",{ref:i,"data-testid":"graph-genome-canvas",style:{...s,width:e.paneWidth,height:e.canvasHeight,display:"block",position:"relative",zIndex:1},...l}),O?n(xt,{model:e,handlers:l,canvasStyle:s}):f(L,{children:[n(mt,{model:e}),n(fe,{model:e}),n(ht,{model:e}),n(to,{model:e}),n(ao,{model:e}),n(nt,{model:e}),n(lt,{model:e}),n(ft,{model:e}),n(gt,{model:e}),n(Dt,{model:e}),n(ro,{model:e})]}),o?n("div",{style:Qn,children:n(Se,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null,n(zt,{model:e,chip:z})]}),e.walkStripShown?n(Ot,{model:e}):null,n(Z,{model:e,at:w,onClose:E}),p?n(se,{error:p,onReset:c}):null,o&&e.error?n(se,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),zi=io;export{zi as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BXRTG7FU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["host:@jbrowse/render-core/useRenderingBackend", "../../src/GraphGenomeView/components/HoverLayer.tsx", "../../src/GraphGenomeView/components/legendStyles.ts", "../../src/GraphGenomeView/components/Legend.tsx", "../../src/GraphGenomeView/components/FacetPanels.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/CropFree.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomIn.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomOut.mjs", "../../src/GraphGenomeView/components/ColorSchemeSelect.tsx", "../../src/GraphGenomeView/components/GraphStats.tsx", "../../src/GraphGenomeView/components/LayoutSelect.tsx", "../../src/GraphGenomeView/components/RepeatSelect.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Close.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/MoreVert.mjs", "../../src/GraphGenomeView/components/SettingsMenu.tsx", "../../src/GraphGenomeView/components/WalkSelect.tsx", "../../src/GraphGenomeView/components/GraphToolbar.tsx", "../../src/GraphGenomeView/components/HoverTooltip.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/FilterList.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/FilterListOff.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Info.mjs", "../../src/GraphGenomeView/components/PaneContextMenu.tsx", "../../src/GraphGenomeView/components/WalkStrip.tsx", "../../src/GraphGenomeView/components/WalkStripLocator.tsx", "../../node_modules/.pnpm/@jbrowse+bandage-core@11.
|
|
3
|
+
"sources": ["host:@jbrowse/render-core/useRenderingBackend", "../../src/GraphGenomeView/components/HoverLayer.tsx", "../../src/GraphGenomeView/components/legendStyles.ts", "../../src/GraphGenomeView/components/Legend.tsx", "../../src/GraphGenomeView/components/FacetPanels.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/CropFree.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomIn.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/ZoomOut.mjs", "../../src/GraphGenomeView/components/ColorSchemeSelect.tsx", "../../src/GraphGenomeView/components/GraphStats.tsx", "../../src/GraphGenomeView/components/LayoutSelect.tsx", "../../src/GraphGenomeView/components/RepeatSelect.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Close.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/MoreVert.mjs", "../../src/GraphGenomeView/components/SettingsMenu.tsx", "../../src/GraphGenomeView/components/WalkSelect.tsx", "../../src/GraphGenomeView/components/GraphToolbar.tsx", "../../src/GraphGenomeView/components/HoverTooltip.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/FilterList.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/FilterListOff.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Info.mjs", "../../src/GraphGenomeView/components/PaneContextMenu.tsx", "../../src/GraphGenomeView/components/WalkStrip.tsx", "../../src/GraphGenomeView/components/WalkStripLocator.tsx", "../../node_modules/.pnpm/@jbrowse+bandage-core@11.4.0/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-TDQLINVI.js", "../../src/GraphGenomeView/components/usePaneGestures.ts", "../../src/GraphGenomeView/renderer/GraphRenderer.ts", "../../src/GraphGenomeView/components/GraphCanvas.tsx"],
|
|
4
4
|
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/render-core/useRenderingBackend\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/render-core/useRenderingBackend\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport const CONTEXT_LOST_REPORT_GRACE_MS = /* @__PURE__ */ read(\"CONTEXT_LOST_REPORT_GRACE_MS\")\nexport const OFFSCREEN_RELEASE_BAND = /* @__PURE__ */ read(\"OFFSCREEN_RELEASE_BAND\")\nexport const createGpuContextLostError = /* @__PURE__ */ read(\"createGpuContextLostError\")\nexport const createGpuDeviceLostError = /* @__PURE__ */ read(\"createGpuDeviceLostError\")\nexport const createGpuSurfaceLostError = /* @__PURE__ */ read(\"createGpuSurfaceLostError\")\nexport const isGpuContextLostError = /* @__PURE__ */ read(\"isGpuContextLostError\")\nexport const useRenderingBackend = /* @__PURE__ */ read(\"useRenderingBackend\")\nexport default host && host.__esModule ? host.default : host", "import { useEffect, useState } from 'react'\n\nimport { Canvas2DRenderer } from '@jbrowse/bandage-core/renderer/Canvas2DRenderer'\nimport { autorun } from 'mobx'\n\nimport { paneLayerStyle } from './PaneLayer'\nimport { dependOn } from '../pane/paneBase'\nimport { trackedDpr } from '../trackedDpr'\n\nimport type { GraphPaneModel } from '../model'\n\nexport const hoverLayerStyle = paneLayerStyle(1)\n\n// The pane's hover, on a transparent canvas over its drawing and tube map\nexport default function HoverLayer({ model }: { model: GraphPaneModel }) {\n const [canvas, setCanvas] = useState<HTMLCanvasElement | null>(null)\n useEffect(() => {\n if (!canvas) {\n return undefined\n }\n const renderer = new Canvas2DRenderer(canvas)\n const dispose = autorun(() => {\n dependOn(trackedDpr())\n renderer.resize(model.paneWidth, model.canvasHeight)\n model.paintHover(renderer, model.drawnBatch)\n })\n return () => {\n dispose()\n renderer.dispose()\n }\n }, [canvas, model])\n return (\n <canvas\n ref={setCanvas}\n data-testid=\"graph-hover-layer\"\n style={hoverLayerStyle}\n />\n )\n}\n", "// A key's section of the legend panel, and one row in it: a swatch beside its\n// words\nexport const legendBoxStyle = {\n background: 'rgba(255,255,255,0.82)',\n padding: '3px 6px',\n fontSize: 11,\n lineHeight: '15px',\n whiteSpace: 'nowrap' as const,\n}\n\nexport const legendRowStyle = { display: 'flex', alignItems: 'center', gap: 5 }\n\n// A line with no swatch, such as what the drawing folded away\nexport const legendNoteStyle = { color: '#666' }\n", "import type { ReactNode } from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport { LegendSwatchView } from './LegendSwatch'\nimport { legendBoxStyle, legendNoteStyle, legendRowStyle } from './legendStyles'\nimport { legendSections } from '../legendSections'\n\nimport type { LegendRow } from '../legendSections'\nimport type { GraphPaneModel } from '../model'\n\n// One row: its swatch then its words, or a note with neither. `at`, where\n// the hovered node sits on a walk, stands in for the line under it.\nexport function LegendRowView({\n row,\n at,\n hint,\n after,\n}: {\n row: LegendRow\n at?: string\n hint?: string\n after?: ReactNode\n}) {\n return row.swatch ? (\n <div title={[row.title, hint].filter(Boolean).join(' \u00B7 ') || undefined}>\n <div style={legendRowStyle}>\n <LegendSwatchView swatch={row.swatch} />\n <span>\n {row.strong ? <strong>{row.strong}</strong> : null}\n {row.label}\n </span>\n {after}\n </div>\n {at ? (\n <div data-testid=\"graph-walk-at\">{at}</div>\n ) : row.under ? (\n <div>{row.under}</div>\n ) : null}\n </div>\n ) : (\n <div style={legendNoteStyle}>{row.label}</div>\n )\n}\n\nconst closeStyle = {\n pointerEvents: 'auto' as const,\n cursor: 'pointer',\n border: 'none',\n background: 'none',\n padding: '0 2px',\n font: 'inherit',\n textDecoration: 'underline',\n}\n\n// Every key the drawing needs, a section each\nexport const LegendPanel = observer(function LegendPanel({\n model,\n}: {\n model: GraphPaneModel\n}) {\n return (\n <>\n {legendSections(model).map(({ testid, rows }) => (\n <div key={testid} style={legendBoxStyle} data-testid={testid}>\n {rows.map(row => (\n <LegendRowView\n key={row.key}\n row={row}\n at={row.walk ? model.hoveredOn(row.walk) : undefined}\n after={\n row.closesBubble ? (\n <button\n type=\"button\"\n style={closeStyle}\n data-testid=\"graph-close-bubble\"\n onClick={() => {\n model.closeBubbles()\n }}\n >\n close\n </button>\n ) : null\n }\n />\n ))}\n </div>\n ))}\n </>\n )\n})\n", "import { useEffect, useState } from 'react'\n\nimport { FACET_GAP_PX, FACET_TITLE_PX } from '@jbrowse/bandage-core/facetGrid'\nimport { Canvas2DRenderer } from '@jbrowse/bandage-core/renderer/Canvas2DRenderer'\nimport { autorun, computed } from 'mobx'\nimport { observer } from 'mobx-react'\n\nimport { hoverLayerStyle } from './HoverLayer'\nimport { LegendRowView } from './Legend'\nimport { facetKeyRows, walkKeyRow } from '../legendSections'\nimport { FACET_KEY_ROW_PX } from '../pane/fitViews'\nimport { PAPER_CSS } from '../pane/paneBase'\n\nimport type { PaneHandlers } from './usePaneGestures'\nimport type { GraphPaneModel } from '../model'\nimport type { WalkLift } from '@jbrowse/bandage-core/walkHighlight'\n\n// The pane faceted by walk: the same layout drawn once per lifted walk, each\n// panel with that walk alone shading along itself, so walks compare by where\n// they go rather than by which lane is which colour. The panels share the\n// pane's transform, so a pan, zoom or hover in one is in all of them.\n\nconst gridStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n zIndex: 4,\n display: 'grid',\n gap: FACET_GAP_PX,\n lineHeight: 'normal',\n}\n\nconst titleStyle = {\n height: FACET_TITLE_PX,\n padding: '2px 6px',\n boxSizing: 'border-box' as const,\n fontFamily: 'inherit',\n fontSize: 11,\n color: 'inherit',\n cursor: 'pointer',\n border: 'none',\n background: 'none',\n textAlign: 'left' as const,\n display: 'block',\n}\n\nconst panelStyle = { position: 'relative' as const }\n\nconst keyStyle = {\n gridColumn: '1 / -1',\n height: FACET_KEY_ROW_PX,\n padding: '2px 6px',\n boxSizing: 'border-box' as const,\n display: 'flex',\n gap: 14,\n fontSize: 11,\n lineHeight: '15px',\n}\n\nconst FacetPanel = observer(function FacetPanel({\n model,\n lift,\n width,\n height,\n cell,\n handlers,\n canvasStyle,\n}: {\n model: GraphPaneModel\n lift: WalkLift\n width: number\n height: number\n cell: { gridRow: number; gridColumn: number }\n handlers: PaneHandlers\n canvasStyle: React.CSSProperties\n}) {\n const [canvas, setCanvas] = useState<HTMLCanvasElement | null>(null)\n const [hoverCanvas, setHoverCanvas] = useState<HTMLCanvasElement | null>(null)\n const walk = lift.walks[0]!\n useEffect(() => {\n if (!canvas || !hoverCanvas) {\n return undefined\n }\n const renderer = new Canvas2DRenderer(canvas)\n const hover = new Canvas2DRenderer(hoverCanvas)\n const drawing = computed(() => model.buildDrawing(lift, false))\n let uploaded: ReturnType<typeof model.buildDrawing>\n const disposers = [\n autorun(() => {\n const grid = model.facetGrid\n if (grid) {\n renderer.resize(grid.width, grid.height)\n }\n const built = drawing.get()\n if (!built) {\n return\n }\n if (built !== uploaded) {\n renderer.uploadGeometry(built.batch)\n uploaded = built\n }\n model.applySelection(renderer)\n model.paint(renderer)\n }),\n autorun(() => {\n const grid = model.facetGrid\n if (grid) {\n hover.resize(grid.width, grid.height)\n }\n const built = drawing.get()\n if (built) {\n model.paintHover(hover, built.batch)\n }\n }),\n ]\n return () => {\n for (const dispose of disposers) {\n dispose()\n }\n renderer.dispose()\n hover.dispose()\n }\n }, [canvas, hoverCanvas, model, lift])\n\n const label = model.walkLabel(walk.name)\n return (\n <div style={cell}>\n <button\n type=\"button\"\n style={titleStyle}\n data-testid=\"graph-facet-title\"\n onClick={() => {\n model.liftWalks([walk.name])\n model.setFacet('')\n }}\n >\n <LegendRowView\n row={walkKeyRow(model, walk)}\n hint={`click to lift ${label} alone`}\n at={model.hoveredOn(walk)}\n />\n </button>\n <div style={panelStyle}>\n <canvas\n ref={setCanvas}\n data-testid=\"graph-facet-canvas\"\n style={{ ...canvasStyle, width, height, display: 'block' }}\n {...handlers}\n />\n <canvas ref={setHoverCanvas} style={hoverLayerStyle} />\n </div>\n </div>\n )\n})\n\nconst FacetPanels = observer(function FacetPanels({\n model,\n handlers,\n canvasStyle,\n}: {\n model: GraphPaneModel\n handlers: PaneHandlers\n canvasStyle: React.CSSProperties\n}) {\n const panels = model.facetPanels\n const grid = model.facetGrid\n const place = model.facetPlacement\n if (!panels || !grid || !place) {\n return null\n }\n const { columns, width, height } = grid\n return (\n <div\n data-testid=\"graph-facet-panels\"\n style={{\n ...gridStyle,\n width: model.paneWidth,\n minHeight: model.canvasHeight,\n gridTemplateColumns: `repeat(${columns}, ${width}px)`,\n background: PAPER_CSS,\n }}\n >\n {panels.map((lift, i) => (\n <FacetPanel\n key={lift.walks[0]!.name}\n model={model}\n lift={lift}\n width={width}\n height={height}\n cell={{\n gridRow: Math.floor(place.cells[i]! / columns) + 1,\n gridColumn: (place.cells[i]! % columns) + 1,\n }}\n handlers={handlers}\n canvasStyle={canvasStyle}\n />\n ))}\n <div\n style={{\n ...keyStyle,\n gridRow: Math.floor(Math.max(...place.cells) / columns) + 2,\n }}\n data-testid=\"graph-facet-key\"\n >\n {facetKeyRows(model).map(row => (\n <LegendRowView key={row.key} row={row} />\n ))}\n </div>\n </div>\n )\n})\n\nexport default FacetPanels\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'CropFree');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon([/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}, \"0\"), /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z\"\n}, \"1\")], 'ZoomIn');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'ZoomOut');", "import { COLOR_SCHEMES } from '@jbrowse/bandage-core/colorSchemes'\nimport { observer } from 'mobx-react'\n\nimport LabelledSelect from './LabelledSelect'\n\nimport type { GraphPaneModel } from '../model'\n\nconst ColorSchemeSelect = observer(function ColorSchemeSelect({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const fixed = model.colorSchemeLock\n return (\n <LabelledSelect\n label=\"Color\"\n size=\"small\"\n sx={{ minWidth: 100 }}\n disabled={fixed !== undefined}\n title={fixed?.why}\n shown={fixed?.value}\n value={model.chosenColorScheme}\n options={COLOR_SCHEMES.map(({ value }) => ({\n value,\n label: model.colorSchemeLabel(value),\n }))}\n testId=\"graph-color-select\"\n onChange={scheme => {\n model.setColorScheme(scheme)\n }}\n />\n )\n})\n\nexport default ColorSchemeSelect\n", "import { Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n stats: {\n marginLeft: 'auto',\n },\n perf: {\n color: '#888',\n fontVariantNumeric: 'tabular-nums',\n },\n})\n\nfunction fmtMs(ms: number | undefined) {\n return ms === undefined ? '\u2013' : `${Math.round(ms)}ms`\n}\n\n// The perf READOUT, off by default: it sat in the toolbar of every published\n// graph figure, where one machine's fetch time is a number a reader has to work\n// out is not about them. `showPerf` is in the settings menu.\n//\n// The numbers themselves are not conditional \u2014 they ride the stats element's\n// data-* attributes either way (see GraphStats), so a browser test asserting a\n// timing budget never depends on a display setting, and turning the text off\n// costs no coverage. They live there rather than on this element so that\n// switching the text off leaves no empty node behind to carry them.\nconst GraphPerf = observer(function GraphPerf({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const { lastFetchMs, lastLayoutMs, lastGeometryMs } = model\n const hasMetrics =\n lastFetchMs !== undefined ||\n lastLayoutMs !== undefined ||\n lastGeometryMs !== undefined\n return model.showPerf && hasMetrics ? (\n <Typography\n variant=\"caption\"\n className={classes.perf}\n data-testid=\"graph-perf-stats\"\n >\n fetch {fmtMs(lastFetchMs)} \u00B7 layout {fmtMs(lastLayoutMs)} \u00B7 geom{' '}\n {fmtMs(lastGeometryMs)}\n </Typography>\n ) : null\n})\n\nconst GraphStats = observer(function GraphStats({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n return (\n <div\n className={classes.stats}\n data-testid=\"graph-stats\"\n data-node-count={model.nodeCount}\n data-edge-count={model.edgeCount}\n data-path-count={model.pathCount}\n // unconditional, whatever `showPerf` is doing to the text beside them \u2014\n // see GraphPerf\n data-fetch-ms={model.lastFetchMs ?? ''}\n data-layout-ms={model.lastLayoutMs ?? ''}\n data-geometry-ms={model.lastGeometryMs ?? ''}\n data-geometry-strokes={model.lastGeometryStrokeCount ?? ''}\n >\n <Typography variant=\"body2\" component=\"span\">\n {model.nodeCount} nodes, {model.edgeCount} edges\n {model.pathCount > 0 ? `, ${model.pathCount} paths` : ''}\n </Typography>{' '}\n <GraphPerf model={model} />\n </div>\n )\n})\n\nexport default GraphStats\n", "import { LAYOUT_MODES } from '@jbrowse/bandage-core/layoutModes'\nimport { observer } from 'mobx-react'\n\nimport LabelledSelect from './LabelledSelect'\n\nimport type { GraphPaneModel } from '../model'\n\nconst LayoutSelect = observer(function LayoutSelect({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { graph } = model\n return (\n <LabelledSelect\n label=\"Layout\"\n size=\"small\"\n sx={{ minWidth: 140 }}\n testId=\"graph-layout-select\"\n value={model.chosenLayoutMode}\n options={LAYOUT_MODES.map(({ value, label, description, available }) => ({\n value,\n label,\n description,\n disabled: graph ? !available(graph) : false,\n }))}\n onChange={mode => {\n void model.switchLayout(mode)\n }}\n />\n )\n})\n\nexport default LayoutSelect\n", "import { observer } from 'mobx-react'\n\nimport LabelledSelect from './LabelledSelect'\n\nimport type { GraphPaneModel } from '../model'\n\n// Which tandem repeat array walk rows slice each walk by and tile, or the\n// whole window\nconst RepeatSelect = observer(function RepeatSelect({\n model,\n}: {\n model: GraphPaneModel\n}) {\n if (\n model.chosenLayoutMode !== 'walkrows' ||\n model.repeatChoices.length === 0\n ) {\n return null\n }\n return (\n <LabelledSelect\n label=\"Repeat\"\n size=\"small\"\n sx={{ minWidth: 130, maxWidth: 260 }}\n testId=\"graph-repeat-select\"\n value={model.selectedRepeat?.key ?? ''}\n options={model.repeatOptions}\n onChange={key => {\n model.setRepeatKey(key)\n }}\n />\n )\n})\n\nexport default RepeatSelect\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Close');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'MoreVert');", "import { CascadingMenuButton } from '@jbrowse/core/ui'\nimport { getSession } from '@jbrowse/core/util'\nimport CloseIcon from '@mui/icons-material/Close'\nimport MoreVertIcon from '@mui/icons-material/MoreVert'\nimport RouteIcon from '@mui/icons-material/Route'\nimport SettingsIcon from '@mui/icons-material/Settings'\nimport VisibilityIcon from '@mui/icons-material/Visibility'\nimport { observer } from 'mobx-react'\n\nimport GraphSettingsDialog from './GraphSettingsDialog'\n\nimport type { GraphPaneModel } from '../model'\n\nconst SettingsMenu = observer(function SettingsMenu({\n model,\n}: {\n model: GraphPaneModel\n}) {\n // the toolbar beside this menu picks the walks and the repeat\n const haplotypes = model.highlightMenuItems({ picks: false })\n\n return (\n <CascadingMenuButton\n size=\"small\"\n tooltip=\"Graph options\"\n menuItems={[\n ...(haplotypes.length > 0\n ? [{ label: 'Haplotypes', icon: RouteIcon, subMenu: haplotypes }]\n : []),\n ...model.layoutOptionMenuItems({ repeat: false }),\n {\n label: 'Show...',\n icon: VisibilityIcon,\n subMenu: [\n ...model.showMenuItems(),\n ...(model.modeDrawsNodes && model.walkChoices.length > 1\n ? [\n {\n type: 'checkbox' as const,\n label: 'Show walk rows under the graph',\n checked: model.walkStrip,\n onClick: () => {\n model.setWalkStrip(!model.walkStrip)\n },\n },\n ]\n : []),\n {\n type: 'checkbox' as const,\n label: 'Show timings',\n checked: model.showPerf,\n onClick: () => {\n model.setShowPerf(!model.showPerf)\n },\n },\n ],\n },\n { type: 'divider' as const },\n {\n label: 'Graph settings...',\n icon: SettingsIcon,\n helpText:\n 'Subgraph node limit; node width and path colors; the force-directed layout engine',\n onClick: () => {\n getSession(model).queueDialog(onClose => [\n GraphSettingsDialog,\n { model, onClose },\n ])\n },\n },\n { type: 'divider' as const },\n {\n label: 'Close graph',\n icon: CloseIcon,\n onClick: () => {\n model.clearGraph()\n },\n },\n ]}\n >\n <MoreVertIcon />\n </CascadingMenuButton>\n )\n})\n\nexport default SettingsMenu\n", "import { useId } from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\nimport {\n Button,\n Checkbox,\n FormControl,\n InputLabel,\n ListItemText,\n MenuItem,\n Select,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { ChooseWalksDialog, WALK_MENU_ITEMS } from '../pane/paneBase'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n formControl: {\n minWidth: 130,\n maxWidth: 260,\n },\n})\n\n// Which walks to lift out of the drawing: Bandage's path highlight, for as many\n// of the haplotypes a GBZ cut carries as the reader picks. Absent from a graph\n// with no walks, and from a tube map, whose tubes are the walks.\nconst WalkSelect = observer(function WalkSelect({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const labelId = useId()\n const { walkChoices } = model\n if (walkChoices.length === 0 || !model.liftsWalks) {\n return null\n }\n const names = new Set(walkChoices.map(c => c.name))\n const labels = new Map(walkChoices.map(c => [c.name, c.label]))\n const picked = model.walkLayers\n .map(layer => layer.walk)\n .filter(name => names.has(name))\n if (walkChoices.length > WALK_MENU_ITEMS) {\n return (\n <Button\n size=\"small\"\n variant=\"outlined\"\n color=\"inherit\"\n data-testid=\"graph-walk-choose\"\n onClick={() => {\n getSession(model).queueDialog(onClose => [\n ChooseWalksDialog,\n { model, onClose },\n ])\n }}\n >\n {picked.length > 0\n ? `${picked.length} of ${walkChoices.length} haplotypes`\n : 'Highlight haplotypes...'}\n </Button>\n )\n }\n return (\n <FormControl size=\"small\" className={classes.formControl}>\n <InputLabel id={labelId}>Highlight</InputLabel>\n <Select\n labelId={labelId}\n multiple\n value={picked}\n label=\"Highlight\"\n data-testid=\"graph-walk-select\"\n renderValue={selected => selected.map(n => labels.get(n)).join(', ')}\n onChange={e => {\n const { value } = e.target\n model.liftAmongChoices(\n typeof value === 'string' ? value.split(',') : value,\n )\n }}\n >\n {walkChoices.map(({ name, label }) => (\n <MenuItem key={name} value={name} dense>\n <Checkbox size=\"small\" checked={picked.includes(name)} />\n <ListItemText primary={label} />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )\n})\n\nexport default WalkSelect\n", "import CropFreeIcon from '@mui/icons-material/CropFree'\nimport ZoomInIcon from '@mui/icons-material/ZoomIn'\nimport ZoomOutIcon from '@mui/icons-material/ZoomOut'\nimport { IconButton, Tooltip, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport ColorSchemeSelect from './ColorSchemeSelect'\nimport GraphStats from './GraphStats'\nimport LayoutSelect from './LayoutSelect'\nimport RepeatSelect from './RepeatSelect'\nimport SettingsMenu from './SettingsMenu'\nimport WalkSelect from './WalkSelect'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n toolbar: {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n gap: 4,\n padding: '2px 4px',\n borderBottom: '1px solid #ddd',\n },\n})\n\nconst ZoomDisplay = observer(function ZoomDisplay({\n model,\n}: {\n model: GraphPaneModel\n}) {\n return <Typography variant=\"body2\">{model.zoomPercent}</Typography>\n})\n\nconst GraphToolbar = observer(function GraphToolbar({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const zoomAboutCentre = (factor: number) => {\n model.zoom(factor, model.viewBox.width / 2, model.viewBox.height / 2)\n }\n return (\n <div className={classes.toolbar}>\n <LayoutSelect model={model} />\n <ColorSchemeSelect model={model} />\n <WalkSelect model={model} />\n <RepeatSelect model={model} />\n <Tooltip title=\"Zoom in\">\n <IconButton\n size=\"small\"\n onClick={() => {\n zoomAboutCentre(1.5)\n }}\n >\n <ZoomInIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Zoom out\">\n <IconButton\n size=\"small\"\n onClick={() => {\n zoomAboutCentre(1 / 1.5)\n }}\n >\n <ZoomOutIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Zoom to fit\">\n <IconButton\n size=\"small\"\n onClick={() => {\n model.refitView()\n }}\n >\n <CropFreeIcon />\n </IconButton>\n </Tooltip>\n <ZoomDisplay model={model} />\n <GraphStats model={model} />\n <SettingsMenu model={model} />\n </div>\n )\n})\n\nexport default GraphToolbar\n", "import type { ReactNode } from 'react'\n\nimport { edgeHoverText, regionLabel } from '@jbrowse/bandage-core/hoverText'\nimport { observer } from 'mobx-react'\n\nimport { nodeOwnLocation } from '../../launchFromGraph/contributors'\nimport { TOOLTIP_INSET_PX } from '../pane/fitViews'\n\nimport type { chipReadoutAt } from './LabelLayer'\nimport type { GraphPaneModel } from '../model'\n\n// Bottom right of the canvas, clear of the row labels on the left edge and of\n// a walk strip under the canvas. Where the legend reaches down to it, it moves\n// left of the legend.\nconst tooltipStyle = {\n position: 'absolute' as const,\n bottom: TOOLTIP_INSET_PX,\n lineHeight: 'normal',\n background: 'rgba(0,0,0,0.75)',\n color: 'white',\n padding: '4px 8px',\n borderRadius: 4,\n fontSize: 12,\n pointerEvents: 'none' as const,\n zIndex: 6,\n}\n\ntype Readout = NonNullable<ReturnType<typeof chipReadoutAt>>\n\nfunction labelled({ label, readout }: Readout) {\n return (\n <>\n <strong>{label}</strong> \u2014 {readout}\n </>\n )\n}\n\n// What the pointer is on, the most specific first: a gene chip, a node, an\n// edge, then a walk row or a tube\nfunction hoverTip(\n model: GraphPaneModel,\n chip: Readout | undefined,\n): { testId?: string; body: ReactNode } | undefined {\n if (chip) {\n return { testId: 'graph-chip-tooltip', body: labelled(chip) }\n }\n const node = model.hoveredNode\n ? model.hoverNodeById?.get(model.hoveredNode)\n : undefined\n if (node) {\n const merged = model.hoverDrawing?.members.get(node.id)\n const own = nodeOwnLocation(node)\n return {\n body: (\n <>\n <strong>{node.name}</strong>\n {merged ? ` and ${merged.length - 1} more` : ''} \u2014{' '}\n {node.length.toLocaleString()} bp, depth {node.depth.toFixed(1)}\n {/* the assembly that contributed the segment, and where on it */}\n {own ? (\n <>\n <br />\n {own.sample} {regionLabel(own)} (rank {node.stable?.rank})\n </>\n ) : null}\n </>\n ),\n }\n }\n const edge =\n model.hoveredEdge === null\n ? undefined\n : model.graph?.edges[model.hoveredEdge]\n if (edge) {\n const text = edgeHoverText(\n edge,\n model.deletions.find(d => d.edgeIndex === model.hoveredEdge),\n id => model.nodeById?.get(id)?.name ?? id,\n )\n // a deletion edge skips backbone that some haplotype lacks, so its\n // readout gives the bp skipped\n return {\n body: text.deletion ? (\n <>\n <strong>Deletion</strong> {text.deletion.bp}\n <br />\n {text.deletion.where}\n </>\n ) : (\n <>Edge: {text.ends}</>\n ),\n }\n }\n const walkRow = model.hoveredWalkRowText\n if (walkRow) {\n return { testId: 'graph-walk-row-tooltip', body: labelled(walkRow) }\n }\n const tube = model.hoveredTubeText\n return tube\n ? { testId: 'graph-tube-tooltip', body: labelled(tube) }\n : undefined\n}\n\nconst HoverTooltip = observer(function HoverTooltip({\n model,\n chip,\n}: {\n model: GraphPaneModel\n chip: Readout | undefined\n}) {\n const tip = hoverTip(model, chip)\n return tip ? (\n <div\n style={{ ...tooltipStyle, right: model.tooltipRightPx }}\n data-testid={tip.testId}\n >\n {tip.body}\n </div>\n ) : null\n})\n\nexport default HoverTooltip\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z\"\n}), 'FilterList');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'FilterListOff');", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n 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\"\n}), 'Info');", "import { regionLabel } from '@jbrowse/bandage-core/hoverText'\nimport { ContextMenu } from '@jbrowse/core/ui'\nimport FilterListIcon from '@mui/icons-material/FilterList'\nimport FilterListOffIcon from '@mui/icons-material/FilterListOff'\nimport InfoIcon from '@mui/icons-material/Info'\nimport LineStyleIcon from '@mui/icons-material/LineStyle'\n\nimport { nodeLaunchMenuItems } from '../../launchFromGraph/graphMenuItems'\n\nimport type { GraphPaneModel } from '../model'\nimport type { WalkRows } from '@jbrowse/bandage-core/layout/walkRows'\nimport type { ContextMenuAnchor, MenuItem } from '@jbrowse/core/ui'\n\n// What a right-click landed on: a node, or a row of `bars`, walk rows' own\n// unless a strip's\nexport type PaneContextAt = ContextMenuAnchor &\n ({ nodeId: string } | { row: number; bars?: WalkRows })\n\nconst AT_POINTER = { x: 0, y: 0 }\n\n// Flat rather than under a \"Launch view\" submenu, since its two or three items\n// are all about the node just clicked\nfunction nodeMenuItems(model: GraphPaneModel, nodeId: string): MenuItem[] {\n const { own, reference, highlight } = model.nodeLaunchTargets(nodeId)\n return [\n {\n label: 'Node details',\n icon: InfoIcon,\n onClick: () => {\n model.showNodeDetails(nodeId)\n },\n },\n ...nodeLaunchMenuItems({\n own,\n reference,\n highlight,\n onShowLinear: target => {\n model.showInLinearView(target)\n },\n onHighlight: model.canHighlightInLinearView\n ? target => {\n model.highlightInLinearView(target)\n }\n : undefined,\n }),\n ]\n}\n\n// A walk row's bar stands for a span of its haplotype's own contig, so the\n// question a right-click asks is answered by a linear view on that assembly,\n// with its genes\nfunction walkRowMenuItems(\n model: GraphPaneModel,\n row: number,\n bars: WalkRows | undefined,\n): MenuItem[] {\n const rows = bars ?? model.walkRowBars\n const target = model.walkRowLaunchTarget(row, rows)\n const assembly = target?.assembly\n const walk = row > 0 ? rows?.rows[row - 1] : undefined\n const sample = walk?.sample\n // the strip's rows are not walk rows', and take no sample filter\n const filters = !bars && model.walkRowBars\n const shown = model.walkRowSamples\n return [\n target && assembly\n ? {\n label: `Linear genome view \u2014 ${assembly} ${regionLabel(target.location)}`,\n icon: LineStyleIcon,\n onClick: () => {\n model.showInLinearView({ location: target.location, assembly })\n },\n }\n : {\n label: 'Linear genome view',\n icon: LineStyleIcon,\n disabled: true,\n disabledHelpText: target\n ? `No assembly in this session is ${target.location.haplotype ?? target.label}`\n : 'This walk states no contig coordinates',\n onClick: () => {},\n },\n ...(walk && model.liftsWalks && model.modeDrawsNodes\n ? [\n {\n type: 'checkbox' as const,\n label: `Highlight ${walk.label}`,\n checked: model.walkLayers.some(l => l.walk === walk.name),\n onClick: () => {\n model.toggleWalk(walk.name)\n },\n },\n ]\n : []),\n ...(filters && sample && !(shown?.length === 1 && shown[0] === sample)\n ? [\n {\n label: `Show only ${sample}`,\n icon: FilterListIcon,\n onClick: () => {\n model.setWalkRowSamples([sample])\n },\n },\n ]\n : []),\n ...(filters && shown\n ? [\n {\n label: 'Show every sample',\n icon: FilterListOffIcon,\n onClick: () => {\n model.setWalkRowSamples(undefined)\n },\n },\n ]\n : []),\n ]\n}\n\n// core's context menu, opened at the pointer itself rather than beside it\nexport default function PaneContextMenu({\n model,\n at,\n onClose,\n}: {\n model: GraphPaneModel\n at: PaneContextAt | undefined\n onClose: () => void\n}) {\n return (\n <ContextMenu\n anchor={at}\n offset={AT_POINTER}\n onClose={onClose}\n menuItems={() =>\n at === undefined\n ? []\n : 'nodeId' in at\n ? nodeMenuItems(model, at.nodeId)\n : walkRowMenuItems(model, at.row, at.bars)\n }\n />\n )\n}\n", "import { useMemo, useState } from 'react'\n\nimport {\n walkRowReadout,\n walkRowsKey,\n walkRowsTree,\n} from '@jbrowse/bandage-core/layout/walkRowDraw'\nimport {\n stripGeneGaps,\n stripRowAt,\n walkMarksTree,\n walkStripLabelsTree,\n} from '@jbrowse/bandage-core/layout/walkStrip'\nimport { RAMP_GRADIENT_CSS } from '@jbrowse/bandage-core/referenceRampCss'\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { observer } from 'mobx-react'\n\nimport ElTree, { useSvgId } from './ElTree'\nimport { LegendSwatchView } from './LegendSwatch'\nimport PaneContextMenu from './PaneContextMenu'\nimport { legendRowStyle } from './legendStyles'\nimport { walkRowSwatch } from '../legendSections'\n\nimport type { GraphPaneModel } from '../model'\nimport type { RowGene } from '@jbrowse/bandage-core/layout/walkRowDraw'\nimport type { WalkRows } from '@jbrowse/bandage-core/layout/walkRows'\nimport type { StripFrame } from '@jbrowse/bandage-core/layout/walkStrip'\n\n// Walk rows under a layout that draws nodes, each haplotype's walk on its own\n// bp, linked to the drawing above: the hovered node ticks every bar where its\n// walk passes it, and a point on a bar lights its node, ringed, above. The\n// bars share the drawing's colours, so under the reference-position ramp a hue\n// in the drawing is the same hue on each bar. Every row is shown; rows too\n// thin to letter say who they are on hover.\n\nconst keyStyle = {\n display: 'flex',\n flexWrap: 'wrap' as const,\n gap: '2px 14px',\n padding: '2px 8px 6px',\n fontSize: 11,\n color: '#333',\n}\n\nconst tipStyle = {\n position: 'absolute' as const,\n pointerEvents: 'none' as const,\n background: 'rgba(255,255,255,0.92)',\n border: '1px solid #ccc',\n borderRadius: 3,\n padding: '1px 6px',\n fontSize: 11,\n whiteSpace: 'nowrap' as const,\n zIndex: 4,\n}\n\n// The bars, built once per rows, frame, colouring and genes rather than per\n// hover\nconst StripBars = observer(function StripBars({\n bars,\n frame,\n ramp,\n rowGenes,\n}: {\n bars: WalkRows\n frame: StripFrame\n ramp: { start: number; end: number } | undefined\n rowGenes: Map<string, RowGene[]> | undefined\n}) {\n const idPrefix = useSvgId()\n const tree = useMemo(\n () => walkRowsTree(bars, frame, { ramp, rowGenes, idPrefix }),\n [bars, frame, ramp, rowGenes, idPrefix],\n )\n return <ElTree el={tree} />\n})\n\n// The hovered row's readout where the rows are too thin to letter, at the\n// pointer's place on its bar. Its own observer, so a move along a bar redraws\n// the tip and not the strip.\nexport const StripTip = observer(function StripTip({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const bars = model.walkStripRows\n const frame = model.walkStripFrame\n const hover = model.stripHover\n const all = bars ? [bars.reference, ...bars.rows] : []\n const index = hover ? all.findIndex(r => r.name === hover.row) : -1\n const row = all[index]\n if (!bars || !frame || frame.labelled || !hover || !row) {\n return null\n }\n const x = (bars.origin + hover.offset) * frame.scaleX + frame.translateX\n // past the middle it opens leftward, so a long readout stays in the pane\n const side =\n x > frame.width / 2 ? { right: frame.width - x + 12 } : { left: x + 12 }\n return (\n <div\n data-testid=\"graph-walk-strip-tip\"\n style={{\n ...tipStyle,\n ...side,\n top: index * frame.rowPx + frame.translateY - 18,\n }}\n >\n {row.label} \u00B7{' '}\n {walkRowReadout(row, index === 0 ? undefined : bars.reference)}\n </div>\n )\n})\n\n// Its own observer, so the node a hover lights redraws the ticks and not the\n// strip\nconst StripMarks = observer(function StripMarks({\n model,\n bars,\n frame,\n}: {\n model: GraphPaneModel\n bars: WalkRows\n frame: StripFrame\n}) {\n return <ElTree el={walkMarksTree(bars, frame, model.walkStripMarks)} />\n})\n\nconst WalkStrip = observer(function WalkStrip({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const bars = model.walkStripRows\n const frame = model.walkStripFrame\n const [menu, setMenu] = useState<{\n clientX: number\n clientY: number\n row: number\n }>()\n if (!bars || !frame) {\n return null\n }\n const hit = (e: React.MouseEvent<SVGSVGElement>) => {\n const box = e.currentTarget.getBoundingClientRect()\n return stripRowAt(bars, frame, e.clientX - box.left, e.clientY - box.top)\n }\n const key = walkRowsKey(bars, {\n ramp: model.referenceRampDomain,\n rampCss: RAMP_GRADIENT_CSS,\n genes: stripGeneGaps(frame, model.walkRowGenes, model.walkRowGeneGaps),\n })\n return (\n <div\n data-testid=\"graph-walk-strip\"\n style={{ position: 'relative', borderTop: '1px solid #ddd' }}\n onMouseEnter={() => {\n model.setPointerInPane(true)\n }}\n onMouseLeave={() => {\n if (isAlive(model)) {\n model.setPointerInPane(false)\n model.setStripHover(null)\n }\n }}\n >\n <svg\n width={frame.width}\n height={frame.height}\n style={{ display: 'block' }}\n onMouseMove={e => {\n const at = hit(e)\n e.currentTarget.style.cursor = at && at.index > 0 ? 'pointer' : ''\n model.setStripHover(\n at ? { row: at.row.name, offset: at.offset } : null,\n )\n }}\n onClick={e => {\n const at = hit(e)\n if (at && at.index > 0) {\n model.toggleWalk(at.row.name)\n }\n }}\n onContextMenu={e => {\n const at = hit(e)\n if (at) {\n e.preventDefault()\n setMenu({ clientX: e.clientX, clientY: e.clientY, row: at.index })\n }\n }}\n >\n <StripBars\n bars={bars}\n frame={frame}\n ramp={model.referenceRampDomain}\n rowGenes={model.walkRowGenes}\n />\n <StripMarks model={model} bars={bars} frame={frame} />\n <ElTree\n el={walkStripLabelsTree(\n bars,\n frame,\n new Set(model.walkLayers.map(l => l.walk)),\n )}\n />\n </svg>\n <StripTip model={model} />\n <div style={keyStyle} data-testid=\"graph-walk-strip-key\">\n {key.map(entry => (\n <div key={entry.label} style={legendRowStyle}>\n <LegendSwatchView swatch={walkRowSwatch(entry.swatch)} />\n <span>{entry.label}</span>\n </div>\n ))}\n <span style={{ color: '#777' }}>\n Ticks mark where each walk passes the node under the pointer; click a\n haplotype's bar to lift its walk\n </span>\n </div>\n <PaneContextMenu\n model={model}\n at={menu && { ...menu, bars }}\n onClose={() => {\n setMenu(undefined)\n }}\n />\n </div>\n )\n})\n\nexport default WalkStrip\n", "import { observer } from 'mobx-react'\n\nimport { PaneSvgLayer } from './PaneLayer'\n\nimport type { GraphPaneModel } from '../model'\n\n// A ring round the node a point on the walk strip lights, so a one-bp node\n// can be found in a hairball\nconst WalkStripLocator = observer(function WalkStripLocator({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const at = model.walkStripLocator\n return at ? (\n <PaneSvgLayer\n model={model}\n zIndex={4}\n overflow=\"visible\"\n testId=\"graph-walk-strip-locator\"\n >\n <circle\n cx={at.x}\n cy={at.y}\n r={11}\n fill=\"none\"\n stroke=\"white\"\n strokeWidth={4}\n />\n <circle\n cx={at.x}\n cy={at.y}\n r={11}\n fill=\"none\"\n stroke=\"#111\"\n strokeWidth={1.75}\n />\n </PaneSvgLayer>\n ) : null\n})\n\nexport default WalkStripLocator\n", "// src/util/wheelZoom.ts\nvar ZOOM_PER_NOTCH = 1.1;\nvar NOTCH_PX = 100;\nvar LINE_PX = 40;\nvar PAGE_PX = 800;\nvar PINCH_GAIN = 10;\nvar MAX_NOTCHES_PER_EVENT = 2;\nfunction wheelZoomFactor(e) {\n const px = e.deltaY * (e.deltaMode === 1 ? LINE_PX : e.deltaMode === 2 ? PAGE_PX : 1);\n const notches = (e.ctrlKey ? PINCH_GAIN : 1) * px / NOTCH_PX;\n return ZOOM_PER_NOTCH ** -Math.max(-MAX_NOTCHES_PER_EVENT, Math.min(MAX_NOTCHES_PER_EVENT, notches));\n}\n\nexport {\n wheelZoomFactor\n};\n", "import { useEffect, useRef, useState } from 'react'\n\nimport {\n findHoveredEdge,\n findHoveredNode,\n} from '@jbrowse/bandage-core/util/hitDetection'\nimport { wheelZoomFactor } from '@jbrowse/bandage-core/util/wheelZoom'\nimport { screenToLayout } from '@jbrowse/bandage-core/viewport'\nimport { isAlive } from '@jbrowse/mobx-state-tree'\n\nimport { chipReadoutAt } from './LabelLayer'\nimport { PANS_WITH_DRAWING } from './PaneLayer'\n\nimport type { PaneContextAt } from './PaneContextMenu'\nimport type { GraphPaneModel } from '../model'\n\nconst WHEEL_LINE_PX = 40\n\n// A trackpad pinch trails a little sideways scroll that would pan the drawing\n// out from under it; core's linear view ignores deltaX this long after a zoom.\nconst ZOOM_ACTIVE_MS = 100\n\n// A wheel notch lands as a few frames of eased zoom rather than one jump, the\n// way core's linear view zooms, and a trackpad's bursts zoom at an even pace.\n// The backlog is in log(scale), capped so a free-spinning wheel cannot bank a\n// zoom that runs on after the hand stops.\nconst ZOOM_EASE_MS = 24\nconst MAX_ZOOM_BACKLOG = Math.log(16)\n\n// how much of the owed zoom, in log(scale), to apply this frame\nexport function easeZoom(backlog: number, elapsedMs: number) {\n const rest = backlog * Math.exp(-elapsedMs / ZOOM_EASE_MS)\n return Math.abs(rest) < 1e-3 ? backlog : backlog - rest\n}\n\n// What a wheel does over a pane that draws its own coordinates. Inside a linear\n// view it follows the view's rules: ctrl/\u2318+wheel (a trackpad pinch) zooms, a\n// plain vertical wheel zooms only with the session's scroll-to-zoom on and\n// otherwise scrolls the page, and a sideways swipe pans. A graph view of its\n// own zooms on a plain wheel.\nexport function wheelAction(\n e: Pick<WheelEvent, 'deltaX' | 'deltaY' | 'ctrlKey' | 'metaKey'>,\n host: { scrollZoom?: boolean } | undefined,\n) {\n const sideways = Math.abs(e.deltaX) > Math.abs(e.deltaY)\n if (e.ctrlKey || e.metaKey || (!sideways && (!host || host.scrollZoom))) {\n return 'zoom'\n }\n return sideways ? 'pan' : 'page'\n}\n\n// Bound on the whole canvas area, so a wheel over a label, pin or legend acts\n// as it does over the drawing. Imperative, because React registers wheel\n// listeners as passive and this one has to preventDefault.\nexport function useWheelZoom(\n area: HTMLElement | null,\n canvas: HTMLCanvasElement | null | undefined,\n model: GraphPaneModel,\n) {\n useEffect(() => {\n if (!area) {\n return undefined\n }\n let lastZoom = -Infinity\n const ease = { backlog: 0, x: 0, y: 0, frame: 0, last: 0 }\n const step = (now: number) => {\n const owed = easeZoom(ease.backlog, Math.min(100, now - ease.last))\n ease.backlog -= owed\n ease.last = now\n ease.frame = ease.backlog ? requestAnimationFrame(step) : 0\n if (isAlive(model)) {\n model.zoom(Math.exp(owed), ease.x, ease.y)\n }\n }\n // a drawing the view places or drives leaves the wheel to the view\n const handleWheel = (e: WheelEvent) => {\n if (model.hostPlacesX || model.followsHostView) {\n return\n }\n const under =\n e.target instanceof Element ? e.target.closest('canvas') : null\n const origin = under ?? (model.facetPanels ? null : canvas)\n const rect = origin?.getBoundingClientRect()\n // the strip is the linear view's bp, so its wheel is the view's\n if (rect && e.clientY - rect.top < model.referenceStripZonePx) {\n return\n }\n const action = wheelAction(e, model.host)\n if (action === 'page') {\n return\n }\n if (model.host) {\n e.stopPropagation()\n }\n e.preventDefault()\n if (action === 'pan') {\n if (e.timeStamp - lastZoom > ZOOM_ACTIVE_MS) {\n const px = e.deltaMode === 1 ? WHEEL_LINE_PX : 1\n model.setTransform(\n model.scale,\n model.translateX - e.deltaX * px,\n model.translateY,\n )\n }\n return\n }\n lastZoom = e.timeStamp\n if (!rect) {\n return\n }\n ease.x = e.clientX - rect.left\n ease.y = e.clientY - rect.top\n ease.backlog = Math.max(\n -MAX_ZOOM_BACKLOG,\n Math.min(MAX_ZOOM_BACKLOG, ease.backlog + Math.log(wheelZoomFactor(e))),\n )\n if (!ease.frame) {\n ease.last = performance.now() - 1000 / 60\n ease.frame = requestAnimationFrame(step)\n }\n }\n area.addEventListener('wheel', handleWheel, { passive: false })\n return () => {\n cancelAnimationFrame(ease.frame)\n area.removeEventListener('wheel', handleWheel)\n }\n }, [area, canvas, model])\n}\n\nconst CLICK_SLOP_PX = 3\n\n// core's marker on an element whose presses the linear view's pan leaves alone\nconst GESTURE_OWNER = 'data-gesture-owner'\n\ninterface Point {\n x: number\n y: number\n}\n\nconst pointOf = (e: { clientX: number; clientY: number }): Point => ({\n x: e.clientX,\n y: e.clientY,\n})\n\nfunction pinchOf(points: Map<number, Point>) {\n const [a, b] = [...points.values()] as [Point, Point]\n return {\n spread: Math.hypot(a.x - b.x, a.y - b.y),\n mid: { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 },\n }\n}\n\n// The pointer on a canvas drawing the pane's transform: the pane's own, or any\n// facet panel, since the panels share it. Coordinates are read against the\n// canvas the event is on.\nexport function usePaneGestures(model: GraphPaneModel) {\n // Where the pointer was last, and whether it has travelled since mousedown \u2014\n // per-gesture scratch that nothing renders from, which is what a ref is for.\n // Whether a drag is in progress is model state (`isPanning`/`draggingNode`),\n // because the cursor renders from it.\n const lastMouseRef = useRef({ x: 0, y: 0 })\n const downRef = useRef({ x: 0, y: 0 })\n const hasMovedRef = useRef(false)\n // The pointer driving a drag, so a stray second one neither restarts nor\n // ends it. A second finger on a pan pinches instead: `points` holds the\n // captured fingers, and `pinch` the spread and midpoint the drawing last\n // zoomed from, measured against the canvas the pan started on.\n const dragPointerRef = useRef<number | undefined>(undefined)\n const isOtherPointer = (e: React.PointerEvent) =>\n dragPointerRef.current !== undefined &&\n e.pointerId !== dragPointerRef.current\n const pointsRef = useRef(new Map<number, Point>())\n const dragCanvasRef = useRef<Element | null>(null)\n const pinchRef = useRef<ReturnType<typeof pinchOf> | null>(null)\n const stripPanRef = useRef(false)\n const verticalPanRef = useRef(false)\n // A pan and a hover are applied once per frame, not once per mousemove:\n // mousemove fires in bursts well above the frame rate, and each pan step\n // repainted the canvas and re-placed every overlay label, while each hover\n // step ran both hit indexes. The pending pan is the summed delta; the pending\n // hover is the last pointer position, since only the last one can be right.\n const pendingRef = useRef<{\n frame: number\n pan: { dx: number; dy: number } | null\n hover: { x: number; y: number } | null\n pinch: boolean\n }>({ frame: 0, pan: null, hover: null, pinch: false })\n useEffect(\n () => () => {\n cancelAnimationFrame(pendingRef.current.frame)\n },\n [],\n )\n const [contextMenu, setContextMenu] = useState<PaneContextAt>()\n // whether a press here would drag a node, for the cursor; state rather than\n // a read of `hoveredAt`, which changes on every move over a node\n const [overDraggable, setOverDraggable] = useState(false)\n const [hoveredChip, setHoveredChip] =\n useState<ReturnType<typeof chipReadoutAt>>(undefined)\n\n // the event's point in pane px, against the canvas it is on\n function pointerAt(e: React.MouseEvent) {\n const rect = (e.currentTarget as HTMLCanvasElement).getBoundingClientRect()\n return { x: e.clientX - rect.left, y: e.clientY - rect.top }\n }\n\n // The node at a pane point, which mousedown, mousemove and click all need.\n // Takes the point rather than the event so a caller that already has one\n // does not pay for a second getBoundingClientRect.\n function nodeAt(sx: number, sy: number) {\n if (model.layoutResult?.tubeMap) {\n return model.tubeMapNodeAt(sx, sy)\n }\n const onStrip = model.referenceStripNodeAt(sx, sy)\n if (onStrip) {\n return onStrip\n }\n const { nodePositions } = model\n if (!nodePositions) {\n return null\n }\n const { x, y } = screenToLayout(sx, sy, model, model.axisScale)\n return findHoveredNode(\n nodePositions,\n x,\n y,\n model.axisScale,\n model.positionsVersion,\n model.nodeInk,\n )\n }\n\n function edgeAt(sx: number, sy: number) {\n const { nodePositions, graph } = model\n if (!nodePositions || !graph) {\n return null\n }\n const { x, y } = screenToLayout(sx, sy, model, model.axisScale)\n return findHoveredEdge(\n nodePositions,\n graph,\n x,\n y,\n model.axisScale,\n // resolved, so the hit index bounds the ribbons that are actually\n // drawn \u2014 see effectiveDrawPaths. Facet panels draw none.\n model.effectiveDrawPaths && !model.facetPanels,\n model.positionsVersion,\n model.deletionEdgeIndexes,\n model.hiddenEdgeIndexes,\n model.deletionRoutes,\n model.layoutResult?.stranded,\n )\n }\n\n function onMouseDown(e: React.MouseEvent) {\n if (e.button === 0) {\n e.preventDefault()\n }\n }\n\n // Captured, so a drag keeps going over a bubble chip or the gap between\n // facet panels, and a finger drags as a mouse does\n function onPointerDown(e: React.PointerEvent) {\n if (e.button !== 0) {\n return\n }\n const points = pointsRef.current\n if (isOtherPointer(e)) {\n if (\n model.isPanning &&\n !verticalPanRef.current &&\n e.pointerType === 'touch' &&\n points.size === 1\n ) {\n e.currentTarget.setPointerCapture(e.pointerId)\n points.set(e.pointerId, pointOf(e))\n pinchRef.current = pinchOf(points)\n hasMovedRef.current = true\n }\n return\n }\n hasMovedRef.current = false\n downRef.current = { x: e.clientX, y: e.clientY }\n e.currentTarget.removeAttribute(GESTURE_OWNER)\n const follows = model.followsHostView\n // shift-drag is the view's range select\n if (model.hostPlacesX || (follows && e.shiftKey)) {\n return\n }\n e.currentTarget.setPointerCapture(e.pointerId)\n dragPointerRef.current = e.pointerId\n dragCanvasRef.current = e.currentTarget\n points.clear()\n points.set(e.pointerId, pointOf(e))\n const { x, y } = pointerAt(e)\n const onStrip = y < model.referenceStripZonePx\n // a tube map's boxes are the layout's, and the strip's are bp, not\n // positions to drag\n const node = model.layoutResult?.tubeMap || onStrip ? null : nodeAt(x, y)\n // A drawing the view drives leaves the press to the view's own pan,\n // which carries the drawing sideways, and takes only the vertical. A\n // press on a node is the node's: the marker keeps the view's pan off it,\n // since this handler runs before the view's. The strip is the view's bp,\n // so dragging it scrolls the view in either case.\n if (follows && node) {\n e.currentTarget.setAttribute(GESTURE_OWNER, '')\n }\n verticalPanRef.current = follows\n stripPanRef.current = onStrip && !follows\n if (node) {\n model.setDraggingNode(node)\n } else {\n model.setPanning(true)\n }\n lastMouseRef.current = { x: e.clientX, y: e.clientY }\n }\n\n // zooms about where the fingers' midpoint was and pans by how far it moved\n function pinchStep() {\n const was = pinchRef.current\n const canvas = dragCanvasRef.current\n if (!was || !canvas) {\n return\n }\n const now = pinchOf(pointsRef.current)\n const rect = canvas.getBoundingClientRect()\n if (was.spread > 0 && now.spread > 0) {\n model.zoom(\n now.spread / was.spread,\n was.mid.x - rect.left,\n was.mid.y - rect.top,\n )\n }\n model.setTransform(\n model.scale,\n model.translateX + now.mid.x - was.mid.x,\n model.translateY + now.mid.y - was.mid.y,\n )\n pinchRef.current = now\n }\n\n function applyPending() {\n const pending = pendingRef.current\n const { pan, hover, pinch } = pending\n pending.frame = 0\n pending.pan = null\n pending.hover = null\n pending.pinch = false\n if (pinch) {\n pinchStep()\n }\n if (pan && stripPanRef.current) {\n model.host?.horizontalScroll(-pan.dx)\n } else if (pan && verticalPanRef.current) {\n model.setTransform(\n model.scale,\n model.translateX,\n model.translateY + pan.dy,\n )\n } else if (pan) {\n model.setTransform(\n model.scale,\n model.translateX + pan.dx,\n model.translateY + pan.dy,\n )\n }\n if (!hover) {\n return\n }\n const { x: sx, y: sy } = hover\n const chip = model.facetPanels\n ? undefined\n : chipReadoutAt(model.overlayLabels, sx, sy)\n setHoveredChip(was =>\n was?.label === chip?.label && was?.readout === chip?.readout ? was : chip,\n )\n const bars = model.walkRowBars\n if (bars) {\n const i = model.walkRowAt(sx, sy)\n model.setHoveredWalkRow(\n i === undefined ? null : [bars.reference, ...bars.rows][i]!.name,\n )\n }\n if (model.nodePositions && model.graph) {\n const node = nodeAt(sx, sy)\n model.setHoveredPanel(model.tubeMapPanelAt(sy))\n model.setHoveredNode(node, { x: sx, y: sy })\n setOverDraggable(\n node !== null &&\n !model.hostPlacesX &&\n !model.layoutResult?.tubeMap &&\n sy >= model.referenceStripZonePx,\n )\n model.setHoveredTube(\n node === null && model.layoutResult?.tubeMap\n ? model.tubeAt(sx, sy)\n : null,\n )\n model.setHoveredEdge(\n node || model.layoutResult?.tubeMap || !model.hoverLightsEverything\n ? null\n : edgeAt(sx, sy),\n )\n }\n }\n\n function scheduleFrame() {\n if (!pendingRef.current.frame) {\n pendingRef.current.frame = requestAnimationFrame(applyPending)\n }\n }\n\n function dropPending() {\n const pending = pendingRef.current\n cancelAnimationFrame(pending.frame)\n pending.frame = 0\n pending.pan = null\n pending.hover = null\n pending.pinch = false\n }\n\n function onPointerMove(e: React.PointerEvent) {\n const points = pointsRef.current\n if (pinchRef.current && points.has(e.pointerId)) {\n points.set(e.pointerId, pointOf(e))\n pendingRef.current.pinch = true\n scheduleFrame()\n return\n }\n if (isOtherPointer(e)) {\n return\n }\n const dx = e.clientX - lastMouseRef.current.x\n const dy = e.clientY - lastMouseRef.current.y\n lastMouseRef.current = { x: e.clientX, y: e.clientY }\n\n // from where the button went down, not per event: a slow drag moves a\n // pixel at a time\n if (\n Math.hypot(e.clientX - downRef.current.x, e.clientY - downRef.current.y) >\n CLICK_SLOP_PX\n ) {\n hasMovedRef.current = true\n }\n\n const pending = pendingRef.current\n if (model.draggingNode) {\n model.moveNode(model.draggingNode, dx / model.scaleX, dy / model.scaleY)\n } else if (model.isPanning) {\n pending.pan = {\n dx: (pending.pan?.dx ?? 0) + dx,\n dy: (pending.pan?.dy ?? 0) + dy,\n }\n scheduleFrame()\n } else {\n const rect = (\n e.currentTarget as HTMLCanvasElement\n ).getBoundingClientRect()\n pending.hover = { x: e.clientX - rect.left, y: e.clientY - rect.top }\n scheduleFrame()\n }\n }\n\n // also the end of a capture the browser took back\n function onPointerUp(e: React.PointerEvent) {\n const points = pointsRef.current\n if (pinchRef.current && points.has(e.pointerId)) {\n if (pendingRef.current.pinch) {\n pendingRef.current.pinch = false\n pinchStep()\n }\n points.delete(e.pointerId)\n pinchRef.current = null\n const [[id, at]] = [...points] as [[number, Point]]\n dragPointerRef.current = id\n lastMouseRef.current = at\n return\n }\n if (isOtherPointer(e)) {\n return\n }\n dragPointerRef.current = undefined\n points.clear()\n if (isAlive(model)) {\n model.stopDragging()\n }\n }\n\n // also fired by the canvas unmounting under a resting pointer, after the\n // view closing it has destroyed the model, and by a finger lifting\n function onPointerLeave(e: React.PointerEvent) {\n if (isOtherPointer(e)) {\n return\n }\n dragPointerRef.current = undefined\n pointsRef.current.clear()\n pinchRef.current = null\n dropPending()\n setHoveredChip(undefined)\n setOverDraggable(false)\n if (!isAlive(model)) {\n return\n }\n model.stopDragging()\n model.clearHover()\n }\n\n // Right-clicking a node is the gesture that asks \"where is this?\", and until\n // now the graph had no answer: a node named an assembly and an offset in its\n // tags that nothing surfaced. The items come from the model's launch targets,\n // so what is offered is what can actually be opened.\n function onContextMenu(e: React.MouseEvent) {\n const { x, y } = pointerAt(e)\n const node = nodeAt(x, y)\n const { clientX, clientY } = e\n if (node) {\n e.preventDefault()\n setContextMenu({ clientX, clientY, nodeId: node })\n return\n }\n const row = model.walkRowAt(x, y)\n if (row !== undefined) {\n e.preventDefault()\n setContextMenu({ clientX, clientY, row })\n }\n }\n\n function onClick(e: React.MouseEvent) {\n // a click that ended a drag selects nothing\n if (!hasMovedRef.current) {\n const { x, y } = pointerAt(e)\n const node = nodeAt(x, y)\n model.setSelectedNode(node)\n if (node) {\n model.showNodeDetails(node)\n }\n }\n }\n\n // A press on a bubble's label or tick pans once it travels, as a press on\n // the drawing does, rather than leaving a patch of the graph that will not\n // drag; one that stays put is a click on the label. The click that ends a\n // pan is swallowed before the label sees it.\n const labelPanRef = useRef<{ end: () => void; moved: boolean } | null>(null)\n useEffect(\n () => () => {\n labelPanRef.current?.end()\n },\n [],\n )\n function onLabelPointerDown(e: React.PointerEvent) {\n if (\n e.button !== 0 ||\n model.hostPlacesX ||\n model.followsHostView ||\n !(e.target instanceof Element) ||\n !e.target.closest(`[${PANS_WITH_DRAWING}]`)\n ) {\n return\n }\n labelPanRef.current?.end()\n const id = e.pointerId\n const start = pointOf(e)\n let last = start\n const gesture = {\n moved: false,\n end: () => {\n window.removeEventListener('pointermove', move, true)\n window.removeEventListener('pointerup', release, true)\n window.removeEventListener('pointercancel', release, true)\n if (gesture.moved && isAlive(model)) {\n model.stopDragging()\n }\n },\n }\n function move(ev: PointerEvent) {\n if (ev.pointerId !== id) {\n return\n }\n if (!gesture.moved) {\n if (\n Math.hypot(ev.clientX - start.x, ev.clientY - start.y) <=\n CLICK_SLOP_PX\n ) {\n return\n }\n gesture.moved = true\n model.setPanning(true)\n }\n const pending = pendingRef.current\n pending.pan = {\n dx: (pending.pan?.dx ?? 0) + ev.clientX - last.x,\n dy: (pending.pan?.dy ?? 0) + ev.clientY - last.y,\n }\n last = pointOf(ev)\n scheduleFrame()\n }\n // the click, if any, lands before the timeout clears the gesture\n function release(ev: PointerEvent) {\n if (ev.pointerId === id) {\n gesture.end()\n setTimeout(() => {\n if (labelPanRef.current === gesture) {\n labelPanRef.current = null\n }\n }, 0)\n }\n }\n labelPanRef.current = gesture\n window.addEventListener('pointermove', move, true)\n window.addEventListener('pointerup', release, true)\n window.addEventListener('pointercancel', release, true)\n }\n function onLabelClickCapture(e: React.MouseEvent) {\n if (labelPanRef.current?.moved) {\n labelPanRef.current = null\n e.stopPropagation()\n }\n }\n\n const canvasStyle: React.CSSProperties = {\n cursor:\n model.isPanning || model.draggingNode\n ? 'grabbing'\n : overDraggable\n ? 'move'\n : 'grab',\n // a pane the linear view drags leaves a finger its scroll\n touchAction: model.hostPlacesX ? 'auto' : 'none',\n overscrollBehavior: 'contain',\n }\n\n // A hosted pane that pans itself claims every press on its surface, labels\n // and strip included: the linear view's pan starts on pointerdown and skips\n // `[data-gesture-owner]`, and its shift-drag range select starts on\n // mousedown.\n const claimsPress =\n model.host !== undefined && !model.hostPlacesX && !model.followsHostView\n const surfaceProps = claimsPress\n ? {\n [GESTURE_OWNER]: '',\n onMouseDown: (e: React.MouseEvent) => {\n e.stopPropagation()\n },\n }\n : {}\n\n return {\n canvasStyle,\n surfaceProps,\n handlers: {\n onMouseDown,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel: onPointerUp,\n onLostPointerCapture: onPointerUp,\n onPointerLeave,\n onClick,\n onContextMenu,\n },\n contextMenu,\n hoveredChip,\n labelHandlers: {\n onPointerDown: onLabelPointerDown,\n onClickCapture: onLabelClickCapture,\n },\n closeContextMenu: () => {\n setContextMenu(undefined)\n },\n }\n}\n\nexport type PaneHandlers = ReturnType<typeof usePaneGestures>['handlers']\n", "import { Canvas2DRenderer } from '@jbrowse/bandage-core/renderer/Canvas2DRenderer'\n\n// Canvas2D only, and deliberately not through render-core's GPU ladder. The\n// batch is strokes and arrowheads in layout units, and stroking them batched by\n// colour is inside a frame budget at the node counts this view caps itself at\n// (agent-docs/reference/GRAPH_SCALE_AND_LOD.md), so a GPU backend would buy a few\n// milliseconds for ~30 KB of bundled HAL and a shader toolchain. If one is ever\n// wanted, it should take the same `Renderer` interface and draw the batch as\n// instances \u2014 a capsule per node segment, a bezier ribbon per edge stroke \u2014\n// rather than reviving a triangle mesh; agent-docs/ideas/waiting-on-a-number scopes it.\nexport function createGraphRenderer(canvas: HTMLCanvasElement) {\n return Promise.resolve(new Canvas2DRenderer(canvas))\n}\n", "import { useEffect, useRef, useState } from 'react'\n\nimport { LEGEND_INSET_PX } from '@jbrowse/bandage-core/labelLayout'\nimport { ErrorBanner, LoadingOverlay } from '@jbrowse/core/ui'\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { useRenderingBackend } from '@jbrowse/render-core/useRenderingBackend'\nimport { observer } from 'mobx-react'\n\nimport BubbleHalos from './BubbleHalos'\nimport FacetPanels from './FacetPanels'\nimport GenePins from './GenePins'\nimport GraphToolbar from './GraphToolbar'\nimport HoverLayer from './HoverLayer'\nimport HoverTooltip from './HoverTooltip'\nimport LabelLayer from './LabelLayer'\nimport { LegendPanel } from './Legend'\nimport PaneContextMenu from './PaneContextMenu'\nimport { PaneSvgLayer } from './PaneLayer'\nimport ReferenceStripOverlay from './ReferenceStripOverlay'\nimport TubeMapOverlay from './TubeMapOverlay'\nimport WalkRowsOverlay from './WalkRowsOverlay'\nimport WalkStrip from './WalkStrip'\nimport WalkStripLocator from './WalkStripLocator'\nimport { usePaneGestures, useWheelZoom } from './usePaneGestures'\nimport { PAPER_CSS } from '../pane/paneBase'\nimport { createGraphRenderer } from '../renderer/GraphRenderer'\n\nimport type { GraphPaneModel } from '../model'\n\nconst wrapperStyle = { position: 'relative' as const }\n\n// The overlay origin has to be the canvas, not the wrapper: the wrapper also\n// holds the toolbar, so anything positioned against it is offset by the\n// toolbar's height, and a row label lands a whole row off the row it names.\nconst canvasAreaStyle = {\n position: 'relative' as const,\n lineHeight: 0,\n isolation: 'isolate' as const,\n}\n\n// Under a transparent canvas, from below the reference strip down, so the\n// linear view's gridlines show only behind the strip\nconst paperStyle = {\n position: 'absolute' as const,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 0,\n}\n\n// Above the labels, pins and legends drawn over the canvas, and with the line\n// height the canvas area zeroes, which would collapse the overlay's label\nconst loadingLayerStyle = {\n position: 'absolute' as const,\n inset: 0,\n zIndex: 10,\n lineHeight: 'normal',\n pointerEvents: 'none' as const,\n}\n\nconst rowLabelStyle = {\n position: 'absolute' as const,\n left: 6,\n transform: 'translateY(-50%)',\n background: 'rgba(255,255,255,0.82)',\n padding: '0 4px',\n borderRadius: 3,\n fontSize: 11,\n // explicit, because the canvas container zeroes line-height to kill the\n // inline-block gap under the canvas. Inherited, that collapses the label to a\n // zero-height box: it still paints, but it has no layout, so anything asking\n // whether it is visible (a screenshot spec's waitForVisible, a11y tooling)\n // is told no.\n lineHeight: '16px',\n whiteSpace: 'nowrap' as const,\n pointerEvents: 'none' as const,\n zIndex: 4,\n}\n\n// Names the rows of a row-structured layout (anchored, sample rows). Without\n// them the layout draws real structure that cannot be read: a stack of bars\n// where every row means something and nothing says what.\n//\n// Positioned from the layout's own `rowLabels` through the same transform the\n// canvas draws with, so a label tracks its row across pan and zoom instead of\n// sitting at a measured pixel. It therefore has to be mounted in the canvas's\n// own positioning context (canvasAreaStyle) \u2014 against the wrapper it picks up\n// the toolbar's height and names the wrong row. Pinned to the left edge rather\n// than to the row's own x, because a row's leftmost node is wherever its first\n// allele happens to branch.\n//\n// Keyed on the row, not on the label: two rows can have the same words. The\n// sample-row layout names row 0 for the assembly the backbone comes from and\n// the rows below it for the samples contributing alleles, and a diploid\n// reference is in both lists \u2014 one haplotype is the reference path, the other\n// walks alleles of its own, and `parsePanSN` reduces both to one sample name.\nconst RowLabels = observer(function RowLabels({\n model,\n}: {\n model: GraphPaneModel\n}) {\n return (\n <>\n {model.visibleRowLabels.map(({ label, y, top }) => (\n <div\n key={y}\n data-testid=\"graph-row-label\"\n style={{ ...rowLabelStyle, top }}\n >\n {label}\n </div>\n ))}\n </>\n )\n})\n\n// Top RIGHT: the row labels own the left edge and the hover tooltip owns the\n// bottom right, so this is the one corner nothing else claims. Every key\n// stretches to the widest, so together they read as one panel. It takes the\n// pointer, for its rows' titles and its close button.\nconst legendStackStyle = {\n position: 'absolute' as const,\n top: LEGEND_INSET_PX,\n right: LEGEND_INSET_PX,\n display: 'flex',\n flexDirection: 'column' as const,\n borderRadius: 3,\n overflow: 'hidden' as const,\n zIndex: 4,\n}\n\nconst nodeLabelStyle = {\n position: 'absolute' as const,\n transform: 'translate(-50%, -50%)',\n background: 'rgba(255,255,255,0.78)',\n padding: '0 3px',\n borderRadius: 3,\n fontSize: 10,\n lineHeight: '13px',\n whiteSpace: 'nowrap' as const,\n pointerEvents: 'none' as const,\n zIndex: 3,\n}\n\n// Matches EDGE_DELETION_COLOR, so the words and the arc they name are one thing.\nconst deletionLabelStyle = {\n ...nodeLabelStyle,\n color: '#18181c',\n fontWeight: 600,\n}\n\n// Measures itself for the model, so no label is placed under a legend and\n// none gives way to one that is not drawn.\n//\n// At rest only, and again on returning to rest: a hover's walk keys would\n// otherwise refit the view, and the refit clears the hover that grew them\nexport const Legends = observer(function Legends({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const ref = useRef<HTMLDivElement>(null)\n const atRest = model.legendAtRest\n useEffect(() => {\n const el = ref.current\n if (!el || !atRest) {\n return\n }\n // the last callback can land after the track is closed\n const measure = () => {\n if (isAlive(model) && model.legendAtRest) {\n model.setLegendSize({ width: el.offsetWidth, height: el.offsetHeight })\n }\n }\n measure()\n const observer = new ResizeObserver(measure)\n observer.observe(el)\n return () => {\n observer.disconnect()\n }\n }, [model, atRest])\n return (\n <div\n ref={ref}\n style={{\n ...legendStackStyle,\n top: LEGEND_INSET_PX + model.referenceStripZonePx,\n }}\n >\n <LegendPanel model={model} />\n </div>\n )\n})\n\n// Writes each drawn thing's size onto it, which is what Bandage's Length label\n// does and what the tooltip alone could not: a graph you have to hover to read\n// is a graph nobody reads. graphLabels applies the same transform the canvas\n// draws with \u2014 so a label tracks its node across pan and zoom \u2014 and decides\n// which labels fit; this only paints them, mounted in the canvas's own\n// positioning context for the reason RowLabels is.\nconst GraphSizeLabels = observer(function GraphSizeLabels({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const labels = model.overlayLabels.sizes\n // A label too wide for the arc it names is placed clear of it and tethered\n // back; nothing else in the drawing carries one.\n const leaders = labels.flatMap(({ key, leader }) =>\n leader ? [{ key, ...leader }] : [],\n )\n return (\n <>\n {/* under the labels (z 3), so a leader runs beneath the text it points\n from; the placement culls a label past the canvas edge, so the\n layer leaves overflow visible */}\n {leaders.length > 0 ? (\n <PaneSvgLayer model={model} zIndex={2} overflow=\"visible\">\n {leaders.map(({ key, arcX, arcY, labelX, labelY }) => (\n <line\n key={key}\n data-testid=\"graph-label-leader\"\n x1={arcX}\n y1={arcY}\n x2={labelX}\n y2={labelY}\n stroke=\"#18181c\"\n strokeWidth={1}\n />\n ))}\n </PaneSvgLayer>\n ) : null}\n {labels.map(({ key, text, x, y, kind }) => (\n <div\n key={key}\n data-testid=\"graph-size-label\"\n style={{\n ...(kind === 'deletion' ? deletionLabelStyle : nodeLabelStyle),\n left: x,\n top: y,\n }}\n >\n {text}\n </div>\n ))}\n </>\n )\n})\n\n// `ownChrome` false for a pane inside a track, whose controls, loading state\n// and errors are the track's. A hosted pane whose x the host places takes no pan or wheel of its\n// own: those are the linear view's, as on any other track. One drawing its\n// own coordinates inside a track keeps them, and keeps them from the view.\nconst GraphCanvas = observer(function GraphCanvas({\n model,\n ownChrome = true,\n}: {\n model: GraphPaneModel\n ownChrome?: boolean\n}) {\n const {\n canvasRef,\n canvas,\n error: renderError,\n retry: retryRender,\n } = useRenderingBackend(createGraphRenderer, model)\n const {\n handlers,\n canvasStyle,\n surfaceProps,\n labelHandlers,\n contextMenu,\n closeContextMenu,\n hoveredChip,\n } = usePaneGestures(model)\n const [area, setArea] = useState<HTMLDivElement | null>(null)\n useWheelZoom(area, canvas, model)\n const faceted = model.facetPanels !== undefined\n\n return (\n <div style={wrapperStyle} {...surfaceProps}>\n {ownChrome ? <GraphToolbar model={model} /> : null}\n\n <div\n ref={setArea}\n style={canvasAreaStyle}\n {...labelHandlers}\n onMouseEnter={() => {\n model.setPointerInPane(true)\n }}\n onMouseLeave={() => {\n if (isAlive(model)) {\n model.setPointerInPane(false)\n }\n }}\n >\n {model.referenceStripShown ? (\n <div\n style={{\n ...paperStyle,\n top: model.referenceStripZonePx,\n background: PAPER_CSS,\n }}\n />\n ) : null}\n <canvas\n ref={canvasRef}\n data-testid=\"graph-genome-canvas\"\n style={{\n ...canvasStyle,\n width: model.paneWidth,\n height: model.canvasHeight,\n display: 'block',\n position: 'relative',\n zIndex: 1,\n }}\n {...handlers}\n />\n\n {faceted ? (\n <FacetPanels\n model={model}\n handlers={handlers}\n canvasStyle={canvasStyle}\n />\n ) : (\n <>\n <TubeMapOverlay model={model} />\n <HoverLayer model={model} />\n <ReferenceStripOverlay model={model} />\n <RowLabels model={model} />\n <GraphSizeLabels model={model} />\n <BubbleHalos model={model} />\n <GenePins model={model} />\n <LabelLayer model={model} />\n <WalkRowsOverlay model={model} />\n <WalkStripLocator model={model} />\n <Legends model={model} />\n </>\n )}\n\n {ownChrome ? (\n <div style={loadingLayerStyle}>\n <LoadingOverlay\n isVisible={model.isLoading}\n immediate={!model.layoutResult}\n statusMessage={model.statusMessage}\n onCancel={\n model.canCancelLoad\n ? () => {\n model.cancelLoad()\n }\n : undefined\n }\n />\n </div>\n ) : null}\n\n <HoverTooltip model={model} chip={hoveredChip} />\n </div>\n\n {model.walkStripShown ? <WalkStrip model={model} /> : null}\n\n <PaneContextMenu\n model={model}\n at={contextMenu}\n onClose={closeContextMenu}\n />\n\n {renderError ? (\n <ErrorBanner error={renderError} onReset={retryRender} />\n ) : null}\n\n {ownChrome && model.error ? (\n <ErrorBanner\n error={model.error}\n onReset={\n model.canRetryLoad\n ? () => {\n model.retryLoad()\n }\n : undefined\n }\n />\n ) : null}\n </div>\n )\n})\n\nexport default GraphCanvas\n"],
|
|
5
5
|
"mappings": "k+BAAA,IAAMA,EAAO,eAAe,0CAA0C,EAChEC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MACR,kCAAoCA,EAAO,0JAC7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AOxD,EACP,SAAUyC,EACV,YAAaC,EACf,EAEAlB,EAAAtB,EAAA,CACE,UAAAD,EAACwD,GAAA,CAAe,MAAOzD,EAAO,EAC9BC,EAACyD,GAAA,CAAW,MAAO1D,EAAO,EAC1BC,EAAC0D,GAAA,CAAsB,MAAO3D,EAAO,EACrCC,EAACH,GAAA,CAAU,MAAOE,EAAO,EACzBC,EAACkB,GAAA,CAAgB,MAAOnB,EAAO,EAC/BC,EAAC2D,GAAA,CAAY,MAAO5D,EAAO,EAC3BC,EAAC4D,GAAA,CAAS,MAAO7D,EAAO,EACxBC,EAAC6D,GAAA,CAAW,MAAO9D,EAAO,EAC1BC,EAAC8D,GAAA,CAAgB,MAAO/D,EAAO,EAC/BC,EAAC+D,GAAA,CAAiB,MAAOhE,EAAO,EAChCC,EAACS,GAAA,CAAQ,MAAOV,EAAO,GACzB,EAGDkC,EACCjC,EAAC,OAAI,MAAOL,GACV,SAAAK,EAACgE,GAAA,CACC,UAAWjE,EAAM,UACjB,UAAW,CAACA,EAAM,aAClB,cAAeA,EAAM,cACrB,SACEA,EAAM,cACF,IAAM,CACJA,EAAM,WAAW,CACnB,EACA,OAER,EACF,EACE,KAEJC,EAACiE,GAAA,CAAa,MAAOlE,EAAO,KAAM+C,EAAa,GACjD,EAEC/C,EAAM,eAAiBC,EAACkE,GAAA,CAAU,MAAOnE,EAAO,EAAK,KAEtDC,EAACmE,EAAA,CACC,MAAOpE,EACP,GAAI6C,EACJ,QAASC,EACX,EAECT,EACCpC,EAACoE,GAAA,CAAY,MAAOhC,EAAa,QAASC,EAAa,EACrD,KAEHJ,GAAalC,EAAM,MAClBC,EAACoE,GAAA,CACC,MAAOrE,EAAM,MACb,QACEA,EAAM,aACF,IAAM,CACJA,EAAM,UAAU,CAClB,EACA,OAER,EACE,MACN,CAEJ,CAAC,EAEMsE,GAAQrC",
|
|
6
6
|
"names": ["host", "read", "name", "useRenderingBackend", "read", "useRenderingBackend_default", "host", "hoverLayerStyle", "paneLayerStyle", "HoverLayer", "model", "canvas", "setCanvas", "useState", "useEffect", "renderer", "Canvas2DRenderer", "dispose", "autorun", "dependOn", "trackedDpr", "jsx", "legendBoxStyle", "legendRowStyle", "legendNoteStyle", "LegendRowView", "row", "at", "hint", "after", "jsxs", "legendRowStyle", "jsx", "LegendSwatchView", "legendNoteStyle", "closeStyle", "LegendPanel", "observer", "model", "Fragment", "legendSections", "testid", "rows", "legendBoxStyle", "gridStyle", "FACET_GAP_PX", "titleStyle", "FACET_TITLE_PX", "panelStyle", "keyStyle", "FACET_KEY_ROW_PX", "FacetPanel", "observer", "model", "lift", "width", "height", "cell", "handlers", "canvasStyle", "canvas", "setCanvas", "useState", "hoverCanvas", "setHoverCanvas", "walk", "useEffect", "renderer", "Canvas2DRenderer", "hover", "drawing", "computed", "uploaded", "disposers", "autorun", "grid", "built", "dispose", "label", "jsxs", "jsx", "LegendRowView", "walkKeyRow", "hoverLayerStyle", "FacetPanels", "panels", "place", "columns", "PAPER_CSS", "i", "facetKeyRows", "row", "FacetPanels_default", "CropFree_default", "createSvgIcon", "jsx", "ZoomIn_default", "createSvgIcon", "jsx", "ZoomOut_default", "createSvgIcon", "jsx", "ColorSchemeSelect", "observer", "model", "fixed", "jsx", "LabelledSelect", "COLOR_SCHEMES", "value", "scheme", "ColorSchemeSelect_default", "useStyles", "makeStyles", "fmtMs", "ms", "GraphPerf", "observer", "model", "classes", "lastFetchMs", "lastLayoutMs", "lastGeometryMs", "hasMetrics", "jsxs", "Typography", "GraphStats", "jsx", "GraphStats_default", "LayoutSelect", "observer", "model", "graph", "jsx", "LabelledSelect", "LAYOUT_MODES", "value", "label", "description", "available", "mode", "LayoutSelect_default", "RepeatSelect", "observer", "model", "jsx", "LabelledSelect", "key", "RepeatSelect_default", "Close_default", "createSvgIcon", "jsx", "MoreVert_default", "createSvgIcon", "jsx", "SettingsMenu", "observer", "model", "haplotypes", "jsx", "CascadingMenuButton", "Route_default", "Visibility_default", "Settings_default", "getSession", "onClose", "GraphSettingsDialog_default", "Close_default", "MoreVert_default", "SettingsMenu_default", "useStyles", "makeStyles", "WalkSelect", "observer", "model", "classes", "labelId", "useId", "walkChoices", "names", "c", "labels", "picked", "layer", "name", "WALK_MENU_ITEMS", "jsx", "Button", "getSession", "onClose", "ChooseWalksDialog", "jsxs", "FormControl", "InputLabel", "Select", "selected", "n", "e", "value", "label", "MenuItem", "Checkbox", "ListItemText", "WalkSelect_default", "useStyles", "makeStyles", "ZoomDisplay", "observer", "model", "jsx", "Typography", "GraphToolbar", "classes", "zoomAboutCentre", "factor", "jsxs", "LayoutSelect_default", "ColorSchemeSelect_default", "WalkSelect_default", "RepeatSelect_default", "Tooltip", "IconButton", "ZoomIn_default", "ZoomOut_default", "CropFree_default", "GraphStats_default", "SettingsMenu_default", "GraphToolbar_default", "tooltipStyle", "TOOLTIP_INSET_PX", "labelled", "label", "readout", "jsxs", "Fragment", "jsx", "hoverTip", "model", "chip", "node", "merged", "own", "nodeOwnLocation", "regionLabel", "edge", "text", "edgeHoverText", "d", "id", "walkRow", "tube", "HoverTooltip", "observer", "tip", "HoverTooltip_default", "FilterList_default", "createSvgIcon", "jsx", "FilterListOff_default", "createSvgIcon", "jsx", "Info_default", "createSvgIcon", "jsx", "AT_POINTER", "nodeMenuItems", "model", "nodeId", "own", "reference", "highlight", "Info_default", "nodeLaunchMenuItems", "target", "walkRowMenuItems", "row", "bars", "rows", "assembly", "walk", "sample", "filters", "shown", "regionLabel", "LineStyle_default", "l", "FilterList_default", "FilterListOff_default", "PaneContextMenu", "at", "onClose", "jsx", "ContextMenu", "keyStyle", "tipStyle", "StripBars", "observer", "bars", "frame", "ramp", "rowGenes", "idPrefix", "useSvgId", "tree", "useMemo", "walkRowsTree", "jsx", "ElTree", "StripTip", "model", "hover", "all", "index", "r", "row", "x", "side", "jsxs", "walkRowReadout", "StripMarks", "walkMarksTree", "WalkStrip", "menu", "setMenu", "useState", "hit", "e", "box", "stripRowAt", "key", "walkRowsKey", "RAMP_GRADIENT_CSS", "stripGeneGaps", "isAlive", "at", "walkStripLabelsTree", "l", "entry", "legendRowStyle", "LegendSwatchView", "walkRowSwatch", "PaneContextMenu", "WalkStrip_default", "WalkStripLocator", "observer", "model", "at", "jsxs", "PaneSvgLayer", "jsx", "WalkStripLocator_default", "ZOOM_PER_NOTCH", "NOTCH_PX", "LINE_PX", "PAGE_PX", "PINCH_GAIN", "MAX_NOTCHES_PER_EVENT", "wheelZoomFactor", "e", "px", "notches", "WHEEL_LINE_PX", "ZOOM_ACTIVE_MS", "ZOOM_EASE_MS", "MAX_ZOOM_BACKLOG", "easeZoom", "backlog", "elapsedMs", "rest", "wheelAction", "e", "host", "sideways", "useWheelZoom", "area", "canvas", "model", "useEffect", "lastZoom", "ease", "step", "now", "owed", "isAlive", "handleWheel", "rect", "action", "px", "wheelZoomFactor", "CLICK_SLOP_PX", "GESTURE_OWNER", "pointOf", "pinchOf", "points", "a", "b", "usePaneGestures", "lastMouseRef", "useRef", "downRef", "hasMovedRef", "dragPointerRef", "isOtherPointer", "pointsRef", "dragCanvasRef", "pinchRef", "stripPanRef", "verticalPanRef", "pendingRef", "contextMenu", "setContextMenu", "useState", "overDraggable", "setOverDraggable", "hoveredChip", "setHoveredChip", "pointerAt", "nodeAt", "sx", "sy", "onStrip", "nodePositions", "x", "y", "screenToLayout", "findHoveredNode", "edgeAt", "graph", "findHoveredEdge", "onMouseDown", "onPointerDown", "follows", "node", "pinchStep", "was", "applyPending", "pending", "pan", "hover", "pinch", "chip", "chipReadoutAt", "bars", "i", "scheduleFrame", "dropPending", "onPointerMove", "dx", "dy", "onPointerUp", "id", "at", "onPointerLeave", "onContextMenu", "clientX", "clientY", "row", "onClick", "labelPanRef", "onLabelPointerDown", "PANS_WITH_DRAWING", "start", "last", "gesture", "move", "release", "ev", "onLabelClickCapture", "canvasStyle", "surfaceProps", "createGraphRenderer", "canvas", "Canvas2DRenderer", "wrapperStyle", "canvasAreaStyle", "paperStyle", "loadingLayerStyle", "rowLabelStyle", "RowLabels", "observer", "model", "jsx", "Fragment", "label", "y", "top", "legendStackStyle", "LEGEND_INSET_PX", "nodeLabelStyle", "deletionLabelStyle", "Legends", "ref", "useRef", "atRest", "useEffect", "el", "measure", "isAlive", "LegendPanel", "GraphSizeLabels", "labels", "leaders", "key", "leader", "jsxs", "PaneSvgLayer", "arcX", "arcY", "labelX", "labelY", "text", "x", "kind", "GraphCanvas", "ownChrome", "canvasRef", "canvas", "renderError", "retryRender", "useRenderingBackend", "createGraphRenderer", "handlers", "canvasStyle", "surfaceProps", "labelHandlers", "contextMenu", "closeContextMenu", "hoveredChip", "usePaneGestures", "area", "setArea", "useState", "useWheelZoom", "faceted", "GraphToolbar_default", "PAPER_CSS", "FacetPanels_default", "TubeMapOverlay_default", "HoverLayer", "ReferenceStripOverlay_default", "BubbleHalos_default", "GenePins_default", "LabelLayer_default", "WalkRowsOverlay_default", "WalkStripLocator_default", "LoadingOverlay", "HoverTooltip_default", "WalkStrip_default", "PaneContextMenu", "ErrorBanner", "GraphCanvas_default"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{e as g}from"./chunk-MVVXRZXV.js";import{e as C}from"./chunk-IKJZPPOA.js";function A(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ne(e){let t=g(e,"assemblyNames"),n=A(t)?t.slice(1):[];return n.length>0?n:void 0}function M(e){return e.type==="WalkTabixSyntenyAdapter"||e.type==="RgfaTabixAdapter"&&(typeof e.walksUri=="string"&&e.walksUri!==""||C(e.walksLocation))}function te(e){return e.type==="GbzBaseSyntenyAdapter"||M(e)}function re(e){let{defaultHaplotypes:t}=e;return M(e)&&A(t)&&t.length>0?t:void 0}function se(e){let t=g(e,"assemblyNames");return A(t)?t[0]:void 0}function oe(e,t){return e===void 0||e===t?void 0:`The graph is cut on its reference, ${e}: open it from a view of ${e}`}function i(e,t){return typeof e.get=="function"?e.get(t):e[t]}function y(e,t){return e.find(n=>n.trackId===t)}function h(e){return`${e.trackId} ${e.name??""}`}var $=new Set(["BedAdapter","BedTabixAdapter","BigBedAdapter","VcfAdapter","VcfTabixAdapter"]),R=/repeat|tandem|\bstr\b|vntr|trf|trgt|vamos|expansion|microsat/i;function He(e,t){let n=t?y(e,t):void 0;return n||e.filter(s=>$.has(s.adapterType)).find(s=>R.test(h(s)))}var O=/^\w+=[^;]*(;\w+=[^;]*)*$/;function G(e){let t=i(e,"name");if(!(typeof t!="string"||!O.test(t)))return Object.fromEntries(t.split(";").map(n=>{let r=n.indexOf("=");return[n.slice(0,r),n.slice(r+1)]}))}function d(e,t){let n=i(e,t);return n!==void 0?n:i(e,"INFO")?.[t]??G(e)?.[t]}var P=["RUS","MOTIFS","RU","motifs","motif","sequence","consensus"],U=["RUL","period","PERIOD","consensusSize","unit","unitLength"],H=["TRID","REPID","VARID","ID","name","id"];function T(e,t){for(let n of t){let r=d(e,n),s=String((Array.isArray(r)?r[0]:r)??"").split(",")[0].trim();if(s!==""&&s!==".")return s}}var B=/^[ACGTURYSWKMBDHVN]+$/i;function v(e){let t=Number(T(e,U));if(Number.isFinite(t)&&t>0)return Math.round(t);let n=T(e,P);return n&&B.test(n)?n.length:void 0}function m(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(n=>{let r=n===""||n===null||n===void 0?NaN:Number(n);return Number.isFinite(r)?r:void 0})}function N(e){return(Array.isArray(e)?e:String(e??"").split(",")).map(n=>{let r=String(n??"").trim();return r===""||r==="."?void 0:r})}var w="<CNV:TR>";function j(e){let t=N(i(e,"ALT"));if(!t.includes(w))return;let n=m(d(e,"RN")),r=N(d(e,"RUS")),s=m(d(e,"RUL")),o=m(d(e,"RUC")),a=m(d(e,"RB")),c=0;return t.map((u,f)=>{let p=n[f]??(u===w?1:0),b=0,S=0;for(let F=0;F<p;F++,c++){let x=r[c],L=s[c]??(x&&B.test(x)?x.length:void 0),_=o[c],I=a[c]??(L&&_!==void 0?Math.round(L*_):void 0);I!==void 0&&(b+=I,S++)}return u===w&&p>0&&S===p?b:void 0})}function V(e,t,n){let r=e?.includes("|");return(e??"").split(/[/|]/).flatMap((s,o)=>{let a=s===""?NaN:Number(s),c=a>0?t[a-1]:n;return!Number.isInteger(a)||c===void 0?[]:[{bp:c,...r?{haplotype:o+1}:{}}]})}function W(e,t,n){let r=i(e,"samples"),s={};for(let[o,a]of Object.entries(r??{})){let c=m(a.SD),u=m(a.AL).flatMap((p,b)=>p!==void 0&&p>0?[c[b]===void 0?{bp:p}:{bp:p,spanningReads:c[b]}]:[]),f=u.length>0||!t?u:V(N(a.GT)[0],t,n);f.length>0&&(s[o]=f)}return Object.keys(s).length>0?s:void 0}function Y(e,t){let n=d(e,"start"),r=d(e,"end"),s=m(d(e,"SVLEN"))[0];return t&&s!==void 0?{start:n+1,end:n+1+s}:{start:n,end:r}}function ve(e){let t=[];for(let n of e){let r=j(n),{start:s,end:o}=Y(n,r!==void 0),a=v(n);if(!(o>s)||a===void 0)continue;let c=d(n,"refName"),u=T(n,P),f=T(n,H);t.push({key:`${c}:${s}-${o}`,name:(f&&!O.test(f)?f:void 0)??(u&&u.length<=12?`(${u})n`:`${c}:${(s+1).toLocaleString("en-US")}-${o.toLocaleString("en-US")}`),refName:c,start:s,end:o,unit:a,motif:u,calls:W(n,r,o-s)})}return t.sort((n,r)=>n.start-r.start)}function k(e){let t=[];for(let n of[...e].sort((r,s)=>r.start-s.start)){let r=t.at(-1);r&&n.start<=r.end?r.end=Math.max(r.end,n.end):t.push({...n})}return t}function E(e){let t=[],n=new Map;for(let r of[...e].sort((s,o)=>s.start-o.start)){let s=`${r.refName} ${r.strand} ${r.name}`,o=n.get(s);if(o&&r.start<o.end)o.end=Math.max(o.end,r.end),o.exons=k([...o.exons,...r.exons]);else{let a={...r,exons:k(r.exons)};t.push(a),n.set(s,a)}}return t}var K=new Set(["Gff3TabixAdapter","Gff3Adapter","BedTabixAdapter","BedAdapter","GtfTabixAdapter","GtfAdapter","BigBedAdapter","NCListAdapter"]),J=/gene|refseq|gencode|ensembl|annotation/i,q=new Set(["BedTabixAdapter","BedAdapter"]);function en(e,t){let n=t?y(e,t):void 0;if(n)return n;let r=e.filter(s=>K.has(s.adapterType)&&!R.test(h(s)));return r.find(s=>J.test(h(s)))??r.find(s=>!q.has(s.adapterType))}function nn(e,t){let n=e.tracks?.find(r=>g(r.configuration,"trackId")===t)?.displays[0];return n?g(n.configuration,"filter")??[]:[]}var z=new Set(["chromosome","region","contig","supercontig","scaffold"]),X=new Set(["exon","CDS","five_prime_UTR","three_prime_UTR","UTR"]);function D(e,t){let n=i(e,"type");typeof n=="string"&&X.has(n)&&t.push({start:i(e,"start"),end:i(e,"end")});let r=i(e,"subfeatures");for(let s of r??[])D(s,t)}function tn(e){let t=[];for(let n of e){let r=i(n,"gene_name")??i(n,"name")??i(n,"gene")??i(n,"gene_id"),s=i(n,"start"),o=i(n,"end");if(!r||!(o>s)||z.has(i(n,"type")))continue;let a=[];D(n,a),t.push({name:r,refName:i(n,"refName"),start:s,end:o,strand:i(n,"strand")??0,exons:a.length?k(a):[{start:s,end:o}]})}return E(t)}var l=JBrowseExports["tss-react/mui"],Q=e=>l!=null&&e in Object(l)?l[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 sn=Q("makeStyles"),on=l&&l.__esModule?l.default:l;export{ne as a,M as b,te as c,re as d,se as e,oe as f,$ as g,He as h,ve as i,K as j,en as k,nn as l,tn as m,sn as n};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-DBPEUVUC.js.map
|