jbrowse-plugin-graphgenomeviewer 6.14.0 → 6.15.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.
Files changed (71) hide show
  1. package/dist/chunks/{AddTrackWorkflow-WS3KWZRK.js → AddTrackWorkflow-HNHYSVGK.js} +2 -2
  2. package/dist/chunks/{GraphGenomeView-B3TZOQVR.js → GraphGenomeView-CB73XKE6.js} +2 -2
  3. package/dist/chunks/{GraphTrackSettingsDialog-TNYRU3QA.js → GraphTrackSettingsDialog-G2WGJZPI.js} +2 -2
  4. package/dist/chunks/{HighlightColorDialog-RHDRIHE2.js → HighlightColorDialog-T6324WYZ.js} +2 -2
  5. package/dist/chunks/{LinearGraphDisplay-SBO36N3L.js → LinearGraphDisplay-FS63MQSY.js} +2 -2
  6. package/dist/chunks/{chunk-3RRUYIRU.js → chunk-2W3RJJYD.js} +2 -2
  7. package/dist/chunks/chunk-6KOFUWDF.js +2 -0
  8. package/dist/chunks/chunk-6KOFUWDF.js.map +7 -0
  9. package/dist/chunks/{chunk-GEU3LRIY.js → chunk-6Z266PWU.js} +3 -3
  10. package/dist/chunks/chunk-C3ZS6TUU.js +2 -0
  11. package/dist/chunks/chunk-C3ZS6TUU.js.map +7 -0
  12. package/dist/chunks/{chunk-WBU773JJ.js → chunk-DWFNWVKA.js} +2 -2
  13. package/dist/chunks/{chunk-UJARLH7K.js → chunk-FOL5SZ5J.js} +2 -2
  14. package/dist/chunks/chunk-ML64XFIL.js +3 -0
  15. package/dist/chunks/chunk-ML64XFIL.js.map +7 -0
  16. package/dist/chunks/chunk-NDRLCGPC.js +2 -0
  17. package/dist/chunks/{chunk-ELLLNUKS.js.map → chunk-NDRLCGPC.js.map} +2 -2
  18. package/dist/chunks/chunk-UROQIUOU.js +2 -0
  19. package/dist/chunks/{chunk-YYCDD5TV.js.map → chunk-UROQIUOU.js.map} +2 -2
  20. package/dist/chunks/chunk-Y6IJNS73.js +2 -0
  21. package/dist/chunks/chunk-Y6IJNS73.js.map +7 -0
  22. package/dist/chunks/renderSvg-YLEMEY2A.js +2 -0
  23. package/dist/chunks/{renderSvg-PLRJ3YVV.js.map → renderSvg-YLEMEY2A.js.map} +1 -1
  24. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
  25. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  26. package/package.json +1 -1
  27. package/src/GraphGenomeView/components/usePaneGestures.ts +1 -1
  28. package/src/GraphGenomeView/graphLayers.test.ts +20 -0
  29. package/src/GraphGenomeView/graphLayers.ts +43 -0
  30. package/src/GraphGenomeView/hoverHighlight.ts +9 -0
  31. package/src/GraphGenomeView/launchKeys.test.ts +1 -2
  32. package/src/GraphGenomeView/model.test.ts +53 -29
  33. package/src/GraphGenomeView/nodeColor.test.ts +19 -0
  34. package/src/GraphGenomeView/nodeColor.ts +78 -0
  35. package/src/GraphGenomeView/nodeSize.test.ts +14 -0
  36. package/src/GraphGenomeView/nodeSize.ts +25 -0
  37. package/src/GraphGenomeView/pane/fitViews.ts +6 -9
  38. package/src/GraphGenomeView/pane/graphViews.ts +123 -26
  39. package/src/GraphGenomeView/pane/launchActions.ts +11 -7
  40. package/src/GraphGenomeView/pane/loadActions.ts +5 -2
  41. package/src/GraphGenomeView/pane/paneBase.ts +6 -69
  42. package/src/GraphGenomeView/pane/renderingActions.ts +38 -8
  43. package/src/GraphGenomeView/pane/settingActions.ts +54 -18
  44. package/src/GraphGenomeView/renderPipeline.test.ts +2 -0
  45. package/src/GraphGenomeView/subgraphLoad.test.ts +1 -1
  46. package/src/GraphGenomeView/viewModel.ts +45 -6
  47. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +66 -45
  48. package/src/LinearGraphDisplay/configSchema.ts +60 -9
  49. package/src/LinearGraphDisplay/model.ts +536 -562
  50. package/src/hoverSync/index.tsx +1 -1
  51. package/src/version.ts +1 -1
  52. package/dist/chunks/chunk-CRSUERDN.js +0 -3
  53. package/dist/chunks/chunk-CRSUERDN.js.map +0 -7
  54. package/dist/chunks/chunk-ELLLNUKS.js +0 -2
  55. package/dist/chunks/chunk-NDRDG55H.js +0 -2
  56. package/dist/chunks/chunk-NDRDG55H.js.map +0 -7
  57. package/dist/chunks/chunk-TJ3WKBV3.js +0 -2
  58. package/dist/chunks/chunk-TJ3WKBV3.js.map +0 -7
  59. package/dist/chunks/chunk-Y5FAI6SY.js +0 -2
  60. package/dist/chunks/chunk-Y5FAI6SY.js.map +0 -7
  61. package/dist/chunks/chunk-YYCDD5TV.js +0 -2
  62. package/dist/chunks/renderSvg-PLRJ3YVV.js +0 -2
  63. /package/dist/chunks/{AddTrackWorkflow-WS3KWZRK.js.map → AddTrackWorkflow-HNHYSVGK.js.map} +0 -0
  64. /package/dist/chunks/{GraphGenomeView-B3TZOQVR.js.map → GraphGenomeView-CB73XKE6.js.map} +0 -0
  65. /package/dist/chunks/{GraphTrackSettingsDialog-TNYRU3QA.js.map → GraphTrackSettingsDialog-G2WGJZPI.js.map} +0 -0
  66. /package/dist/chunks/{HighlightColorDialog-RHDRIHE2.js.map → HighlightColorDialog-T6324WYZ.js.map} +0 -0
  67. /package/dist/chunks/{LinearGraphDisplay-SBO36N3L.js.map → LinearGraphDisplay-FS63MQSY.js.map} +0 -0
  68. /package/dist/chunks/{chunk-3RRUYIRU.js.map → chunk-2W3RJJYD.js.map} +0 -0
  69. /package/dist/chunks/{chunk-GEU3LRIY.js.map → chunk-6Z266PWU.js.map} +0 -0
  70. /package/dist/chunks/{chunk-WBU773JJ.js.map → chunk-DWFNWVKA.js.map} +0 -0
  71. /package/dist/chunks/{chunk-UJARLH7K.js.map → chunk-FOL5SZ5J.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as P,b as N,c as _,f as W}from"./chunk-NXMRRZJI.js";import{d as G}from"./chunk-ELLLNUKS.js";import"./chunk-R3TRNF7N.js";import"./chunk-7WIBGKBU.js";import{b as F,j as L,m as T}from"./chunk-TENPGIPX.js";import{g as r}from"./chunk-6OPB7FOJ.js";import{A as E,B as I,E as u,a as S,e as w,f as c,n as R,r as x,s as v,t as M,z as B}from"./chunk-ECD5B2ZM.js";import{b as o,c as b,d as A}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/core/util/tss-react"],q=t=>s!=null&&t in Object(s)?s[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/core/util/tss-react' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var H=q("makeStyles"),Y=s&&s.__esModule?s.default:s;var K=H()(t=>({paper:{margin:t.spacing(),padding:t.spacing()},field:{marginTop:t.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),Q=["RgfaTabixAdapter","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],U=A(function({model:a}){let{classes:i}=K(),g=L(a),p=G(a),[n,j]=r("RgfaTabixAdapter"),[l,O]=r(),[f,z]=r(),[y,J]=r(),d=n==="GbzBaseSyntenyAdapter",[k,D]=r(""),[m,V]=r("Pangenome graph"),[C,h]=r();function X(){if(!(!l||!a.assembly))try{h(void 0);let e=m.trim();F({model:a,session:g,conf:W({choice:n,loc:l,indexLoc:f,readsLoc:d?y:void 0,assembly:a.assembly,sample:k,trackId:T({name:e}),name:e})})}catch(e){h(e)}}return b(B,{className:i.paper,children:[C?o(w,{error:C}):null,b(x,{children:[o(M,{children:"File type"}),o(I,{value:n,onChange:e=>{j(e.target.value),h(void 0)},children:Q.map(e=>o(v,{value:e,control:o(E,{}),label:P[e]},e))})]}),o(c,{location:l,name:N[n],rootModel:p,setLocation:O}),o(c,{location:f,name:_[n],rootModel:p,setLocation:z}),d?o(c,{location:y,name:"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)",rootModel:p,setLocation:J}):null,o(u,{className:i.field,value:k,onChange:e=>{D(e.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:d?"Optional. The graph's sample for this assembly, e.g. GRCh38 where the assembly is hg38; leave blank when they share a name or the graph has one reference sample":"Optional. The PanSN prefix the graph gives this assembly, e.g. GRCh38 for HPRC's GRCh38#0#chr1; leave blank when the graph's stable names are bare",placeholder:"GRCh38",fullWidth:!0}),o(u,{className:i.field,value:m,helperText:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:e=>{V(e.target.value)}}),o(S,{session:g,helperText:"Select assembly to add track to",selected:a.assembly,onChange:e=>{a.setAssembly(e)},fullWidth:!0}),o(R,{variant:"contained",className:i.submit,disabled:!l||!m.trim()||!a.assembly,onClick:X,children:"Submit"})]})}),ie=U;export{ie as default};
2
- //# sourceMappingURL=AddTrackWorkflow-WS3KWZRK.js.map
1
+ import{a as P,b as N,c as _,f as W}from"./chunk-NXMRRZJI.js";import{d as G}from"./chunk-NDRLCGPC.js";import"./chunk-R3TRNF7N.js";import"./chunk-7WIBGKBU.js";import{b as F,j as L,m as T}from"./chunk-TENPGIPX.js";import{g as r}from"./chunk-6OPB7FOJ.js";import{A as E,B as I,E as u,a as S,e as w,f as c,n as R,r as x,s as v,t as M,z as B}from"./chunk-ECD5B2ZM.js";import{b as o,c as b,d as A}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/core/util/tss-react"],q=t=>s!=null&&t in Object(s)?s[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/core/util/tss-react' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var H=q("makeStyles"),Y=s&&s.__esModule?s.default:s;var K=H()(t=>({paper:{margin:t.spacing(),padding:t.spacing()},field:{marginTop:t.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),Q=["RgfaTabixAdapter","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],U=A(function({model:a}){let{classes:i}=K(),g=L(a),p=G(a),[n,j]=r("RgfaTabixAdapter"),[l,O]=r(),[f,z]=r(),[y,J]=r(),d=n==="GbzBaseSyntenyAdapter",[k,D]=r(""),[m,V]=r("Pangenome graph"),[C,h]=r();function X(){if(!(!l||!a.assembly))try{h(void 0);let e=m.trim();F({model:a,session:g,conf:W({choice:n,loc:l,indexLoc:f,readsLoc:d?y:void 0,assembly:a.assembly,sample:k,trackId:T({name:e}),name:e})})}catch(e){h(e)}}return b(B,{className:i.paper,children:[C?o(w,{error:C}):null,b(x,{children:[o(M,{children:"File type"}),o(I,{value:n,onChange:e=>{j(e.target.value),h(void 0)},children:Q.map(e=>o(v,{value:e,control:o(E,{}),label:P[e]},e))})]}),o(c,{location:l,name:N[n],rootModel:p,setLocation:O}),o(c,{location:f,name:_[n],rootModel:p,setLocation:z}),d?o(c,{location:y,name:"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)",rootModel:p,setLocation:J}):null,o(u,{className:i.field,value:k,onChange:e=>{D(e.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:d?"Optional. The graph's sample for this assembly, e.g. GRCh38 where the assembly is hg38; leave blank when they share a name or the graph has one reference sample":"Optional. The PanSN prefix the graph gives this assembly, e.g. GRCh38 for HPRC's GRCh38#0#chr1; leave blank when the graph's stable names are bare",placeholder:"GRCh38",fullWidth:!0}),o(u,{className:i.field,value:m,helperText:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:e=>{V(e.target.value)}}),o(S,{session:g,helperText:"Select assembly to add track to",selected:a.assembly,onChange:e=>{a.setAssembly(e)},fullWidth:!0}),o(R,{variant:"contained",className:i.submit,disabled:!l||!m.trim()||!a.assembly,onClick:X,children:"Submit"})]})}),ie=U;export{ie as default};
2
+ //# sourceMappingURL=AddTrackWorkflow-HNHYSVGK.js.map
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-NDRDG55H.js";import"./chunk-WBU773JJ.js";import"./chunk-GEU3LRIY.js";import"./chunk-CRSUERDN.js";import{p as d}from"./chunk-3RRUYIRU.js";import"./chunk-TJ3WKBV3.js";import"./chunk-UJARLH7K.js";import"./chunk-Y5FAI6SY.js";import"./chunk-SKI3EKJL.js";import"./chunk-FT6QDOIQ.js";import"./chunk-UDAGOJR4.js";import"./chunk-YBLNN5FU.js";import"./chunk-4NN5DZNO.js";import"./chunk-ELLLNUKS.js";import"./chunk-TENPGIPX.js";import{g as x}from"./chunk-6OPB7FOJ.js";import{E as L,G as p,d as s,h as v,n,w as G,z as l}from"./chunk-ECD5B2ZM.js";import{a as y,b as a,c as r,d as i}from"./chunk-JMBDTNUR.js";var w=d()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}}),E=i(function({model:e}){let{classes:t}=w();return e.isLoading?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[a(v,{variant:"h6",message:e.statusMessage}),a(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),a(G,{variant:"indeterminate"})]}):e.error?a(l,{className:t.paper,children:a(s,{error:e.error,onReset:()=>{e.retryLoad()}})}):a(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[a(p,{variant:"h6",children:"Loading canceled"}),a(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),g=E;var F=`H VN:Z:1.0
1
+ import{a as C}from"./chunk-6KOFUWDF.js";import"./chunk-DWFNWVKA.js";import"./chunk-6Z266PWU.js";import"./chunk-ML64XFIL.js";import{o as d}from"./chunk-2W3RJJYD.js";import"./chunk-C3ZS6TUU.js";import"./chunk-FOL5SZ5J.js";import"./chunk-Y6IJNS73.js";import"./chunk-SKI3EKJL.js";import"./chunk-FT6QDOIQ.js";import"./chunk-UDAGOJR4.js";import"./chunk-YBLNN5FU.js";import"./chunk-4NN5DZNO.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as x}from"./chunk-6OPB7FOJ.js";import{E as L,G as p,d as s,h as v,n,w as G,z as l}from"./chunk-ECD5B2ZM.js";import{a as y,b as a,c as r,d as i}from"./chunk-JMBDTNUR.js";var w=d()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}}),E=i(function({model:e}){let{classes:t}=w();return e.isLoading?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[a(v,{variant:"h6",message:e.statusMessage}),a(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),a(G,{variant:"indeterminate"})]}):e.error?a(l,{className:t.paper,children:a(s,{error:e.error,onReset:()=>{e.retryLoad()}})}):a(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[a(p,{variant:"h6",children:"Loading canceled"}),a(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),g=E;var F=`H VN:Z:1.0
2
2
  S 1 ACGT
3
3
  S 2 GGCC
4
4
  S 3 TTAA
@@ -7,4 +7,4 @@ L 1 + 2 + 0M
7
7
  L 1 + 3 + 0M
8
8
  L 2 + 4 + 0M
9
9
  L 3 + 4 + 0M`,S=d()({column:{display:"flex",flexDirection:"column",gap:8},rowEnd:{display:"flex",gap:8,alignItems:"flex-end"},rowCenter:{display:"flex",gap:8,alignItems:"center"},flex1:{flex:1},paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto"},header:{marginBottom:12},footer:{marginTop:12,display:"flex",justifyContent:"flex-end"}}),T=i(function({model:e}){let{classes:t}=S(),[m,M]=x("");function u(){let o=m.trim();o&&e.loadGFAFromLocation({uri:o,locationType:"UriLocation"})}function N(o){let c=o.target.files?.[0];o.target.value="",c&&c.text().then(f=>e.loadGFA(f,c.name)).catch(f=>{e.setError(f)})}return r(l,{className:t.paper,children:[a("div",{className:t.header,children:a(p,{variant:"h6",children:"Load a GFA graph"})}),r("div",{className:t.column,children:[r("div",{className:t.rowCenter,children:[r(n,{variant:"outlined",component:"label",size:"small",children:["Choose file",a("input",{type:"file",accept:".gfa,.gfa1,.gfa2",hidden:!0,onChange:o=>{N(o)}})]}),a(p,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),r("div",{className:t.rowEnd,children:[a(L,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:m,onChange:o=>{M(o.target.value)},onKeyDown:o=>{o.key==="Enter"&&u()},className:t.flex1}),a(n,{variant:"contained",onClick:()=>{u()},disabled:!m.trim(),children:"Open"})]})]}),a("div",{className:t.footer,children:a(n,{size:"small",onClick:()=>{e.loadGFA(F,"Example graph")},children:"Load 4-node example"})}),e.error?a(s,{error:e.error}):null]})}),P=T;var A=i(function({model:e}){return e.hasGraph?a(C,{model:e}):e.canRetryLoad&&(e.error||e.loadCanceled)?a(g,{model:e}):r(y,{children:[e.isLoading?a(g,{model:e}):null,a("div",{hidden:e.isLoading,children:a(P,{model:e})})]})}),J=A;export{J as default};
10
- //# sourceMappingURL=GraphGenomeView-B3TZOQVR.js.map
10
+ //# sourceMappingURL=GraphGenomeView-CB73XKE6.js.map
@@ -1,6 +1,6 @@
1
- import{b as x}from"./chunk-WBU773JJ.js";import{h as H}from"./chunk-YYCDD5TV.js";import{p as u}from"./chunk-3RRUYIRU.js";import"./chunk-Y5FAI6SY.js";import"./chunk-UDAGOJR4.js";import"./chunk-4NN5DZNO.js";import{g as c}from"./chunk-6OPB7FOJ.js";import{C as v,E as f,G as h,m as g,r as b,v as S,y as C}from"./chunk-ECD5B2ZM.js";import{b as a,c as s,d as i}from"./chunk-JMBDTNUR.js";var L=u()({section:{marginBottom:24},formControl:{minWidth:200}}),w=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],T=i(function({model:e}){let{classes:t}=L();return e.adapterConfig.type==="RgfaTabixAdapter"?s("div",{className:t.section,children:[s(b,{className:t.formControl,children:[a(S,{children:"Graph context"}),a(v,{value:e.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:o=>{e.setSubgraphContext(o.target.value),e.cut()},children:w.map(({value:o,label:r})=>a(C,{value:o,children:r},o))})]}),a(h,{variant:"caption",color:"text.secondary",children:"How far the cut follows links out of the region, one hop by default. A detour that leaves the reference before the window and rejoins after it is indexed under its own sequence, so at none its middle is missing and the one bubble draws as two unrelated stubs. Each hop costs a query per off-reference segment already reached. No effect on an index in gfa-to-tabix's default anchored layout, which files each bubble whole under its reference interval."})]}):null}),G=T;var F=u()({section:{marginBottom:24}});function M(n){let e=n.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t!=="");return e.length===0?void 0:e}var N=i(function({model:e}){let[t,o]=c(e.chosenHaplotypes?.join(", ")??""),r=()=>{let p=M(t)??[];p.join(`
1
+ import{b as x}from"./chunk-DWFNWVKA.js";import{i as H}from"./chunk-UROQIUOU.js";import{o as u}from"./chunk-2W3RJJYD.js";import"./chunk-Y6IJNS73.js";import"./chunk-UDAGOJR4.js";import"./chunk-4NN5DZNO.js";import{g as c}from"./chunk-6OPB7FOJ.js";import{C as v,E as f,G as h,m as g,r as b,v as S,y as C}from"./chunk-ECD5B2ZM.js";import{b as a,c as s,d as i}from"./chunk-JMBDTNUR.js";var L=u()({section:{marginBottom:24},formControl:{minWidth:200}}),w=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],T=i(function({model:e}){let{classes:t}=L();return e.adapterConfig.type==="RgfaTabixAdapter"?s("div",{className:t.section,children:[s(b,{className:t.formControl,children:[a(S,{children:"Graph context"}),a(v,{value:e.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:o=>{e.setSubgraphContext(o.target.value),e.cut()},children:w.map(({value:o,label:r})=>a(C,{value:o,children:r},o))})]}),a(h,{variant:"caption",color:"text.secondary",children:"How far the cut follows links out of the region, one hop by default. A detour that leaves the reference before the window and rejoins after it is indexed under its own sequence, so at none its middle is missing and the one bubble draws as two unrelated stubs. Each hop costs a query per off-reference segment already reached. No effect on an index in gfa-to-tabix's default anchored layout, which files each bubble whole under its reference interval."})]}):null}),G=T;var F=u()({section:{marginBottom:24}});function M(n){let e=n.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t!=="");return e.length===0?void 0:e}var N=i(function({model:e}){let[t,o]=c(e.chosenHaplotypes?.join(", ")??""),r=()=>{let p=M(t)??[];p.join(`
2
2
  `)===(e.chosenHaplotypes??[]).join(`
3
3
  `)||(e.setSubgraphHaplotypes(p),e.cut())};return a(f,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:t,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:p=>{o(p.target.value)},onBlur:()=>{r()},onKeyDown:p=>{p.key==="Enter"&&r()}})}),P=i(function({model:e,names:t}){let[o,r]=c(e.chosenHaplotypes??[]),[p,d]=c(!1),y=l=>{l.join(`
4
4
  `)!==(e.chosenHaplotypes??[]).join(`
5
5
  `)&&(e.setSubgraphHaplotypes(l),e.cut())};return a(g,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:t,value:o,open:p,onOpen:()=>{d(!0)},onClose:()=>{d(!1),y(o)},onChange:(l,m)=>{r(m),p||y(m)},renderInput:l=>a(f,{...l,label:"Haplotypes",placeholder:o.length===0?"every haplotype":void 0,slotProps:{...l.slotProps,htmlInput:{...l.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),I=i(function({model:e}){let{classes:t}=F(),o=e.haplotypeNames,r=e.chosenHaplotypes?.join(",")??"";return H(e.adapterConfig)?s("div",{className:t.section,children:[o?a(P,{model:e,names:o},r):a(N,{model:e},r),s(h,{variant:"caption",color:"text.secondary",children:[o?`The haplotypes the cut is for, of the graph's ${o.length.toLocaleString()}, or a PanSN prefix typed and entered (HG002 for both of its haplotypes).`:"The haplotypes the cut is for, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both), separated by commas."," ","The cut keeps their walks and the nodes those walks visit, with the reference. Empty is every haplotype."]})]}):null}),k=I;function D({model:n,open:e,onClose:t}){return s(x,{model:n,open:e,onClose:t,children:[a(G,{model:n}),a(k,{model:n})]})}export{D as default};
6
- //# sourceMappingURL=GraphTrackSettingsDialog-TNYRU3QA.js.map
6
+ //# sourceMappingURL=GraphTrackSettingsDialog-G2WGJZPI.js.map
@@ -1,2 +1,2 @@
1
- import{n as v,o as C}from"./chunk-UJARLH7K.js";import"./chunk-Y5FAI6SY.js";import"./chunk-UDAGOJR4.js";import"./chunk-4NN5DZNO.js";import{E as g,G as t,c as u,n as y,p as c,q as d,y as s}from"./chunk-ECD5B2ZM.js";import{a as h,b as l,c as p,d as m}from"./chunk-JMBDTNUR.js";var b=m(function({model:o,onClose:r}){return p(u,{open:!0,onClose:r,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(t,{variant:"subtitle2",children:"Haplotype"}),l(t,{variant:"subtitle2",children:"Color by"}),l(t,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(f,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:e=>{o.setWalkColor(a,{field:e})},onScheme:e=>{o.setWalkColor(a,{scheme:e})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:r,children:"Done"})})]})});function f({label:i,field:o,scheme:r,onField:a,onScheme:n}){return p(h,{children:[l(t,{variant:"body2",children:i}),l(g,{select:!0,size:"small",value:o,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${i} by`}}},onChange:e=>{a(e.target.value)},children:v.map(e=>l(s,{value:e.value,children:e.label},e.value))}),l(g,{select:!0,size:"small",value:r,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${i}`}}},onChange:e=>{n(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||o==="reference").map(e=>l(s,{value:e.value,children:e.label},e.value))})]})}var P=b;export{P as default};
2
- //# sourceMappingURL=HighlightColorDialog-RHDRIHE2.js.map
1
+ import{n as v,o as C}from"./chunk-FOL5SZ5J.js";import"./chunk-Y6IJNS73.js";import"./chunk-UDAGOJR4.js";import"./chunk-4NN5DZNO.js";import{E as g,G as t,c as u,n as y,p as c,q as d,y as s}from"./chunk-ECD5B2ZM.js";import{a as h,b as l,c as p,d as m}from"./chunk-JMBDTNUR.js";var b=m(function({model:o,onClose:r}){return p(u,{open:!0,onClose:r,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(t,{variant:"subtitle2",children:"Haplotype"}),l(t,{variant:"subtitle2",children:"Color by"}),l(t,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(f,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:e=>{o.setWalkColor(a,{field:e})},onScheme:e=>{o.setWalkColor(a,{scheme:e})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:r,children:"Done"})})]})});function f({label:i,field:o,scheme:r,onField:a,onScheme:n}){return p(h,{children:[l(t,{variant:"body2",children:i}),l(g,{select:!0,size:"small",value:o,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${i} by`}}},onChange:e=>{a(e.target.value)},children:v.map(e=>l(s,{value:e.value,children:e.label},e.value))}),l(g,{select:!0,size:"small",value:r,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${i}`}}},onChange:e=>{n(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||o==="reference").map(e=>l(s,{value:e.value,children:e.label},e.value))})]})}var P=b;export{P as default};
2
+ //# sourceMappingURL=HighlightColorDialog-T6324WYZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-NDRDG55H.js";import"./chunk-WBU773JJ.js";import"./chunk-GEU3LRIY.js";import"./chunk-CRSUERDN.js";import"./chunk-3RRUYIRU.js";import"./chunk-TJ3WKBV3.js";import"./chunk-UJARLH7K.js";import"./chunk-Y5FAI6SY.js";import"./chunk-SKI3EKJL.js";import"./chunk-FT6QDOIQ.js";import"./chunk-UDAGOJR4.js";import"./chunk-YBLNN5FU.js";import"./chunk-4NN5DZNO.js";import"./chunk-ELLLNUKS.js";import"./chunk-TENPGIPX.js";import{g as T}from"./chunk-6OPB7FOJ.js";import"./chunk-ECD5B2ZM.js";import{b as e,c as l,d as y}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/display-kit/DisplayBackgroundProgress"];var v=s&&s.__esModule?s.default:s;var a=JBrowseExports["@jbrowse/display-kit/DisplayErrorBar"];var h=a&&a.__esModule?a.default:a;var i=JBrowseExports["@jbrowse/display-kit/DisplayLoadingOverlay"];var O=i&&i.__esModule?i.default:i;var n=JBrowseExports["@jbrowse/display-kit/TooLargeMessage"];var f=n&&n.__esModule?n.default:n;var t=JBrowseExports["@jbrowse/display-ui"],p=r=>t!=null&&r in Object(t)?t[r]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+r+"' from '@jbrowse/display-ui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:r});var w=p("BottomRightCornerContext");var c=p("TrackOverlayPortal");var L=p("useChromeOverlayOverride");var j=t&&t.__esModule?t.default:t;var D={TooLarge:f,ErrorBar:h,Loading:O,BackgroundProgress:v};function d({model:r,phase:o,drawn:u,testid:_,style:C,children:E,...B}){let{TooLarge:G,ErrorBar:S,Loading:m,BackgroundProgress:P}=L()??D,[b,A]=T(null),{displayId:x}=r.configuration;return o==="tooLarge"?e("div",{style:{display:"contents"},"data-display-id":x,"data-display-phase":o,children:e(c,{children:e("div",{style:{pointerEvents:"auto"},children:e(G,{model:r})})})}):l("div",{...B,style:{position:"relative",height:r.height,...C},"data-testid":_,"data-display-id":x,"data-display-drawn":u,"data-display-phase":o,children:[e(w,{value:b,children:E}),l(c,{children:[e(S,{model:r,visible:o==="error"}),e(m,{model:r,visible:o==="loading"||o==="canceled",immediate:!u}),e("div",{ref:A,style:{position:"absolute",bottom:2,right:2,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none"},children:e(P,{model:r,visible:o==="ready"})})]})]})}var I=y(function({model:o}){return e(d,{model:o,phase:o.displayPhase,drawn:o.painted&&o.geometryPainted,testid:"linear-graph-display","data-layout":o.chosenLayoutMode,"data-cut-tier":o.cutTier,"data-recuts":o.recuts,"data-node-count":o.hasGraph?o.nodeCount:void 0,"data-loading":o.isLoading?"":void 0,style:{width:o.paneWidth,height:o.height,overflow:"hidden"},children:e(g,{model:o,ownChrome:!1})})}),Q=I;export{Q as default};
2
- //# sourceMappingURL=LinearGraphDisplay-SBO36N3L.js.map
1
+ import{a as g}from"./chunk-6KOFUWDF.js";import"./chunk-DWFNWVKA.js";import"./chunk-6Z266PWU.js";import"./chunk-ML64XFIL.js";import"./chunk-2W3RJJYD.js";import"./chunk-C3ZS6TUU.js";import"./chunk-FOL5SZ5J.js";import"./chunk-Y6IJNS73.js";import"./chunk-SKI3EKJL.js";import"./chunk-FT6QDOIQ.js";import"./chunk-UDAGOJR4.js";import"./chunk-YBLNN5FU.js";import"./chunk-4NN5DZNO.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as T}from"./chunk-6OPB7FOJ.js";import"./chunk-ECD5B2ZM.js";import{b as e,c as l,d as y}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/display-kit/DisplayBackgroundProgress"];var v=s&&s.__esModule?s.default:s;var a=JBrowseExports["@jbrowse/display-kit/DisplayErrorBar"];var h=a&&a.__esModule?a.default:a;var i=JBrowseExports["@jbrowse/display-kit/DisplayLoadingOverlay"];var O=i&&i.__esModule?i.default:i;var n=JBrowseExports["@jbrowse/display-kit/TooLargeMessage"];var f=n&&n.__esModule?n.default:n;var t=JBrowseExports["@jbrowse/display-ui"],p=r=>t!=null&&r in Object(t)?t[r]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+r+"' from '@jbrowse/display-ui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:r});var w=p("BottomRightCornerContext");var c=p("TrackOverlayPortal");var L=p("useChromeOverlayOverride");var j=t&&t.__esModule?t.default:t;var D={TooLarge:f,ErrorBar:h,Loading:O,BackgroundProgress:v};function d({model:r,phase:o,drawn:u,testid:_,style:C,children:E,...B}){let{TooLarge:G,ErrorBar:S,Loading:m,BackgroundProgress:P}=L()??D,[b,A]=T(null),{displayId:x}=r.configuration;return o==="tooLarge"?e("div",{style:{display:"contents"},"data-display-id":x,"data-display-phase":o,children:e(c,{children:e("div",{style:{pointerEvents:"auto"},children:e(G,{model:r})})})}):l("div",{...B,style:{position:"relative",height:r.height,...C},"data-testid":_,"data-display-id":x,"data-display-drawn":u,"data-display-phase":o,children:[e(w,{value:b,children:E}),l(c,{children:[e(S,{model:r,visible:o==="error"}),e(m,{model:r,visible:o==="loading"||o==="canceled",immediate:!u}),e("div",{ref:A,style:{position:"absolute",bottom:2,right:2,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none"},children:e(P,{model:r,visible:o==="ready"})})]})]})}var I=y(function({model:o}){return e(d,{model:o,phase:o.displayPhase,drawn:o.painted&&o.geometryPainted,testid:"linear-graph-display","data-layout":o.chosenLayoutMode,"data-cut-tier":o.cutTier,"data-recuts":o.recuts,"data-node-count":o.hasGraph?o.nodeCount:void 0,"data-loading":o.isLoading?"":void 0,style:{width:o.paneWidth,height:o.height,overflow:"hidden"},children:e(g,{model:o,ownChrome:!1})})}),Q=I;export{Q as default};
2
+ //# sourceMappingURL=LinearGraphDisplay-FS63MQSY.js.map
@@ -1,2 +1,2 @@
1
- import{c as Lt}from"./chunk-UDAGOJR4.js";var lt="\0deletion:",Xt=.5;function On(t,e,n=new Set){let o=new Map(e.map(a=>[a.edgeIndex,`${lt}${a.edgeIndex}`])),s=[];return t.edges.forEach((a,i)=>{let c=o.get(i);if(!n.has(i))if(c===void 0)s.push(a);else{let{fromStrand:l,toStrand:d}=a;s.push({from:a.from,to:c,...l?{fromStrand:l}:{}},{from:c,to:a.to,...d?{toStrand:d}:{}})}}),{graph:{...t,nodes:[...t.nodes,...[...o.values()].map(a=>({id:a,name:a,length:0,depth:0}))],edges:s},routes:o,ids:new Set(o.values())}}function In(t,e,n,o,s){let a=new Map(t.nodes.map(i=>[i.id,i.length]));return e.map(i=>{let c=i.bypassed.reduce((h,r)=>h+(a.get(r)??0),0),l=Math.max(s.minimumNodeLength,o(c)*Xt),d=n.get(i.edgeIndex);return{id:d,name:d,length:Math.round(l*1e6/s.nodeLengthPerMegabase),depth:0}})}function _n(t,e){let n={...t},o={};for(let[s,a]of e){let i=n[a];delete n[a],i?.length&&(o[s]=i)}return{nodePositions:n,deletionRoutes:o}}var ht=12,yt=15,nt=yt*.7,Et=25*Math.PI/180,tn=.25,nn=150,en=[0,-.35,.35,-.7,.7],ft=[0,1];function St(t){return t?0:1}function at(t,e){let n=e.x-t.x,o=e.y-t.y,s=Math.hypot(n,o)||1;return{x:n/s,y:o/s}}function mt(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}}function Pt(t){let e=0,n=0;for(let o of t)e+=o.x,n+=o.y;return{x:e/t.length,y:n/t.length}}function Tt(t){let e=new Float64Array(t.length);for(let n=1;n<t.length;n++)e[n]=e[n-1]+Math.hypot(t[n].x-t[n-1].x,t[n].y-t[n-1].y);return e}function Rt(t){return Tt(t)[t.length-1]??0}function on(t){let e=1e-6,n=2*Math.PI-1e-6;for(let o=0;o<60;o++){let s=(e+n)/2;s/(2*Math.sin(s/2))<t?e=s:n=s}return(e+n)/2}function sn(t,e){if(t<1e-9)return Math.PI*e;let n=(t*t/4+e*e)/(2*e),o=2*Math.asin(Math.min(1,t/(2*n)));return n*(e>n?2*Math.PI-o:o)}function ut(t,e,n,o){let s=e-2*n,a=t<1e-9?2*Math.PI:on(s/t),i=s/a,c=Math.cos(a/2),l=t/2,d=o+n-i*c;return{at:h=>{if(h<=n)return{u:0,v:o+h};if(h>=e-n)return{u:t,v:o+e-h};let r=(h-n)/i-a/2;return{u:l+i*Math.sin(r),v:d+i*Math.cos(r)}},apex:o+n+i*(1-c),length:e}}function rn(t,e,n){if(!n)return t;let o=Math.cos(n),s=Math.sin(n);return{...t,at:a=>{let{u:i,v:c}=t.at(a),l=i-e/2;return{u:e/2+l*o-c*s,v:l*s+c*o}}}}function kt(t,e,n,o,s){return{at:a=>({u:t+n*a,v:e+o*a}),apex:e+Math.max(0,o)*s,length:s}}var pt=class{constructor(t,e,n=!1){this.pts=t,this.normals=e,this.straight=n,this.arc=Tt(t),this.total=this.arc[t.length-1]??0}segment(t){let{arc:e}=this,n=1,o=e.length-1;for(;n<o;){let s=n+o>>1;e[s]<t?n=s+1:o=s}return n}fraction(t,e){let n=this.arc[t]-this.arc[t-1];return n>0?(e-this.arc[t-1])/n:0}pointAt(t){let{pts:e}=this,n=e.length-1;if(n===0)return{...e[0]};if(t<=0){let s=at(e[0],e[1]);return{x:e[0].x+s.x*t,y:e[0].y+s.y*t}}if(t>=this.total){let s=at(e[n-1],e[n]),a=t-this.total;return{x:e[n].x+s.x*a,y:e[n].y+s.y*a}}let o=this.segment(t);return mt(e[o-1],e[o],this.fraction(o,t))}normalAt(t){let{normals:e}=this;if(e.length===1||t<=0)return e[0];if(t>=this.total)return e[e.length-1];let n=this.segment(t),{x:o,y:s}=mt(e[n-1],e[n],this.fraction(n,t)),a=Math.hypot(o,s)||1;return{x:o/a,y:s/a}}};function an(t,e){let n=Pt(t);return t.map((o,s)=>{let a=at(t[Math.max(0,s-1)],t[Math.min(t.length-1,s+1)]),i={x:-a.y,y:a.x},c=o.x-n.x,l=o.y-n.y,d=Math.hypot(c,l),h=i.x*c+i.y*l,r=e[s],f=d>1e-9&&Math.abs(h)>.3*d?Math.sign(h):Math.sign(i.x*r.x+i.y*r.y)||1;return{x:i.x*f,y:i.y*f}})}function gt(t,e,n,o){let s=Math.min(5,Math.max(o.length/24,.5)),a=[],i=[];for(let c=0;c<=o.length+1e-9;c+=s){let{u:l,v:d}=o.at(Math.min(c,o.length)),h=t.pointAt(e+l),r=t.normalAt(e+l),f=r.x*n,g=r.y*n;a.push({x:h.x+f*d,y:h.y+g*d}),i.push({x:f,y:g})}return{pts:a,refs:i}}function dt(t,e,n,o,s){let a=s,i=gt(t,e,n,o(a));if(t.straight)return i;for(let c=0;c<2;c++){let l=Rt(i.pts);if(!(l>0))break;a*=s/l,i=gt(t,e,n,o(a))}return i}function rt(t,e){return Array.from({length:e},(n,o)=>t+o*yt/2)}function Ot(t){if(t.length===0)return 1/0;let e=1/0,n=-1/0;for(let o of t)e=Math.min(e,o.point.x),n=Math.max(n,o.point.x);return n-e}function It(t,e){return t*73856093^e*19349663}var _t=class{constructor(t){this.c=t,this.grid=new Map;let{ids:e,first:n,count:o,per:s,seedX:a,seedY:i,backbone:c}=t,l=e.length;this.points=Array.from({length:l},()=>{}),this.params=Array.from({length:l},()=>{}),this.curves=Array.from({length:l},()=>{}),this.links=t.links.map((r,f)=>r.map(g=>g.filter(([E])=>E!==f))),this.route=e.map(r=>r.startsWith(lt));let d=1/0,h=-1/0;for(let r=0;r<l;r++){let f=n[r];!c[f]||Number.isNaN(a[f])||(d=Math.min(d,a[f]),h=Math.max(h,a[f]+s[r]*(o[r]-1)))}this.backbone=new pt([{x:d,y:0},{x:h,y:0}],[{x:0,y:1},{x:0,y:1}],!0),this.backboneCentroid={x:(d+h)/2,y:0};for(let r=0;r<l;r++){let f=n[r];if(!c[f]||Number.isNaN(a[f]))continue;let g=[],E=[];for(let P=0;P<o[r];P++){let F=a[f]+P*s[r];g.push({x:F,y:i[f]}),E.push(F-d)}this.points[r]=g,this.params[r]=E,this.curves[r]=this.backbone,this.occupy(g,this.backbone)}}static hasBackbone(t){for(let e=0;e<t.ids.length;e++){let n=t.first[e];if(t.backbone[n]&&!Number.isNaN(t.seedX[n]))return!0}return!1}run(){let t=[];for(let n=0;n<this.points.length;n++)this.points[n]||t.push(n);let e=this.componentsOf(t).map(n=>({members:n,anchors:this.anchorsOf(n)})).filter(n=>n.anchors.length).map(n=>({members:n.members,span:Ot(n.anchors),drawn:n.members.reduce((o,s)=>o+this.drawn(s),0)})).sort((n,o)=>n.span-o.span||n.drawn-o.drawn);for(let n of e)this.placePiece(n.members,this.backboneCentroid)}write(t,e){let{first:n}=this.c;this.points.forEach((o,s)=>{o?.forEach((a,i)=>{t[n[s]+i]=a.x,e[n[s]+i]=a.y})})}drawn(t){return this.c.per[t]*(this.c.count[t]-1)}endIndex(t,e){return e?this.c.count[t]-1:0}occupy(t,e){for(let n of t){let o=It(Math.floor(n.x/nt),Math.floor(n.y/nt)),s=this.grid.get(o),a={x:n.x,y:n.y,curve:e};s?s.push(a):this.grid.set(o,[a])}}violations(t,e,n,o){let s=0;for(let a of t){if(n.some(l=>Math.hypot(a.x-l.x,a.y-l.y)<2*yt))continue;let i=Math.floor(a.x/nt),c=Math.floor(a.y/nt);for(let l=i-1;l<=i+1;l++)for(let d=c-1;d<=c+1;d++)for(let h of this.grid.get(It(l,d))??[])if(h.curve!==e&&Math.hypot(a.x-h.x,a.y-h.y)<nt&&(s++,s>=o))return s}return s}choose(t,e,n){let o,s=1/0;for(let a of t){let i=a(),c=this.violations(i.pts,e,n,s);if(c===0)return i;c<s&&(s=c,o=i)}return o}anchorsOf(t){let e=new Set(t),n=[];for(let o of t)for(let s of ft)for(let[a,i]of this.links[o][s]){let c=this.points[a];if(e.has(a)||!c)continue;let l=this.endIndex(a,i);n.push({u:o,uSide:s,v:a,vSide:i,point:c[l],curve:this.curves[a],t:this.params[a][l]})}return n}componentsOf(t){let e=new Set(t),n=new Set,o=[];for(let s of t){if(n.has(s))continue;let a=[s];n.add(s);for(let i of a)for(let c of ft)for(let[l]of this.links[i][c])e.has(l)&&!n.has(l)&&(n.add(l),a.push(l));o.push(a)}return o}spinePath(t,e,n,o,s){let a=new Set(t),i=(f,g)=>f*2+g,c=(f,g)=>f===o&&St(g)===s,l=new Map([[i(e,n),-1]]),d=[[e,n]],h=[e,n];for(let[f,g]of d){if(h=[f,g],o!==void 0&&c(f,g))break;for(let[E,P]of this.links[f][St(g)])!a.has(E)||l.has(i(E,P))||(l.set(i(E,P),i(f,g)),d.push([E,P]))}if(o!==void 0&&!c(h[0],h[1]))return;let r=[];for(let f=i(h[0],h[1]);f!==-1;f=l.get(f))r.push({k:f>>1,enter:f&1});return r.reverse()}loosePath(t,e,n){let o=new Set(t),s=new Map([[e,-1]]),a=new Map([[e,0]]),i=[e];for(let l of i){if(l===n)break;for(let d of ft)for(let[h,r]of this.links[l][d])!o.has(h)||s.has(h)||(s.set(h,l),a.set(h,r),i.push(h))}let c=[];for(let l=n;l!==-1;l=s.get(l))c.push({k:l,enter:a.get(l)});return c.reverse()}spineLength(t){let{link:e}=this.c;return t.reduce((n,{k:o})=>n+this.drawn(o)+e,e)}layAlong(t,e,n,o){let{count:s,per:a,link:i}=this.c,c=n,l=[];for(let{k:d,enter:h}of t){let r=o??a[d],f=[],g=[];for(let E=0;E<s[d];E++)f.push(e.pointAt(c+E*r)),g.push(c+E*r);h===1&&(f.reverse(),g.reverse()),this.points[d]=f,this.params[d]=g,this.curves[d]=e,l.push(...f),c+=r*(s[d]-1)+i}return l}arcCandidates(t,e,n,o,s){let a=(s-o)/2-1e-6,i=s>2*o?en:[0],c=[];for(let l of rt(0,8))for(let d of i)for(let h=0;h<=16;h++){let r=a*h/16;h<16&&ut(o,s,r,l).apex<ht||c.push(()=>dt(t,e,n,f=>rn(ut(o,f,Math.min(r,(f-o)/2-1e-6),l),o,d),s))}return c}placePiece(t,e){let{count:n,link:o}=this.c,s=this.anchorsOf(t);if(s.length===0)return;let a=t.every(m=>this.route[m]),i=s.every(m=>m.curve===s[0].curve)?s[0].curve:void 0,c,l,d,h;if(i)s.sort((m,v)=>m.t-v.t),c=i,l=s[0].t,d=s[s.length-1].t,h=c===this.backbone&&a?-1:1;else{s.sort((V,X)=>V.point.x-X.point.x||V.point.y-X.point.y);let m=s[0].point,v=s[s.length-1].point,I=Math.hypot(v.x-m.x,v.y-m.y),k=I>1e-9?at(m,v):{x:1,y:0},R={x:-k.y,y:k.x},q=mt(m,v,.5);h=s.some(V=>V.curve===this.backbone)?(a?-1:1)*(Math.sign(R.y)||1):(q.x-e.x)*R.x+(q.y-e.y)*R.y>=0?1:-1,c=new pt([m,v],[R,R],!0),l=0,d=I}let r=s[0],f=s[s.length-1],g=d-l,E=s.length===1||r.u===f.u&&r.uSide===f.uSide&&g<1e-9,P=[r.point,f.point],F=m=>this.choose(m,i,P),O,y,A=o,H;if(E){O=this.spinePath(t,r.u,r.uSide);let m=this.spineLength(O),v=r.vSide?Math.max(0,n[r.v]-2):Math.min(1,n[r.v]-1),k=(r.t>=this.params[r.v][v]?1:-1)*Math.cos(Et),R=Math.sin(Et);y=F(rt(0,12).map(q=>()=>dt(c,l,h,V=>kt(0,q,k,R,V),m)))}else{O=this.spinePath(t,r.u,r.uSide,f.u,f.uSide)??this.loosePath(t,r.u,f.u);let m=this.spineLength(O);if(a){let v=Math.max(ht,Math.min(tn*g,nn));y=F(rt(v,12).map(k=>()=>gt(c,l,h,ut(g,sn(g,k),0,0))));let I=Rt(y.pts);H=Math.max(.001,(I-2*o)/(n[O[0].k]-1))}else if(m>g+1e-6)y=F(this.arcCandidates(c,l,h,g,m));else{let v=m-2*o;y=F(rt(ht,12).map(I=>()=>dt(c,l,h,k=>kt(g/2-k/2,I,1,0,k),v))),A=0}}let T=new pt(y.pts,an(y.pts,y.refs)),W=this.layAlong(O,T,A,H);this.occupy(W,T);let G=Pt(W),M=t.filter(m=>!this.points[m]),b=this.componentsOf(M).map(m=>({members:m,span:Ot(this.anchorsOf(m))})).sort((m,v)=>m.span-v.span);for(let m of b)this.placePiece(m.members,G)}};function Ut(t){let e=new Float64Array(t.n).fill(NaN),n=new Float64Array(t.n).fill(NaN);if(_t.hasBackbone(t)){let o=new _t(t);o.run(),o.write(e,n)}return{X:e,Y:n}}var cn=[{walks:2,iterations:15},{walks:4,iterations:30},{walks:8,iterations:60},{walks:12,iterations:90},{walks:16,iterations:120}],ln=20,hn=3,xt=.3,fn=2,un=200,pn=.1,dn=.5;function Bt(t,e){let n=e.at(-1);return(t==="+"||t==="-")&&(n==="+"||n==="-")&&t!==n}function mn(t){let e=Math.imul(t,2654435761)>>>0||1;return()=>(e^=e<<13,e>>>=0,e^=e>>>17,e^=e<<5,e>>>=0,e/4294967296)}function $(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function gn(t){let{nodes:e,edges:n}=t.graph,o=t.options,s=$(o.nodeLengthPerMegabase,1e3),a=$(o.minimumNodeLength,1),i=$(o.nodeSegmentLength,1),c=$(o.edgeLength,1),l=e.map(M=>M.id),d=new Int32Array(e.length),h=new Int32Array(e.length),r=new Float64Array(e.length),f=0;e.forEach((M,b)=>{let m=Math.max(s*M.length/1e6,a),v=Math.max(1,Math.ceil(m/i));d[b]=f,h[b]=v+1,r[b]=m/v,f+=v+1});let g=new Int32Array(f),E=new Int32Array(f),P=new Float64Array(f).fill(NaN),F=new Float64Array(f).fill(NaN),O=new Uint8Array(f),y=Array.from({length:f},()=>[]);e.forEach((M,b)=>{let m=typeof M.x=="number"&&typeof M.y=="number",v=Lt(M)?1:0;for(let I=0;I<h[b];I++){let k=d[b]+I;g[k]=b,E[k]=I,O[k]=v,m&&(P[k]=M.x+I*r[b],F[k]=M.y),I>0&&(y[k-1].push([k,r[b]]),y[k].push([k-1,r[b]]))}});let A=new Map(l.map((M,b)=>[M,b])),H=e.map(()=>[[],[]]);for(let M of n){let b=A.get(M.from),m=A.get(M.to);if(b===void 0||m===void 0||b===m&&h[b]<=2)continue;let v=Bt(M.fromStrand,M.from)?0:1,I=Bt(M.toStrand,M.to)?1:0,k=d[b]+(v?h[b]-1:0),R=d[m]+(I?h[m]-1:0);y[k].push([R,c]),y[R].push([k,c]),H[b][v].push([m,I]),H[m][I].push([b,v])}let T=new Int32Array(f+1);for(let M=0;M<f;M++)T[M+1]=T[M]+y[M].length;let W=new Int32Array(T[f]),G=new Float64Array(T[f]);for(let M=0;M<f;M++)y[M].forEach(([b,m],v)=>{W[T[M]+v]=b,G[T[M]+v]=m});return{ids:l,first:d,count:h,per:r,links:H,chainOf:g,indexOf:E,seedX:P,seedY:F,backbone:O,off:T,nb:W,wt:G,n:f,link:c}}function yn(t){let{n:e,off:n,nb:o}=t,s=new Int32Array(e).fill(-1),a=[];for(let i=0;i<e;i++){if(s[i]>=0)continue;let c=[i];s[i]=a.length;for(let l of c)for(let d=n[l];d<n[l+1];d++){let h=o[d];s[h]<0&&(s[h]=a.length,c.push(h))}a.push(c)}return{comp:s,members:a}}function Ct(t,e={}){let n=gn(t),{n:o,off:s,nb:a,wt:i,seedX:c,seedY:l,backbone:d,first:h,count:r,per:f,link:g}=n,E=t.options,P=cn[Math.max(0,Math.min(4,$(e.quality??E.quality,2)))],F=$(e.componentSeparation??E.componentSeparation,15),O=mn($(e.seed??E.seed,1)),y=new Float64Array(o),A=new Float64Array(o),H={};if(o===0)return{nodePositions:H};let{comp:T,members:W}=yn(n),G=1/0,M=0;for(let u=0;u<a.length;u++)G=Math.min(G,i[u]),M+=i[u];M/=2;let b=!1;for(let u=0;u<o;u++)if(!Number.isNaN(c[u])){b=!0;break}let m=b?Ut(n):void 0,v=Math.sqrt(o)*20;for(let u=0;u<o;u++)m&&!Number.isNaN(m.X[u])?(y[u]=m.X[u],A[u]=m.Y[u]):b&&!Number.isNaN(c[u])?(y[u]=c[u]+O()-.5,A[u]=l[u]+O()-.5):(y[u]=O()*v,A[u]=O()*v);let I=W.map(u=>Int32Array.from(u.filter(x=>d[x]&&!Number.isNaN(c[x])).sort((x,p)=>c[x]-c[p]))),k=I.map(u=>Float64Array.from(u,x=>c[x])),R=0;for(let u of k)u.length&&(R=Math.max(R,u[u.length-1]-u[0]));let q=Math.max(R,M/4,G*10),V=q*q,X=pn*G*G,{walks:$t,iterations:ct}=P,zt=Math.log(V/X)/Math.max(1,ct-1),ot=Math.log(G),wt=Math.log(q),bt=(u,x,p,w)=>{let S=w/(p*p);S>1&&(S=1);let L=y[u]-y[x],N=A[u]-A[x],U=Math.sqrt(L*L+N*N)||1e-9,_=S*(U-p)/(2*U),C=_*L,B=_*N;y[u]=y[u]-C,A[u]=A[u]-B,y[x]=y[x]+C,A[x]=A[x]+B},tt=0,Qt=(u,x)=>{let p=n.chainOf[u],w=n.indexOf[u],S=O()<.5?-1:1,L=x;for(let N=0;N<un;N++){let U=r[p],_=f[p],C=(S>0?U-1-w:w)*_;if(L<=C){let K=Math.round(L/_);return tt=x-L+K*_,h[p]+w+S*K}L-=C;let B=n.links[p][S>0?1:0];if(B.length===0)return tt=x-L,h[p]+(S>0?U-1:0);let[D,J]=B[Math.floor(O()*B.length)];if(L-=g,p=D,S=J===0?1:-1,w=J===0?0:r[D]-1,L<=0)return tt=x-L,h[p]+w}return-1},Nt=(u,x)=>{let p=I[T[u]];if(!d[u]||p.length<2||Number.isNaN(c[u]))return;let w=k[T[u]],S=c[u]+Math.exp(ot+O()*(wt-ot))*(O()<.5?-1:1),L=0,N=w.length;for(;L<N;){let D=L+N>>1;w[D]<S?L=D+1:N=D}let U=p[Math.min(L,p.length-1)],_=c[U]-c[u];if(U===u||_===0)return;let C=x/(_*_);C>1&&(C=1);let B=C*(y[U]-y[u]-_)/2;y[u]=y[u]+B,y[U]=y[U]-B},At=(u,x)=>{for(let p=s[u];p<s[u+1];p++){let w=a[p];w>u&&bt(u,w,i[p],x)}},Q=new Int32Array(o);for(let u=0;u<o;u++)Q[u]=u;let Zt=b?Math.floor(dn*ct):0;for(let u=Zt;u<ct;u++){let x=V*Math.exp(-zt*u);for(let p=o-1;p>0;p--){let w=Math.floor(O()*(p+1)),S=Q[p];Q[p]=Q[w],Q[w]=S}for(let p=0;p<o;p++){let w=Q[p];At(w,x);for(let S=0;S<$t;S++){let L=Math.exp(ot+O()*(wt-ot)),N=Qt(w,L);N>=0&&N!==w&&tt>0&&bt(w,N,tt,x)}Nt(w,x)}}let j=hn*g,Yt=(u,x)=>Math.floor(u/j)*73856093^Math.floor(x/j)*19349663;for(let u=0;u<ln;u++){let x=new Map;for(let p=0;p<o;p++){let w=Yt(y[p],A[p]),S=x.get(w);S?S.push(p):x.set(w,[p])}for(let p=0;p<o;p++){let w=Math.floor(y[p]/j),S=Math.floor(A[p]/j);for(let L=w-1;L<=w+1;L++)for(let N=S-1;N<=S+1;N++){let U=x.get(L*73856093^N*19349663);if(U)for(let _ of U){if(_<=p)continue;let C=!1;for(let Z=s[p];Z<s[p+1];Z++)if(a[Z]===_){C=!0;break}if(C)continue;let B=y[p]-y[_],D=A[p]-A[_],J=Math.sqrt(B*B+D*D);if(J>=j)continue;let K,st;if(J>1e-6){let Z=xt*(j-J)/(2*J);K=Z*B,st=Z*D}else K=xt*j*(O()-.5),st=xt*j*(O()-.5);y[p]=y[p]+K,A[p]=A[p]+st,y[_]=y[_]-K,A[_]=A[_]-st}}}for(let p=0;p<o;p++)At(p,1/0),Nt(p,X*4)}for(let u=0;u<r.length;u++){let x=h[u],p=r[u];if(!(p<3)){for(let w=0;w<fn;w++){let S=y.slice(x,x+p),L=A.slice(x,x+p);for(let N=1;N+1<p;N++)y[x+N]=.5*S[N]+.25*(S[N-1]+S[N+1]),A[x+N]=.5*L[N]+.25*(L[N-1]+L[N+1])}xn(y,A,x,p,f[u])}}Mn(T,W,y,A,b,F);for(let u=0;u<n.ids.length;u++){let x=[];for(let p=0;p<r[u];p++)x.push({x:y[h[u]+p],y:A[h[u]+p]});H[n.ids[u]]=x}return{nodePositions:H}}function xn(t,e,n,o,s){let a=new Float64Array(o);for(let r=1;r<o;r++)a[r]=a[r-1]+Math.hypot(t[n+r]-t[n+r-1],e[n+r]-e[n+r-1]);if(!a[o-1])return;let i=s*(o-1)-a[o-1];if(i>0){Ft(t,e,n,n+1,i/2),Ft(t,e,n+o-1,n+o-2,i/2);for(let r=1;r<o;r++)a[r]=a[r-1]+Math.hypot(t[n+r]-t[n+r-1],e[n+r]-e[n+r-1])}let c=a[o-1],l=t.slice(n,n+o),d=e.slice(n,n+o),h=1;for(let r=1;r+1<o;r++){let f=c*r/(o-1);for(;h<o-1&&a[h]<f;)h++;let g=a[h]-a[h-1],E=g>0?(f-a[h-1])/g:0;t[n+r]=l[h-1]+(l[h]-l[h-1])*E,e[n+r]=d[h-1]+(d[h]-d[h-1])*E}}function Ft(t,e,n,o,s){let a=t[n]-t[o],i=e[n]-e[o],c=Math.hypot(a,i);c>0&&(t[n]=t[n]+a/c*s,e[n]=e[n]+i/c*s)}function Mn(t,e,n,o,s,a){if(!s)for(let r of e)vn(n,o,r);if(e.length<2)return;let i=new Float64Array(e.length).fill(1/0),c=new Float64Array(e.length).fill(1/0),l=new Float64Array(e.length).fill(-1/0);for(let r=0;r<n.length;r++){let f=t[r];i[f]=Math.min(i[f],n[r]),c[f]=Math.min(c[f],o[r]),l[f]=Math.max(l[f],o[r])}let d=new Float64Array(e.length),h=0;for(let r=0;r<e.length;r++)d[r]=h-c[r],h+=l[r]-c[r]+a;for(let r=0;r<n.length;r++){let f=t[r];n[r]=n[r]-i[f],o[r]=o[r]+d[f]}}function vn(t,e,n){if(n.length<3)return;let o=0,s=0;for(let r of n)o+=t[r],s+=e[r];o/=n.length,s/=n.length;let a=0,i=0,c=0;for(let r of n){let f=t[r]-o,g=e[r]-s;a+=f*f,i+=g*g,c+=f*g}let l=-.5*Math.atan2(2*c,a-i),d=Math.cos(l),h=Math.sin(l);for(let r of n){let f=t[r]-o,g=e[r]-s;t[r]=o+d*f-h*g,e[r]=s+h*f+d*g}}var Mt;function Gt(){return Mt??=import("./bandage-layout-3AR6BCUD-HMONAS6B.js").then(t=>t.default()).catch(t=>{throw Mt=void 0,t}),Mt}var Ht=[{value:"fmmm",label:"Bandage (FMMM)",description:"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm."},{value:"stress",label:"Stress (experimental)",description:"Stress layout by stochastic gradient descent in plain JS: distances along the graph become distances on the page, so the reference reads straight and a repeat loop reads as a ring."}],wn=Ht.map(t=>t.value);var bn=async t=>{if(t.options.engine==="stress"){let s=performance.now();return{result:Ct(t),duration:performance.now()-s}}let e=await Gt(),n=performance.now();return{result:e.computeLayout(t.graph,t.options),duration:performance.now()-n}};var Dt=[{value:"auto",label:"Auto"},{value:"uniform",label:"Uniform"},{value:"random",label:"Random"},{value:"rainbow",label:"Rainbow"},{value:"depth",label:"Depth"},{value:"node-length",label:"Node length"},{value:"stable-rank",label:"Stable rank"},{value:"reference-position",label:"Reference position"},{value:"grey",label:"Grey"}],Nn=Dt.map(t=>t.value);function An(t,e){return t!=="auto"?t:e?.anchoredBy?"reference-position":"uniform"}var et=40,Wt=500,it=5;function Ln(t,e){return Math.max(t.nodeLengthPerMegabase*e/1e6,t.minimumNodeLength)}function qt(t,e=it){let o=t.nodes.reduce((a,i)=>a+i.length,0)/1e6,s=Math.max(t.nodes.length*et,Wt);return{nodeLengthPerMegabase:o>0?s/o:1e4,minimumNodeLength:Math.max(it,e),edgeLength:5,nodeSegmentLength:20}}var Y={power:1,effect:1};function jt(t){return t.power===1&&t.effect===1}function Jt(t,e){let n=t.nodes.length,o=t.nodes.reduce((i,c)=>i+c.length,0),s=n>0?o/n:0,a=n>0?Math.max(n*et,Wt)/n:et;return i=>{if(s<=0)return a;let c=(i/s)**e.power;return Math.max(a*((c-1)*e.effect+1),it)}}var Vt=1e3,Kt={law:Y,minNodeLength:0};function ne(t,e=Kt){let{law:n,minNodeLength:o}=e,s=qt(t,o);if(jt(n))return{nodes:t.nodes,opts:s};let a=Jt(t,n);return{nodes:t.nodes.map(i=>({...i,length:Math.round(a(i.length)*Vt)})),opts:{...s,nodeLengthPerMegabase:1e6/Vt,minimumNodeLength:it}}}function ee(t,e=Kt){if(jt(e.law)){let n=qt(t,e.minNodeLength);return o=>Ln(n,o)}return Jt(t,e.law)}var vt=[{value:"auto",label:"Proportional",description:"Bandage's own scale: a node draws proportional to its length, so a 1 bp allele is a speck.",law:Y,minNodeFactor:0},{value:"open",label:"Open bubbles",description:"Give every allele a drawn length, so a bubble reads as two arms rather than a knot.",law:Y,minNodeFactor:2.5},{value:"wide",label:"Wide bubbles",description:"As open, spread further. Best on a window of a dozen bubbles.",law:Y,minNodeFactor:10},{value:"compress",label:"Compress lengths",description:"Pull the longest and shortest nodes towards the graph\u2019s mean, so a cut spanning kb and bp fits one pane.",law:{power:.5,effect:.5},minNodeFactor:0}],En=vt.map(t=>t.value);function Sn(t){let e=vt.find(n=>n.value===t);return{law:e?.law??Y,minNodeLength:(e?.minNodeFactor??0)*et}}var z=JBrowseExports["tss-react/mui"],kn=t=>z!=null&&t in Object(z)?z[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from 'tss-react/mui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Ge=kn("makeStyles"),He=z&&z.__esModule?z.default:z;export{On as a,In as b,_n as c,Ht as d,wn as e,bn as f,Dt as g,Nn as h,An as i,Ln as j,ne as k,ee as l,vt as m,En as n,Sn as o,Ge as p};
2
- //# sourceMappingURL=chunk-3RRUYIRU.js.map
1
+ import{c as Lt}from"./chunk-UDAGOJR4.js";var lt="\0deletion:",Xt=.5;function On(t,e,n=new Set){let o=new Map(e.map(a=>[a.edgeIndex,`${lt}${a.edgeIndex}`])),s=[];return t.edges.forEach((a,i)=>{let c=o.get(i);if(!n.has(i))if(c===void 0)s.push(a);else{let{fromStrand:l,toStrand:d}=a;s.push({from:a.from,to:c,...l?{fromStrand:l}:{}},{from:c,to:a.to,...d?{toStrand:d}:{}})}}),{graph:{...t,nodes:[...t.nodes,...[...o.values()].map(a=>({id:a,name:a,length:0,depth:0}))],edges:s},routes:o,ids:new Set(o.values())}}function In(t,e,n,o,s){let a=new Map(t.nodes.map(i=>[i.id,i.length]));return e.map(i=>{let c=i.bypassed.reduce((h,r)=>h+(a.get(r)??0),0),l=Math.max(s.minimumNodeLength,o(c)*Xt),d=n.get(i.edgeIndex);return{id:d,name:d,length:Math.round(l*1e6/s.nodeLengthPerMegabase),depth:0}})}function _n(t,e){let n={...t},o={};for(let[s,a]of e){let i=n[a];delete n[a],i?.length&&(o[s]=i)}return{nodePositions:n,deletionRoutes:o}}var ht=12,yt=15,nt=yt*.7,Et=25*Math.PI/180,tn=.25,nn=150,en=[0,-.35,.35,-.7,.7],ft=[0,1];function St(t){return t?0:1}function at(t,e){let n=e.x-t.x,o=e.y-t.y,s=Math.hypot(n,o)||1;return{x:n/s,y:o/s}}function mt(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}}function Pt(t){let e=0,n=0;for(let o of t)e+=o.x,n+=o.y;return{x:e/t.length,y:n/t.length}}function Tt(t){let e=new Float64Array(t.length);for(let n=1;n<t.length;n++)e[n]=e[n-1]+Math.hypot(t[n].x-t[n-1].x,t[n].y-t[n-1].y);return e}function Rt(t){return Tt(t)[t.length-1]??0}function on(t){let e=1e-6,n=2*Math.PI-1e-6;for(let o=0;o<60;o++){let s=(e+n)/2;s/(2*Math.sin(s/2))<t?e=s:n=s}return(e+n)/2}function sn(t,e){if(t<1e-9)return Math.PI*e;let n=(t*t/4+e*e)/(2*e),o=2*Math.asin(Math.min(1,t/(2*n)));return n*(e>n?2*Math.PI-o:o)}function ut(t,e,n,o){let s=e-2*n,a=t<1e-9?2*Math.PI:on(s/t),i=s/a,c=Math.cos(a/2),l=t/2,d=o+n-i*c;return{at:h=>{if(h<=n)return{u:0,v:o+h};if(h>=e-n)return{u:t,v:o+e-h};let r=(h-n)/i-a/2;return{u:l+i*Math.sin(r),v:d+i*Math.cos(r)}},apex:o+n+i*(1-c),length:e}}function rn(t,e,n){if(!n)return t;let o=Math.cos(n),s=Math.sin(n);return{...t,at:a=>{let{u:i,v:c}=t.at(a),l=i-e/2;return{u:e/2+l*o-c*s,v:l*s+c*o}}}}function kt(t,e,n,o,s){return{at:a=>({u:t+n*a,v:e+o*a}),apex:e+Math.max(0,o)*s,length:s}}var pt=class{constructor(t,e,n=!1){this.pts=t,this.normals=e,this.straight=n,this.arc=Tt(t),this.total=this.arc[t.length-1]??0}segment(t){let{arc:e}=this,n=1,o=e.length-1;for(;n<o;){let s=n+o>>1;e[s]<t?n=s+1:o=s}return n}fraction(t,e){let n=this.arc[t]-this.arc[t-1];return n>0?(e-this.arc[t-1])/n:0}pointAt(t){let{pts:e}=this,n=e.length-1;if(n===0)return{...e[0]};if(t<=0){let s=at(e[0],e[1]);return{x:e[0].x+s.x*t,y:e[0].y+s.y*t}}if(t>=this.total){let s=at(e[n-1],e[n]),a=t-this.total;return{x:e[n].x+s.x*a,y:e[n].y+s.y*a}}let o=this.segment(t);return mt(e[o-1],e[o],this.fraction(o,t))}normalAt(t){let{normals:e}=this;if(e.length===1||t<=0)return e[0];if(t>=this.total)return e[e.length-1];let n=this.segment(t),{x:o,y:s}=mt(e[n-1],e[n],this.fraction(n,t)),a=Math.hypot(o,s)||1;return{x:o/a,y:s/a}}};function an(t,e){let n=Pt(t);return t.map((o,s)=>{let a=at(t[Math.max(0,s-1)],t[Math.min(t.length-1,s+1)]),i={x:-a.y,y:a.x},c=o.x-n.x,l=o.y-n.y,d=Math.hypot(c,l),h=i.x*c+i.y*l,r=e[s],f=d>1e-9&&Math.abs(h)>.3*d?Math.sign(h):Math.sign(i.x*r.x+i.y*r.y)||1;return{x:i.x*f,y:i.y*f}})}function gt(t,e,n,o){let s=Math.min(5,Math.max(o.length/24,.5)),a=[],i=[];for(let c=0;c<=o.length+1e-9;c+=s){let{u:l,v:d}=o.at(Math.min(c,o.length)),h=t.pointAt(e+l),r=t.normalAt(e+l),f=r.x*n,g=r.y*n;a.push({x:h.x+f*d,y:h.y+g*d}),i.push({x:f,y:g})}return{pts:a,refs:i}}function dt(t,e,n,o,s){let a=s,i=gt(t,e,n,o(a));if(t.straight)return i;for(let c=0;c<2;c++){let l=Rt(i.pts);if(!(l>0))break;a*=s/l,i=gt(t,e,n,o(a))}return i}function rt(t,e){return Array.from({length:e},(n,o)=>t+o*yt/2)}function Ot(t){if(t.length===0)return 1/0;let e=1/0,n=-1/0;for(let o of t)e=Math.min(e,o.point.x),n=Math.max(n,o.point.x);return n-e}function It(t,e){return t*73856093^e*19349663}var _t=class{constructor(t){this.c=t,this.grid=new Map;let{ids:e,first:n,count:o,per:s,seedX:a,seedY:i,backbone:c}=t,l=e.length;this.points=Array.from({length:l},()=>{}),this.params=Array.from({length:l},()=>{}),this.curves=Array.from({length:l},()=>{}),this.links=t.links.map((r,f)=>r.map(g=>g.filter(([E])=>E!==f))),this.route=e.map(r=>r.startsWith(lt));let d=1/0,h=-1/0;for(let r=0;r<l;r++){let f=n[r];!c[f]||Number.isNaN(a[f])||(d=Math.min(d,a[f]),h=Math.max(h,a[f]+s[r]*(o[r]-1)))}this.backbone=new pt([{x:d,y:0},{x:h,y:0}],[{x:0,y:1},{x:0,y:1}],!0),this.backboneCentroid={x:(d+h)/2,y:0};for(let r=0;r<l;r++){let f=n[r];if(!c[f]||Number.isNaN(a[f]))continue;let g=[],E=[];for(let P=0;P<o[r];P++){let F=a[f]+P*s[r];g.push({x:F,y:i[f]}),E.push(F-d)}this.points[r]=g,this.params[r]=E,this.curves[r]=this.backbone,this.occupy(g,this.backbone)}}static hasBackbone(t){for(let e=0;e<t.ids.length;e++){let n=t.first[e];if(t.backbone[n]&&!Number.isNaN(t.seedX[n]))return!0}return!1}run(){let t=[];for(let n=0;n<this.points.length;n++)this.points[n]||t.push(n);let e=this.componentsOf(t).map(n=>({members:n,anchors:this.anchorsOf(n)})).filter(n=>n.anchors.length).map(n=>({members:n.members,span:Ot(n.anchors),drawn:n.members.reduce((o,s)=>o+this.drawn(s),0)})).sort((n,o)=>n.span-o.span||n.drawn-o.drawn);for(let n of e)this.placePiece(n.members,this.backboneCentroid)}write(t,e){let{first:n}=this.c;this.points.forEach((o,s)=>{o?.forEach((a,i)=>{t[n[s]+i]=a.x,e[n[s]+i]=a.y})})}drawn(t){return this.c.per[t]*(this.c.count[t]-1)}endIndex(t,e){return e?this.c.count[t]-1:0}occupy(t,e){for(let n of t){let o=It(Math.floor(n.x/nt),Math.floor(n.y/nt)),s=this.grid.get(o),a={x:n.x,y:n.y,curve:e};s?s.push(a):this.grid.set(o,[a])}}violations(t,e,n,o){let s=0;for(let a of t){if(n.some(l=>Math.hypot(a.x-l.x,a.y-l.y)<2*yt))continue;let i=Math.floor(a.x/nt),c=Math.floor(a.y/nt);for(let l=i-1;l<=i+1;l++)for(let d=c-1;d<=c+1;d++)for(let h of this.grid.get(It(l,d))??[])if(h.curve!==e&&Math.hypot(a.x-h.x,a.y-h.y)<nt&&(s++,s>=o))return s}return s}choose(t,e,n){let o,s=1/0;for(let a of t){let i=a(),c=this.violations(i.pts,e,n,s);if(c===0)return i;c<s&&(s=c,o=i)}return o}anchorsOf(t){let e=new Set(t),n=[];for(let o of t)for(let s of ft)for(let[a,i]of this.links[o][s]){let c=this.points[a];if(e.has(a)||!c)continue;let l=this.endIndex(a,i);n.push({u:o,uSide:s,v:a,vSide:i,point:c[l],curve:this.curves[a],t:this.params[a][l]})}return n}componentsOf(t){let e=new Set(t),n=new Set,o=[];for(let s of t){if(n.has(s))continue;let a=[s];n.add(s);for(let i of a)for(let c of ft)for(let[l]of this.links[i][c])e.has(l)&&!n.has(l)&&(n.add(l),a.push(l));o.push(a)}return o}spinePath(t,e,n,o,s){let a=new Set(t),i=(f,g)=>f*2+g,c=(f,g)=>f===o&&St(g)===s,l=new Map([[i(e,n),-1]]),d=[[e,n]],h=[e,n];for(let[f,g]of d){if(h=[f,g],o!==void 0&&c(f,g))break;for(let[E,P]of this.links[f][St(g)])!a.has(E)||l.has(i(E,P))||(l.set(i(E,P),i(f,g)),d.push([E,P]))}if(o!==void 0&&!c(h[0],h[1]))return;let r=[];for(let f=i(h[0],h[1]);f!==-1;f=l.get(f))r.push({k:f>>1,enter:f&1});return r.reverse()}loosePath(t,e,n){let o=new Set(t),s=new Map([[e,-1]]),a=new Map([[e,0]]),i=[e];for(let l of i){if(l===n)break;for(let d of ft)for(let[h,r]of this.links[l][d])!o.has(h)||s.has(h)||(s.set(h,l),a.set(h,r),i.push(h))}let c=[];for(let l=n;l!==-1;l=s.get(l))c.push({k:l,enter:a.get(l)});return c.reverse()}spineLength(t){let{link:e}=this.c;return t.reduce((n,{k:o})=>n+this.drawn(o)+e,e)}layAlong(t,e,n,o){let{count:s,per:a,link:i}=this.c,c=n,l=[];for(let{k:d,enter:h}of t){let r=o??a[d],f=[],g=[];for(let E=0;E<s[d];E++)f.push(e.pointAt(c+E*r)),g.push(c+E*r);h===1&&(f.reverse(),g.reverse()),this.points[d]=f,this.params[d]=g,this.curves[d]=e,l.push(...f),c+=r*(s[d]-1)+i}return l}arcCandidates(t,e,n,o,s){let a=(s-o)/2-1e-6,i=s>2*o?en:[0],c=[];for(let l of rt(0,8))for(let d of i)for(let h=0;h<=16;h++){let r=a*h/16;h<16&&ut(o,s,r,l).apex<ht||c.push(()=>dt(t,e,n,f=>rn(ut(o,f,Math.min(r,(f-o)/2-1e-6),l),o,d),s))}return c}placePiece(t,e){let{count:n,link:o}=this.c,s=this.anchorsOf(t);if(s.length===0)return;let a=t.every(m=>this.route[m]),i=s.every(m=>m.curve===s[0].curve)?s[0].curve:void 0,c,l,d,h;if(i)s.sort((m,v)=>m.t-v.t),c=i,l=s[0].t,d=s[s.length-1].t,h=c===this.backbone&&a?-1:1;else{s.sort((V,X)=>V.point.x-X.point.x||V.point.y-X.point.y);let m=s[0].point,v=s[s.length-1].point,I=Math.hypot(v.x-m.x,v.y-m.y),k=I>1e-9?at(m,v):{x:1,y:0},R={x:-k.y,y:k.x},q=mt(m,v,.5);h=s.some(V=>V.curve===this.backbone)?(a?-1:1)*(Math.sign(R.y)||1):(q.x-e.x)*R.x+(q.y-e.y)*R.y>=0?1:-1,c=new pt([m,v],[R,R],!0),l=0,d=I}let r=s[0],f=s[s.length-1],g=d-l,E=s.length===1||r.u===f.u&&r.uSide===f.uSide&&g<1e-9,P=[r.point,f.point],F=m=>this.choose(m,i,P),O,y,A=o,H;if(E){O=this.spinePath(t,r.u,r.uSide);let m=this.spineLength(O),v=r.vSide?Math.max(0,n[r.v]-2):Math.min(1,n[r.v]-1),k=(r.t>=this.params[r.v][v]?1:-1)*Math.cos(Et),R=Math.sin(Et);y=F(rt(0,12).map(q=>()=>dt(c,l,h,V=>kt(0,q,k,R,V),m)))}else{O=this.spinePath(t,r.u,r.uSide,f.u,f.uSide)??this.loosePath(t,r.u,f.u);let m=this.spineLength(O);if(a){let v=Math.max(ht,Math.min(tn*g,nn));y=F(rt(v,12).map(k=>()=>gt(c,l,h,ut(g,sn(g,k),0,0))));let I=Rt(y.pts);H=Math.max(.001,(I-2*o)/(n[O[0].k]-1))}else if(m>g+1e-6)y=F(this.arcCandidates(c,l,h,g,m));else{let v=m-2*o;y=F(rt(ht,12).map(I=>()=>dt(c,l,h,k=>kt(g/2-k/2,I,1,0,k),v))),A=0}}let T=new pt(y.pts,an(y.pts,y.refs)),W=this.layAlong(O,T,A,H);this.occupy(W,T);let G=Pt(W),M=t.filter(m=>!this.points[m]),b=this.componentsOf(M).map(m=>({members:m,span:Ot(this.anchorsOf(m))})).sort((m,v)=>m.span-v.span);for(let m of b)this.placePiece(m.members,G)}};function Ut(t){let e=new Float64Array(t.n).fill(NaN),n=new Float64Array(t.n).fill(NaN);if(_t.hasBackbone(t)){let o=new _t(t);o.run(),o.write(e,n)}return{X:e,Y:n}}var cn=[{walks:2,iterations:15},{walks:4,iterations:30},{walks:8,iterations:60},{walks:12,iterations:90},{walks:16,iterations:120}],ln=20,hn=3,xt=.3,fn=2,un=200,pn=.1,dn=.5;function Bt(t,e){let n=e.at(-1);return(t==="+"||t==="-")&&(n==="+"||n==="-")&&t!==n}function mn(t){let e=Math.imul(t,2654435761)>>>0||1;return()=>(e^=e<<13,e>>>=0,e^=e>>>17,e^=e<<5,e>>>=0,e/4294967296)}function $(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function gn(t){let{nodes:e,edges:n}=t.graph,o=t.options,s=$(o.nodeLengthPerMegabase,1e3),a=$(o.minimumNodeLength,1),i=$(o.nodeSegmentLength,1),c=$(o.edgeLength,1),l=e.map(M=>M.id),d=new Int32Array(e.length),h=new Int32Array(e.length),r=new Float64Array(e.length),f=0;e.forEach((M,b)=>{let m=Math.max(s*M.length/1e6,a),v=Math.max(1,Math.ceil(m/i));d[b]=f,h[b]=v+1,r[b]=m/v,f+=v+1});let g=new Int32Array(f),E=new Int32Array(f),P=new Float64Array(f).fill(NaN),F=new Float64Array(f).fill(NaN),O=new Uint8Array(f),y=Array.from({length:f},()=>[]);e.forEach((M,b)=>{let m=typeof M.x=="number"&&typeof M.y=="number",v=Lt(M)?1:0;for(let I=0;I<h[b];I++){let k=d[b]+I;g[k]=b,E[k]=I,O[k]=v,m&&(P[k]=M.x+I*r[b],F[k]=M.y),I>0&&(y[k-1].push([k,r[b]]),y[k].push([k-1,r[b]]))}});let A=new Map(l.map((M,b)=>[M,b])),H=e.map(()=>[[],[]]);for(let M of n){let b=A.get(M.from),m=A.get(M.to);if(b===void 0||m===void 0||b===m&&h[b]<=2)continue;let v=Bt(M.fromStrand,M.from)?0:1,I=Bt(M.toStrand,M.to)?1:0,k=d[b]+(v?h[b]-1:0),R=d[m]+(I?h[m]-1:0);y[k].push([R,c]),y[R].push([k,c]),H[b][v].push([m,I]),H[m][I].push([b,v])}let T=new Int32Array(f+1);for(let M=0;M<f;M++)T[M+1]=T[M]+y[M].length;let W=new Int32Array(T[f]),G=new Float64Array(T[f]);for(let M=0;M<f;M++)y[M].forEach(([b,m],v)=>{W[T[M]+v]=b,G[T[M]+v]=m});return{ids:l,first:d,count:h,per:r,links:H,chainOf:g,indexOf:E,seedX:P,seedY:F,backbone:O,off:T,nb:W,wt:G,n:f,link:c}}function yn(t){let{n:e,off:n,nb:o}=t,s=new Int32Array(e).fill(-1),a=[];for(let i=0;i<e;i++){if(s[i]>=0)continue;let c=[i];s[i]=a.length;for(let l of c)for(let d=n[l];d<n[l+1];d++){let h=o[d];s[h]<0&&(s[h]=a.length,c.push(h))}a.push(c)}return{comp:s,members:a}}function Ct(t,e={}){let n=gn(t),{n:o,off:s,nb:a,wt:i,seedX:c,seedY:l,backbone:d,first:h,count:r,per:f,link:g}=n,E=t.options,P=cn[Math.max(0,Math.min(4,$(e.quality??E.quality,2)))],F=$(e.componentSeparation??E.componentSeparation,15),O=mn($(e.seed??E.seed,1)),y=new Float64Array(o),A=new Float64Array(o),H={};if(o===0)return{nodePositions:H};let{comp:T,members:W}=yn(n),G=1/0,M=0;for(let u=0;u<a.length;u++)G=Math.min(G,i[u]),M+=i[u];M/=2;let b=!1;for(let u=0;u<o;u++)if(!Number.isNaN(c[u])){b=!0;break}let m=b?Ut(n):void 0,v=Math.sqrt(o)*20;for(let u=0;u<o;u++)m&&!Number.isNaN(m.X[u])?(y[u]=m.X[u],A[u]=m.Y[u]):b&&!Number.isNaN(c[u])?(y[u]=c[u]+O()-.5,A[u]=l[u]+O()-.5):(y[u]=O()*v,A[u]=O()*v);let I=W.map(u=>Int32Array.from(u.filter(x=>d[x]&&!Number.isNaN(c[x])).sort((x,p)=>c[x]-c[p]))),k=I.map(u=>Float64Array.from(u,x=>c[x])),R=0;for(let u of k)u.length&&(R=Math.max(R,u[u.length-1]-u[0]));let q=Math.max(R,M/4,G*10),V=q*q,X=pn*G*G,{walks:$t,iterations:ct}=P,zt=Math.log(V/X)/Math.max(1,ct-1),ot=Math.log(G),wt=Math.log(q),bt=(u,x,p,w)=>{let S=w/(p*p);S>1&&(S=1);let L=y[u]-y[x],N=A[u]-A[x],U=Math.sqrt(L*L+N*N)||1e-9,_=S*(U-p)/(2*U),C=_*L,B=_*N;y[u]=y[u]-C,A[u]=A[u]-B,y[x]=y[x]+C,A[x]=A[x]+B},tt=0,Qt=(u,x)=>{let p=n.chainOf[u],w=n.indexOf[u],S=O()<.5?-1:1,L=x;for(let N=0;N<un;N++){let U=r[p],_=f[p],C=(S>0?U-1-w:w)*_;if(L<=C){let K=Math.round(L/_);return tt=x-L+K*_,h[p]+w+S*K}L-=C;let B=n.links[p][S>0?1:0];if(B.length===0)return tt=x-L,h[p]+(S>0?U-1:0);let[D,J]=B[Math.floor(O()*B.length)];if(L-=g,p=D,S=J===0?1:-1,w=J===0?0:r[D]-1,L<=0)return tt=x-L,h[p]+w}return-1},Nt=(u,x)=>{let p=I[T[u]];if(!d[u]||p.length<2||Number.isNaN(c[u]))return;let w=k[T[u]],S=c[u]+Math.exp(ot+O()*(wt-ot))*(O()<.5?-1:1),L=0,N=w.length;for(;L<N;){let D=L+N>>1;w[D]<S?L=D+1:N=D}let U=p[Math.min(L,p.length-1)],_=c[U]-c[u];if(U===u||_===0)return;let C=x/(_*_);C>1&&(C=1);let B=C*(y[U]-y[u]-_)/2;y[u]=y[u]+B,y[U]=y[U]-B},At=(u,x)=>{for(let p=s[u];p<s[u+1];p++){let w=a[p];w>u&&bt(u,w,i[p],x)}},Q=new Int32Array(o);for(let u=0;u<o;u++)Q[u]=u;let Zt=b?Math.floor(dn*ct):0;for(let u=Zt;u<ct;u++){let x=V*Math.exp(-zt*u);for(let p=o-1;p>0;p--){let w=Math.floor(O()*(p+1)),S=Q[p];Q[p]=Q[w],Q[w]=S}for(let p=0;p<o;p++){let w=Q[p];At(w,x);for(let S=0;S<$t;S++){let L=Math.exp(ot+O()*(wt-ot)),N=Qt(w,L);N>=0&&N!==w&&tt>0&&bt(w,N,tt,x)}Nt(w,x)}}let j=hn*g,Yt=(u,x)=>Math.floor(u/j)*73856093^Math.floor(x/j)*19349663;for(let u=0;u<ln;u++){let x=new Map;for(let p=0;p<o;p++){let w=Yt(y[p],A[p]),S=x.get(w);S?S.push(p):x.set(w,[p])}for(let p=0;p<o;p++){let w=Math.floor(y[p]/j),S=Math.floor(A[p]/j);for(let L=w-1;L<=w+1;L++)for(let N=S-1;N<=S+1;N++){let U=x.get(L*73856093^N*19349663);if(U)for(let _ of U){if(_<=p)continue;let C=!1;for(let Z=s[p];Z<s[p+1];Z++)if(a[Z]===_){C=!0;break}if(C)continue;let B=y[p]-y[_],D=A[p]-A[_],J=Math.sqrt(B*B+D*D);if(J>=j)continue;let K,st;if(J>1e-6){let Z=xt*(j-J)/(2*J);K=Z*B,st=Z*D}else K=xt*j*(O()-.5),st=xt*j*(O()-.5);y[p]=y[p]+K,A[p]=A[p]+st,y[_]=y[_]-K,A[_]=A[_]-st}}}for(let p=0;p<o;p++)At(p,1/0),Nt(p,X*4)}for(let u=0;u<r.length;u++){let x=h[u],p=r[u];if(!(p<3)){for(let w=0;w<fn;w++){let S=y.slice(x,x+p),L=A.slice(x,x+p);for(let N=1;N+1<p;N++)y[x+N]=.5*S[N]+.25*(S[N-1]+S[N+1]),A[x+N]=.5*L[N]+.25*(L[N-1]+L[N+1])}xn(y,A,x,p,f[u])}}Mn(T,W,y,A,b,F);for(let u=0;u<n.ids.length;u++){let x=[];for(let p=0;p<r[u];p++)x.push({x:y[h[u]+p],y:A[h[u]+p]});H[n.ids[u]]=x}return{nodePositions:H}}function xn(t,e,n,o,s){let a=new Float64Array(o);for(let r=1;r<o;r++)a[r]=a[r-1]+Math.hypot(t[n+r]-t[n+r-1],e[n+r]-e[n+r-1]);if(!a[o-1])return;let i=s*(o-1)-a[o-1];if(i>0){Ft(t,e,n,n+1,i/2),Ft(t,e,n+o-1,n+o-2,i/2);for(let r=1;r<o;r++)a[r]=a[r-1]+Math.hypot(t[n+r]-t[n+r-1],e[n+r]-e[n+r-1])}let c=a[o-1],l=t.slice(n,n+o),d=e.slice(n,n+o),h=1;for(let r=1;r+1<o;r++){let f=c*r/(o-1);for(;h<o-1&&a[h]<f;)h++;let g=a[h]-a[h-1],E=g>0?(f-a[h-1])/g:0;t[n+r]=l[h-1]+(l[h]-l[h-1])*E,e[n+r]=d[h-1]+(d[h]-d[h-1])*E}}function Ft(t,e,n,o,s){let a=t[n]-t[o],i=e[n]-e[o],c=Math.hypot(a,i);c>0&&(t[n]=t[n]+a/c*s,e[n]=e[n]+i/c*s)}function Mn(t,e,n,o,s,a){if(!s)for(let r of e)vn(n,o,r);if(e.length<2)return;let i=new Float64Array(e.length).fill(1/0),c=new Float64Array(e.length).fill(1/0),l=new Float64Array(e.length).fill(-1/0);for(let r=0;r<n.length;r++){let f=t[r];i[f]=Math.min(i[f],n[r]),c[f]=Math.min(c[f],o[r]),l[f]=Math.max(l[f],o[r])}let d=new Float64Array(e.length),h=0;for(let r=0;r<e.length;r++)d[r]=h-c[r],h+=l[r]-c[r]+a;for(let r=0;r<n.length;r++){let f=t[r];n[r]=n[r]-i[f],o[r]=o[r]+d[f]}}function vn(t,e,n){if(n.length<3)return;let o=0,s=0;for(let r of n)o+=t[r],s+=e[r];o/=n.length,s/=n.length;let a=0,i=0,c=0;for(let r of n){let f=t[r]-o,g=e[r]-s;a+=f*f,i+=g*g,c+=f*g}let l=-.5*Math.atan2(2*c,a-i),d=Math.cos(l),h=Math.sin(l);for(let r of n){let f=t[r]-o,g=e[r]-s;t[r]=o+d*f-h*g,e[r]=s+h*f+d*g}}var Mt;function Gt(){return Mt??=import("./bandage-layout-3AR6BCUD-HMONAS6B.js").then(t=>t.default()).catch(t=>{throw Mt=void 0,t}),Mt}var Ht=[{value:"fmmm",label:"Bandage (FMMM)",description:"Bandage's force-directed layout: OGDF's fast multipole multilevel method, compiled to wasm."},{value:"stress",label:"Stress (experimental)",description:"Stress layout by stochastic gradient descent in plain JS: distances along the graph become distances on the page, so the reference reads straight and a repeat loop reads as a ring."}],wn=Ht.map(t=>t.value);var bn=async t=>{if(t.options.engine==="stress"){let s=performance.now();return{result:Ct(t),duration:performance.now()-s}}let e=await Gt(),n=performance.now();return{result:e.computeLayout(t.graph,t.options),duration:performance.now()-n}};var Dt=[{value:"auto",label:"Auto"},{value:"uniform",label:"Uniform"},{value:"random",label:"Random"},{value:"rainbow",label:"Rainbow"},{value:"depth",label:"Depth"},{value:"node-length",label:"Node length"},{value:"stable-rank",label:"Stable rank"},{value:"reference-position",label:"Reference position"},{value:"grey",label:"Grey"}],Nn=Dt.map(t=>t.value);function An(t,e){return t!=="auto"?t:e?.anchoredBy?"reference-position":"uniform"}var et=40,Wt=500,it=5;function Ln(t,e){return Math.max(t.nodeLengthPerMegabase*e/1e6,t.minimumNodeLength)}function qt(t,e=it){let o=t.nodes.reduce((a,i)=>a+i.length,0)/1e6,s=Math.max(t.nodes.length*et,Wt);return{nodeLengthPerMegabase:o>0?s/o:1e4,minimumNodeLength:Math.max(it,e),edgeLength:5,nodeSegmentLength:20}}var Y={power:1,effect:1};function jt(t){return t.power===1&&t.effect===1}function Jt(t,e){let n=t.nodes.length,o=t.nodes.reduce((i,c)=>i+c.length,0),s=n>0?o/n:0,a=n>0?Math.max(n*et,Wt)/n:et;return i=>{if(s<=0)return a;let c=(i/s)**e.power;return Math.max(a*((c-1)*e.effect+1),it)}}var Vt=1e3,Kt={law:Y,minNodeLength:0};function ne(t,e=Kt){let{law:n,minNodeLength:o}=e,s=qt(t,o);if(jt(n))return{nodes:t.nodes,opts:s};let a=Jt(t,n);return{nodes:t.nodes.map(i=>({...i,length:Math.round(a(i.length)*Vt)})),opts:{...s,nodeLengthPerMegabase:1e6/Vt,minimumNodeLength:it}}}function ee(t,e=Kt){if(jt(e.law)){let n=qt(t,e.minNodeLength);return o=>Ln(n,o)}return Jt(t,e.law)}var vt=[{value:"auto",label:"Proportional",description:"Bandage's own scale: a node draws proportional to its length, so a 1 bp allele is a speck.",law:Y,minNodeFactor:0},{value:"open",label:"Open bubbles",description:"Give every allele a drawn length, so a bubble reads as two arms rather than a knot.",law:Y,minNodeFactor:2.5},{value:"wide",label:"Wide bubbles",description:"As open, spread further. Best on a window of a dozen bubbles.",law:Y,minNodeFactor:10},{value:"compress",label:"Compress lengths",description:"Pull the longest and shortest nodes towards the graph\u2019s mean, so a cut spanning kb and bp fits one pane.",law:{power:.5,effect:.5},minNodeFactor:0}],En=vt.map(t=>t.value);function Sn(t){let e=vt.find(n=>n.value===t);return{law:e?.law??Y,minNodeLength:(e?.minNodeFactor??0)*et}}var z=JBrowseExports["tss-react/mui"],kn=t=>z!=null&&t in Object(z)?z[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from 'tss-react/mui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Ge=kn("makeStyles"),He=z&&z.__esModule?z.default:z;export{On as a,In as b,_n as c,Ht as d,wn as e,bn as f,Dt as g,An as h,Ln as i,ne as j,ee as k,vt as l,En as m,Sn as n,Ge as o};
2
+ //# sourceMappingURL=chunk-2W3RJJYD.js.map
@@ -0,0 +1,2 @@
1
+ import{a as W,b as $e}from"./chunk-DWFNWVKA.js";import{a as B,b as Oe,c as S,d as Ae,f as Fe,g as Z,h as Xe,i as Ze,k as je,l as Ke,n as Ue,o as Je,p as qe,q as Qe,r as et}from"./chunk-6Z266PWU.js";import{Q as We,S as ze,a as w,g as Me,h as Re,i as Ce,ia as _e,j as Pe,na as $,oa as ee,q as Le,qa as De,ra as Ve,sa as Ye,u as Te}from"./chunk-ML64XFIL.js";import{g as Ge,o as H}from"./chunk-2W3RJJYD.js";import{E as Ee,F as Ie,R as V,S as Be,W as Ne,Y as q,_ as Q,a as ie,aa as Y,b as le,e as X,k as ke,q as Se,x as xe}from"./chunk-C3ZS6TUU.js";import{g as we,i as ye,t as He}from"./chunk-FOL5SZ5J.js";import{D as be}from"./chunk-Y6IJNS73.js";import{e as C}from"./chunk-NDRLCGPC.js";import{j as se}from"./chunk-TENPGIPX.js";import{c as G,d as F,e as ve,f as E,g as M}from"./chunk-6OPB7FOJ.js";import{C as ge,F as A,G as z,b as ce,d as J,i as pe,j as _,n as D,o as de,r as ue,u as O,v as fe,x as he,y as me}from"./chunk-ECD5B2ZM.js";import{a as x,b as t,c,d as p}from"./chunk-JMBDTNUR.js";function tt(n){return`${n.refName}:${(n.start+1).toLocaleString()}-${n.end.toLocaleString()}`}function te(n,e,o=r=>r){return e?{deletion:{bp:`${e.bp.toLocaleString()} bp`,where:tt(e)}}:{ends:`${o(n.from)}${n.fromStrand??""} \u2192 ${o(n.to)}${n.toStrand??""}`}}var I=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],Ht=n=>I!=null&&n in Object(I)?I[n]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+n+"' from '@jbrowse/render-core/useRenderingBackend' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:n});var nt=Ht("useRenderingBackend"),Nn=I&&I.__esModule?I.default:I;var ot=w(t("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 T={width:18,height:8,borderRadius:2,flex:"none"},Wt={marginBottom:2},zt={...T,width:48};function N({walk:n,label:e,reference:o,hint:r,at:a}){let s=Ne(n,o);return c("div",{style:Wt,title:[s.hover,r].filter(Boolean).join(" \xB7 ")||void 0,children:[c("div",{style:S,children:[t("div",{style:{...s.shades?zt:T,background:He(n.encoding)}}),c("span",{children:[t("strong",{children:e}),s.delta,s.outside,s.reversed]})]}),a?t("div",{"data-testid":"graph-walk-at",children:a}):s.scale?t("div",{children:s.scale}):null]})}var Bt=1.1,Nt=100,_t=40,Dt=800,Ot=10,rt=2;function ne(n){let e=n.deltaY*(n.deltaMode===1?_t:n.deltaMode===2?Dt:1),o=(n.ctrlKey?Ot:1)*e/Nt;return Bt**-Math.max(-rt,Math.min(rt,o))}function j(n,e){G(()=>{if(!n)return;let o=n;function r(a){if(e.hostPlacesX)return;e.host&&a.stopPropagation(),a.preventDefault();let s=o.getBoundingClientRect();e.zoom(ne(a),a.clientX-s.left,a.clientY-s.top)}return o.addEventListener("wheel",r,{passive:!1}),()=>{o.removeEventListener("wheel",r)}},[n,e])}var At=3;function at(n){let e=E({x:0,y:0}),o=E({x:0,y:0}),r=E(!1),a=E({frame:0,pan:null,hover:null});G(()=>()=>{cancelAnimationFrame(a.current.frame)},[]);let[s,d]=M(void 0),[h,l]=M(void 0);function m(i,g){return{x:(i-n.translateX)/n.scaleX,y:(g-n.translateY)/n.scaleY}}function u(i){let g=i.currentTarget.getBoundingClientRect();return m(i.clientX-g.left,i.clientY-g.top)}function f(i,g){let{nodePositions:b}=n,v=i*n.scaleX+n.translateX,k=g*n.scaleY+n.translateY;if(n.layoutResult?.tubeMap)return n.tubeMapNodeAt(v,k);let ae=n.referenceStripNodeAt(v,k);return ae||(b?q(b,i,g,n.axisScale,n.positionsVersion,n.nodeInk):null)}function R(i){i.button===0&&(i.preventDefault(),n.host&&!n.hostPlacesX&&i.stopPropagation())}function y(i){if(i.button===0){if(r.current=!1,o.current={x:i.clientX,y:i.clientY},n.hostPlacesX)return;i.currentTarget.setPointerCapture(i.pointerId);let{x:g,y:b}=u(i),v=n.layoutResult?.tubeMap||i.nativeEvent.offsetY<n.referenceStripZonePx?null:f(g,b);v?n.setDraggingNode(v):n.setPanning(!0),e.current={x:i.clientX,y:i.clientY}}}function P(){let i=a.current;i.frame=0,i.pan&&(n.setTransform(n.scale,n.translateX+i.pan.dx,n.translateY+i.pan.dy),i.pan=null);let g=n.walkRowBars;if(i.hover&&g){let b=n.walkRowAt(i.hover.x,i.hover.y);n.setHoveredWalkRow(b===void 0?null:[g.reference,...g.rows][b].name)}if(i.hover&&n.nodePositions&&n.graph){let{x:b,y:v}=m(i.hover.x,i.hover.y);i.hover=null;let k=f(b,v);n.setHoveredNode(k),n.setHoveredEdge(k||n.layoutResult?.tubeMap||!n.hoverLightsEverything?null:Q(n.nodePositions,n.graph,b,v,n.axisScale,n.effectiveDrawPaths&&!n.facetPanels,n.positionsVersion,n.deletionEdgeIndexes,n.hiddenEdgeIndexes,n.deletionRoutes,n.layoutResult?.stranded))}}function L(){a.current.frame||(a.current.frame=requestAnimationFrame(P))}function Lt(){let i=a.current;cancelAnimationFrame(i.frame),i.frame=0,i.pan=null,i.hover=null}function Gt(i){let g=i.clientX-e.current.x,b=i.clientY-e.current.y;e.current={x:i.clientX,y:i.clientY},Math.hypot(i.clientX-o.current.x,i.clientY-o.current.y)>At&&(r.current=!0);let v=a.current;if(n.draggingNode)n.moveNode(n.draggingNode,g/n.scaleX,b/n.scaleY);else if(n.isPanning)v.pan={dx:(v.pan?.dx??0)+g,dy:(v.pan?.dy??0)+b},L();else{let k=i.currentTarget.getBoundingClientRect();v.hover={x:i.clientX-k.left,y:i.clientY-k.top},L()}}function U(){C(n)&&n.stopDragging()}function Et(){Lt(),C(n)&&(n.stopDragging(),n.setHoveredNode(null),n.setHoveredEdge(null),n.setHoveredWalkRow(null))}function It(i){let{x:g,y:b}=u(i),v=f(g,b);if(v){i.preventDefault(),d({nodeId:v,top:i.clientY,left:i.clientX});return}let k=n.walkRowAt(g*n.scaleX+n.translateX,b*n.scaleY+n.translateY);k!==void 0&&(i.preventDefault(),l({row:k,top:i.clientY,left:i.clientX}))}function Tt(i){if(!r.current){let{x:g,y:b}=u(i),v=f(g,b);n.setSelectedNode(v),v&&n.showNodeDetails(v)}}return{handlers:{onMouseDown:R,onPointerDown:y,onPointerMove:Gt,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,onPointerLeave:Et,onClick:Tt,onContextMenu:It},contextNode:s,contextRow:h,closeContextMenu:()=>{d(void 0),l(void 0)}}}var Ft={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:Ee,lineHeight:"normal"},Xt={height:Ie,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},Vt=p(function({model:e,lift:o,width:r,height:a,cell:s,handlers:d}){let[h,l]=M(null),m=o.walks[0];j(h,e),G(()=>{if(!h)return;let f=new V(h);f.resize(r,a);let R=le(()=>e.buildDrawing(o,!1)),y,P=ie(()=>{let L=R.get();L&&(L!==y&&(f.uploadGeometry(L.batch),y=L),e.applyHighlights(f),e.paint(f))});return()=>{P(),f.dispose()}},[h,e,o,r,a]);let u=e.walkLabel(m.name);return c("div",{style:s,children:[t("button",{type:"button",style:Xt,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([m.name]),e.setFacet("")},children:t(N,{walk:m,label:u,reference:e.walkReference,hint:`click to lift ${u} alone`,at:e.hoveredOn(m)})}),t("canvas",{ref:l,"data-testid":"graph-facet-canvas",style:{width:r,height:a,display:"block",cursor:e.isPanning||e.draggingNode?"grabbing":"grab",touchAction:e.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},...d})]})}),Yt=p(function({model:e,handlers:o}){let r=e.facetPanels,a=e.facetGrid,s=e.facetPlacement;if(!r||!a||!s)return null;let{columns:d,width:h,height:l}=a;return t("div",{"data-testid":"graph-facet-panels",style:{...Ft,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${d}, ${h}px)`,background:e.darkMode?"#1f1f1f":"white"},children:r.map((m,u)=>t(Vt,{model:e,lift:m,width:h,height:l,cell:{gridRow:Math.floor(s.cells[u]/d)+1,gridColumn:s.cells[u]%d+1},handlers:o},m.walks[0].name))})}),st=Yt;var it=w(t("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 lt=w([t("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"),t("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var ct=w(t("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 $t=p(function({model:e}){let o=e.colorSchemeLock;return t(W,{label:"Color",size:"small",sx:{minWidth:100},disabled:o!==void 0,title:o?.why,shown:o?.value,value:e.chosenColorScheme,options:Ge,onChange:r=>{e.setColorScheme(r)}})}),pt=$t;var dt=H()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function oe(n){return n===void 0?"\u2013":`${Math.round(n)}ms`}var Zt=p(function({model:e}){let{classes:o}=dt(),{lastFetchMs:r,lastLayoutMs:a,lastGeometryMs:s}=e,d=r!==void 0||a!==void 0||s!==void 0;return e.showPerf&&d?c(z,{variant:"caption",className:o.perf,"data-testid":"graph-perf-stats",children:["fetch ",oe(r)," \xB7 layout ",oe(a)," \xB7 geom"," ",oe(s)]}):null}),jt=p(function({model:e}){let{classes:o}=dt();return c("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:[c(z,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",t(Zt,{model:e})]})}),ut=jt;var Kt=p(function({model:e}){let{graph:o}=e;return t(W,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:Le.map(({value:r,label:a,description:s,available:d})=>({value:r,label:a,description:s,disabled:o?!d(o):!1})),onChange:r=>{e.switchLayout(r)}})}),ft=Kt;var Ut=p(function({model:e}){let{repeatChoices:o}=e;return e.chosenLayoutMode!=="walkrows"||o.length===0?null:t(W,{label:"Repeat",size:"small",sx:{minWidth:130,maxWidth:260},testId:"graph-repeat-select",value:e.selectedRepeat?.key??"",options:[{value:"",label:"Whole window"},...o.map(({key:r,name:a,unit:s})=>({value:r,label:`${a} \xB7 ${s.toLocaleString()} bp unit`}))],onChange:r=>{e.setRepeatKey(r)}})}),ht=Ut;var mt=w(t("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=w(t("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 Jt=p(function({model:e}){let[o,r]=M(!1),a=e.highlightMenuItems({picks:!1});return c(x,{children:[t(ce,{size:"small",tooltip:"Graph options",menuItems:[...a.length>0?[{label:"Haplotypes",icon:Ve,subMenu:a}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show...",icon:Te,subMenu:[...e.showMenuItems(),...e.modeDrawsNodes&&e.walkChoices.length>1&&e.popStack.length===0?[{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:"Settings",icon:Ye,onClick:()=>{r(!0)}},{type:"divider"},{label:"Close graph",icon:mt,onClick:()=>{e.clearGraph()}}],children:t(gt,{})}),t($e,{model:e,open:o,onClose:()=>{r(!1)}})]})}),vt=Jt;var qt=H()({formControl:{minWidth:130,maxWidth:260}}),Qt=p(function({model:e}){let{classes:o}=qt(),r=F(),{walkChoices:a}=e;if(a.length===0||!e.liftsWalks)return null;let s=new Set(a.map(l=>l.name)),d=new Map(a.map(l=>[l.name,l.label])),h=e.walkLayers.map(l=>l.walk).filter(l=>s.has(l));return a.length>ze?t(D,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{se(e).queueDialog(l=>[We,{model:e,onClose:l}])},children:h.length>0?`${h.length} of ${a.length} haplotypes`:"Highlight haplotypes..."}):c(ue,{size:"small",className:o.formControl,children:[t(fe,{id:r,children:"Highlight"}),t(ge,{labelId:r,multiple:!0,value:h,label:"Highlight","data-testid":"graph-walk-select",renderValue:l=>l.map(m=>d.get(m)).join(", "),onChange:l=>{let{value:m}=l.target;e.liftWalks(typeof m=="string"?m.split(","):m)},children:a.map(({name:l,label:m})=>c(me,{value:l,dense:!0,children:[t(de,{size:"small",checked:h.includes(l)}),t(he,{primary:m})]},l))})]})}),bt=Qt;var en=H()({toolbar:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),tn=p(function({model:e}){return t(z,{variant:"body2",children:e.zoomPercent})}),nn=p(function({model:e}){let{classes:o}=en();return c("div",{className:o.toolbar,children:[t(ft,{model:e}),t(pt,{model:e}),t(bt,{model:e}),t(ht,{model:e}),t(A,{title:"Zoom in",children:t(O,{size:"small",onClick:()=>{e.zoom(1.5,e.viewBox.width/2,e.viewBox.height/2)},children:t(lt,{})})}),t(A,{title:"Zoom out",children:t(O,{size:"small",onClick:()=>{e.zoom(1/1.5,e.viewBox.width/2,e.viewBox.height/2)},children:t(ct,{})})}),t(A,{title:"Zoom to fit",children:t(O,{size:"small",onClick:()=>{e.refitView()},children:t(it,{})})}),t(tn,{model:e}),t(ut,{model:e}),t(vt,{model:e})]})}),wt=nn;var on={position:"absolute",left:8,zIndex:5,background:"rgba(255,255,255,0.9)",textTransform:"none"},rn=p(function({model:e}){let{poppedFrom:o}=e;return o?c(D,{size:"small",variant:"outlined",style:{...on,...e.facetPanels?{bottom:8}:{top:8}},"data-testid":"graph-unpop-bubble",onClick:()=>{e.unpopBubble()},children:["\u25C0 Back to ",o.label]}):null}),yt=rn;var kt=w(t("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var St=w(t("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 K=p(function({model:e,row:o,bars:r,top:a,left:s,onClose:d}){let h=r??e.walkRowBars,l=e.walkRowLaunchTarget(o,h),m=l?.assembly,u=o>0?h?.rows[o-1]:void 0,f=u?.sample,R=!r&&e.walkRowBars,y=e.walkRowSamples;return t(_,{open:!0,anchorReference:"anchorPosition",anchorPosition:{top:a,left:s},onClose:()=>{d()},onMenuItemClick:P=>{P()},menuItems:[l&&m?{label:`Linear genome view \u2014 ${m} ${$(l.location)}`,icon:ee,onClick:()=>{e.showInLinearView({location:l.location,assembly:m})}}:{label:"Linear genome view",icon:ee,disabled:!0,disabledHelpText:l?`No assembly in this session is ${l.location.haplotype??l.label}`:"This walk states no contig coordinates",onClick:()=>{}},...u&&e.liftsWalks&&e.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${u.label}`,checked:e.walkLayers.some(P=>P.walk===u.name),onClick:()=>{e.toggleWalk(u.name)}}]:[],...R&&f&&!(y?.length===1&&y[0]===f)?[{label:`Show only ${f}`,icon:kt,onClick:()=>{e.setWalkRowSamples([f])}}]:[],...R&&y?[{label:"Show every sample",icon:St,onClick:()=>{e.setWalkRowSamples(void 0)}}]:[]]})});var an={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},sn={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},ln=p(function({bars:e,frame:o,ramp:r,rowGenes:a}){let s=F().replace(/[^\w-]/g,""),d=ve(()=>xe(e,o,{ramp:r,rowGenes:a,idPrefix:s}),[e,o,r,a,s]);return t(Z,{el:d})}),cn=p(function({model:e}){let o=e.walkStripRows,r=e.walkStripFrame,[a,s]=M(void 0),[d,h]=M(void 0);if(!o||!r)return null;let l=u=>{let f=u.currentTarget.getBoundingClientRect(),R=u.clientX-f.left,y=u.clientY-f.top;return{...Me(o,r,R,y),x:R,y}},m=Se(o,{ramp:e.referenceRampDomain,rampCss:X,genes:Pe(r,e.walkRowGenes,e.walkRowGeneGaps)});return c("div",{"data-testid":"graph-walk-strip",style:{position:"relative",borderTop:"1px solid #ddd"},onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{C(e)&&(e.setPointerInPane(!1),e.setStripHover(null)),h(void 0)},children:[c("svg",{width:r.width,height:r.height,style:{display:"block",cursor:"pointer"},onMouseMove:u=>{let f=l(u);f.row?(e.setStripHover({row:f.row.name,offset:f.offset}),h(r.labelled?void 0:{text:`${f.row.label} \xB7 ${ke(f.row,f.index===0?void 0:o.reference)}`,x:f.x,y:f.y})):(e.setStripHover(null),h(void 0))},onClick:u=>{let f=l(u);f.row&&f.index>0&&e.toggleWalk(f.row.name)},onContextMenu:u=>{let f=l(u);f.row&&(u.preventDefault(),s({row:f.index,top:u.clientY,left:u.clientX}))},children:[t(ln,{bars:o,frame:r,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),t(Z,{el:Re(o,r,e.walkStripMarks)}),t(Z,{el:Ce(o,r,new Set(e.walkLayers.map(u=>u.walk)))})]}),d?t("div",{style:{...sn,left:d.x+12,top:d.y-18},children:d.text}):null,c("div",{style:an,"data-testid":"graph-walk-strip-key",children:[m.map(u=>c("div",{style:S,children:[t(qe,{swatch:u.swatch}),t("span",{children:u.label})]},u.label)),t("div",{style:S,children:t("span",{children:"\u25AE ticks: where each walk passes the node under the pointer \xB7 click a bar to lift its walk"})})]}),a?t(K,{model:e,row:a.row,bars:o,top:a.top,left:a.left,onClose:()=>{s(void 0)}}):null]})}),xt=cn;var pn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:4},dn=p(function({model:e}){let o=e.walkStripLocator;return o?c("svg",{style:pn,width:e.paneWidth,height:e.canvasHeight,"data-testid":"graph-walk-strip-locator",children:[t("circle",{cx:o.x,cy:o.y,r:11,fill:"none",stroke:"white",strokeWidth:4}),t("circle",{cx:o.x,cy:o.y,r:11,fill:"none",stroke:"#111",strokeWidth:1.75})]}):null}),Mt=dn;function Rt(n){return Promise.resolve(new V(n))}var re={position:"absolute",bottom:8,right:8,background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6},un={position:"relative"},fn={position:"relative",lineHeight:0,isolation:"isolate"},hn={position:"absolute",left:0,right:0,bottom:0,zIndex:0},mn={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},gn={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},vn=p(function({model:e}){let o=e.drawnRowLabels;return t(x,{children:o.map(({label:r,y:a})=>{let s=a*e.scaleY+e.translateY;return s>=0&&s<=e.canvasHeight?t("div",{"data-testid":"graph-row-label",style:{...gn,top:s},children:r},a):null})})}),bn={position:"absolute",top:Y,right:Y,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none",zIndex:4},wn={width:18,height:3,borderRadius:2},yn=p(function({model:e}){let{pathLegend:o}=e;return o.length>0?t("div",{style:B,"data-testid":"graph-path-legend",children:o.map(({name:r,label:a,color:s})=>c("div",{style:S,children:[t("div",{style:{...wn,backgroundColor:s}}),t("span",{children:a})]},r))}):null}),kn=p(function({model:e}){let o=e.walkLift;return o?c("div",{style:B,"data-testid":"graph-walk-readout",children:[o.walks.map(r=>t(N,{walk:r,label:e.walkLabel(r.name),reference:e.walkReference,at:e.hoveredOn(r)},r.name)),e.liftPaintsOffReference?t(Ct,{}):null,c("div",{style:S,children:[t("div",{style:{...T,background:we}}),c("span",{children:["not on ",e.liftedWalksLabel]})]})]}):null}),Sn={minWidth:90,height:8,borderRadius:2,background:X},xn={display:"flex",justifyContent:"space-between",gap:8},Mn=p(function({model:e}){let o=e.walkLift?void 0:e.referenceRampDomain,{offReference:r,unplaced:a}=e.referenceRampOffKeys,s=Math.round(o?.start??0),d=Math.round(o?.end??0);return o?c("div",{style:B,"data-testid":"graph-ramp-legend",children:[t("div",{style:Sn}),c("div",{style:xn,children:[t("span",{children:s.toLocaleString()}),c("span",{children:["(",be(d-s),")"]}),t("span",{children:d.toLocaleString()})]}),r?t(Ct,{}):null,a?c("div",{style:S,children:[t("div",{style:{...T,background:Oe}}),t("span",{children:"no reference position"})]}):null]}):null});function Ct(){return c("div",{style:S,children:[t("div",{style:{...T,background:ye}}),t("span",{children:"off the reference"})]})}var Rn={...T,border:`2px solid ${Be}`,borderRadius:5,boxSizing:"border-box"},Cn=p(function({model:e}){return e.genePins.some(o=>o.exonsByNode.length>0)?t("div",{style:B,"data-testid":"graph-gene-legend",children:c("div",{style:S,children:[t("div",{style:Rn}),t("span",{children:"exon"})]})}):null}),Pt={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},Pn={...Pt,color:"#18181c",fontWeight:600},Ln={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:2},Gn=p(function({model:e}){let o=E(null);return G(()=>{let r=o.current;if(!r)return;let a=new ResizeObserver(()=>{C(e)&&e.hoveredNode===null&&e.setLegendSize({width:r.offsetWidth,height:r.offsetHeight})});return a.observe(r),()=>{a.disconnect()}},[e]),c("div",{ref:o,style:{...bn,top:Y+e.referenceStripZonePx},children:[t(Mn,{model:e}),t(Ke,{model:e}),t(Fe,{model:e}),t(Cn,{model:e}),t(yn,{model:e}),t(Je,{model:e}),t(Qe,{model:e}),t(kn,{model:e})]})}),En=p(function({model:e}){let o=e.overlayLabels.sizes,r=o.flatMap(({key:a,leader:s})=>s?[{key:a,...s}]:[]);return c(x,{children:[r.length>0?t("svg",{style:Ln,width:e.paneWidth,height:e.canvasHeight,children:r.map(({key:a,arcX:s,arcY:d,labelX:h,labelY:l})=>t("line",{"data-testid":"graph-label-leader",x1:s,y1:d,x2:h,y2:l,stroke:"#18181c",strokeWidth:1},a))}):null,o.map(({key:a,text:s,x:d,y:h,kind:l})=>t("div",{"data-testid":"graph-size-label",style:{...l==="deletion"?Pn:Pt,left:d,top:h},children:s},a))]})}),In=p(function({model:e}){let o=e.hoveredNode?e.nodeById?.get(e.hoveredNode):null,r=e.hoveredEdge!==null&&e.graph?e.graph.edges[e.hoveredEdge]:null,a=o?_e(o):void 0,s=r?te(r,e.deletions.find(h=>h.edgeIndex===e.hoveredEdge),h=>e.nodeById?.get(h)?.name??h):void 0,d=e.hoveredWalkRowText;return c(x,{children:[d&&!o?c("div",{style:re,"data-testid":"graph-walk-row-tooltip",children:[t("strong",{children:d.label})," \u2014 ",d.readout]}):null,o?c("div",{style:re,children:[t("strong",{children:o.name})," \u2014"," ",o.length.toLocaleString()," bp, depth"," ",o.depth.toFixed(1),a?c(x,{children:[t("br",{}),a.sample," ",$(a)," (rank"," ",o.stable?.rank,")"]}):null]}):null,s?t("div",{style:re,children:s.deletion?c(x,{children:[t("strong",{children:"Deletion"})," ",s.deletion.bp,t("br",{}),s.deletion.where]}):c(x,{children:["Edge: ",s.ends]})}):null]})}),Tn=p(function({model:e,nodeId:o,top:r,left:a,onClose:s}){let{own:d,reference:h,highlight:l}=e.nodeLaunchTargets(o);return t(_,{open:!0,anchorReference:"anchorPosition",anchorPosition:{top:r,left:a},onClose:()=>{s()},onMenuItemClick:m=>{m()},menuItems:[{label:"Node details",icon:ot,onClick:()=>{e.showNodeDetails(o)}},...De({own:d,reference:h,highlight:l,onShowLinear:m=>{e.showInLinearView(m)},onHighlight:e.canHighlightInLinearView?m=>{e.highlightInLinearView(m)}:void 0})]})}),Hn=p(function({model:e,ownChrome:o=!0}){let{canvasRef:r,canvas:a,error:s,retry:d}=nt(Rt,e),{handlers:h,contextNode:l,contextRow:m,closeContextMenu:u}=at(e);j(a,e);let f=e.facetPanels!==void 0;return c("div",{style:un,children:[o?t(wt,{model:e}):null,c("div",{style:fn,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{C(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?t("div",{style:{...hn,top:e.referenceStripZonePx,background:e.paperCss}}):null,t("canvas",{ref:r,"data-testid":"graph-genome-canvas",style:{width:e.paneWidth,height:e.canvasHeight,cursor:e.isPanning||e.draggingNode?"grabbing":"grab",touchAction:e.hostPlacesX?"auto":"none",overscrollBehavior:"contain",display:"block",position:"relative",zIndex:1},...h}),f?t(st,{model:e,handlers:h}):c(x,{children:[t(Ue,{model:e}),t(je,{model:e}),t(vn,{model:e}),t(En,{model:e}),t(Ae,{model:e}),t(Xe,{model:e}),t(Ze,{model:e}),t(et,{model:e}),t(Mt,{model:e}),t(Gn,{model:e})]}),t(yt,{model:e}),o?t("div",{style:mn,children:t(pe,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null]}),e.walkStripShown?t(xt,{model:e}):null,t(In,{model:e}),l?t(Tn,{model:e,nodeId:l.nodeId,top:l.top,left:l.left,onClose:u}):null,m?t(K,{model:e,row:m.row,top:m.top,left:m.left,onClose:u}):null,s?t(J,{error:s,onReset:d}):null,o&&e.error?t(J,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),Ya=Hn;export{Ya as a};
2
+ //# sourceMappingURL=chunk-6KOFUWDF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@8.2.0/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-AZFVORTC.js", "host:@jbrowse/render-core/useRenderingBackend", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/Info.mjs", "../../src/GraphGenomeView/components/WalkKey.tsx", "../../node_modules/.pnpm/@jbrowse+bandage-core@8.2.0/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-TDQLINVI.js", "../../src/GraphGenomeView/components/usePaneGestures.ts", "../../src/GraphGenomeView/components/FacetPanels.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/CropFree.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/ZoomIn.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/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.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/Close.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/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/UnpopButton.tsx", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/FilterList.mjs", "../../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/FilterListOff.mjs", "../../src/GraphGenomeView/components/WalkRowContextMenu.tsx", "../../src/GraphGenomeView/components/WalkStrip.tsx", "../../src/GraphGenomeView/components/WalkStripLocator.tsx", "../../src/GraphGenomeView/renderer/GraphRenderer.ts", "../../src/GraphGenomeView/components/GraphCanvas.tsx"],
4
+ "sourcesContent": ["// src/hoverText.ts\nfunction regionLabel(loc) {\n return `${loc.refName}:${(loc.start + 1).toLocaleString()}-${loc.end.toLocaleString()}`;\n}\nfunction edgeHoverText(edge, deletion, nameOf = (id) => id) {\n return deletion ? {\n deletion: {\n bp: `${deletion.bp.toLocaleString()} bp`,\n where: regionLabel(deletion)\n }\n } : {\n ends: `${nameOf(edge.from)}${edge.fromStrand ?? \"\"} \\u2192 ${nameOf(edge.to)}${edge.toStrand ?? \"\"}`\n };\n}\n\nexport {\n regionLabel,\n edgeHoverText\n};\n", "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", "\"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 { encodingSwatchCss } from '@jbrowse/bandage-core/walkEncoding'\nimport { walkKey } from '@jbrowse/bandage-core/walkKey'\n\nimport { legendRowStyle } from './legendStyles'\n\nimport type { LiftedWalk } from '@jbrowse/bandage-core/walkHighlight'\n\nexport const walkSwatchStyle = {\n width: 18,\n height: 8,\n borderRadius: 2,\n flex: 'none',\n}\nconst walkBlockStyle = { marginBottom: 2 }\nconst walkBarStyle = { ...walkSwatchStyle, width: 48 }\n\n// One walk's key: a swatch, or a short bar of the scale its lane shades by,\n// then its name; see walkKey for the words. `at`, where the hovered node sits\n// on the walk, stands in for the scale's stretch while there is one.\nexport default function WalkKey({\n walk,\n label,\n reference,\n hint,\n at,\n}: {\n walk: LiftedWalk\n label: string\n reference?: { name?: string; start: number; end: number }\n hint?: string\n at?: string\n}) {\n const key = walkKey(walk, reference)\n return (\n <div\n style={walkBlockStyle}\n title={[key.hover, hint].filter(Boolean).join(' \u00B7 ') || undefined}\n >\n <div style={legendRowStyle}>\n <div\n style={{\n ...(key.shades ? walkBarStyle : walkSwatchStyle),\n background: encodingSwatchCss(walk.encoding),\n }}\n />\n <span>\n <strong>{label}</strong>\n {key.delta}\n {key.outside}\n {key.reversed}\n </span>\n </div>\n {at ? (\n <div data-testid=\"graph-walk-at\">{at}</div>\n ) : key.scale ? (\n <div>{key.scale}</div>\n ) : null}\n </div>\n )\n}\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 { isAlive } from '@jbrowse/mobx-state-tree'\n\nimport type { GraphPaneModel } from '../model'\n\n// wheel events need passive:false to call preventDefault \u2014 React registers\n// wheel listeners as passive, so we must add this imperatively\nexport function useWheelZoom(\n canvas: HTMLCanvasElement | null | undefined,\n model: GraphPaneModel,\n) {\n useEffect(() => {\n if (!canvas) {\n return undefined\n }\n const c = canvas\n function handleWheel(e: WheelEvent) {\n if (model.hostPlacesX) {\n return\n }\n if (model.host) {\n e.stopPropagation()\n }\n e.preventDefault()\n const rect = c.getBoundingClientRect()\n model.zoom(\n wheelZoomFactor(e),\n e.clientX - rect.left,\n e.clientY - rect.top,\n )\n }\n c.addEventListener('wheel', handleWheel, { passive: false })\n return () => {\n c.removeEventListener('wheel', handleWheel)\n }\n }, [canvas, model])\n}\n\nconst CLICK_SLOP_PX = 3\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 // 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 }>({ frame: 0, pan: null, hover: null })\n useEffect(\n () => () => {\n cancelAnimationFrame(pendingRef.current.frame)\n },\n [],\n )\n const [contextNode, setContextNode] = useState<\n { nodeId: string; top: number; left: number } | undefined\n >(undefined)\n const [contextRow, setContextRow] = useState<\n { row: number; top: number; left: number } | undefined\n >(undefined)\n\n function screenToGraph(screenX: number, screenY: number) {\n return {\n x: (screenX - model.translateX) / model.scaleX,\n y: (screenY - model.translateY) / model.scaleY,\n }\n }\n\n function getMouseCoord(e: React.MouseEvent) {\n const rect = (e.currentTarget as HTMLCanvasElement).getBoundingClientRect()\n return screenToGraph(e.clientX - rect.left, e.clientY - rect.top)\n }\n\n // The node at a graph coordinate, which mousedown, mousemove and click all\n // need. Takes the coordinate rather than the event so a caller that already\n // has one does not pay for a second getBoundingClientRect.\n function nodeAt(x: number, y: number) {\n const { nodePositions } = model\n const sx = x * model.scaleX + model.translateX\n const sy = y * model.scaleY + model.translateY\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 return nodePositions\n ? findHoveredNode(\n nodePositions,\n x,\n y,\n model.axisScale,\n model.positionsVersion,\n model.nodeInk,\n )\n : null\n }\n\n // The linear view drags by mouse events, so a hosted pane that pans itself\n // keeps the mousedown from it; the gesture itself is the pointer's\n function onMouseDown(e: React.MouseEvent) {\n if (e.button === 0) {\n e.preventDefault()\n if (model.host && !model.hostPlacesX) {\n e.stopPropagation()\n }\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 hasMovedRef.current = false\n downRef.current = { x: e.clientX, y: e.clientY }\n if (model.hostPlacesX) {\n return\n }\n e.currentTarget.setPointerCapture(e.pointerId)\n const { x, y } = getMouseCoord(e)\n // a tube map's boxes are the layout's, and the strip's are bp, not\n // positions to drag\n const node =\n model.layoutResult?.tubeMap ||\n e.nativeEvent.offsetY < model.referenceStripZonePx\n ? null\n : nodeAt(x, y)\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\n function applyPending() {\n const pending = pendingRef.current\n pending.frame = 0\n if (pending.pan) {\n model.setTransform(\n model.scale,\n model.translateX + pending.pan.dx,\n model.translateY + pending.pan.dy,\n )\n pending.pan = null\n }\n const bars = model.walkRowBars\n if (pending.hover && bars) {\n const i = model.walkRowAt(pending.hover.x, pending.hover.y)\n model.setHoveredWalkRow(\n i === undefined ? null : [bars.reference, ...bars.rows][i]!.name,\n )\n }\n if (pending.hover && model.nodePositions && model.graph) {\n const { x, y } = screenToGraph(pending.hover.x, pending.hover.y)\n pending.hover = null\n const node = nodeAt(x, y)\n model.setHoveredNode(node)\n model.setHoveredEdge(\n node || model.layoutResult?.tubeMap || !model.hoverLightsEverything\n ? null\n : findHoveredEdge(\n model.nodePositions,\n model.graph,\n x,\n y,\n model.axisScale,\n // resolved, so the hit index bounds the ribbons that are\n // actually drawn \u2014 see effectiveDrawPaths. Facet panels draw\n // 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 }\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 }\n\n function onPointerMove(e: React.PointerEvent) {\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() {\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\n function onPointerLeave() {\n dropPending()\n if (!isAlive(model)) {\n return\n }\n model.stopDragging()\n model.setHoveredNode(null)\n model.setHoveredEdge(null)\n model.setHoveredWalkRow(null)\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 } = getMouseCoord(e)\n const node = nodeAt(x, y)\n if (node) {\n e.preventDefault()\n setContextNode({ nodeId: node, top: e.clientY, left: e.clientX })\n return\n }\n const row = model.walkRowAt(\n x * model.scaleX + model.translateX,\n y * model.scaleY + model.translateY,\n )\n if (row !== undefined) {\n e.preventDefault()\n setContextRow({ row, top: e.clientY, left: e.clientX })\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 } = getMouseCoord(e)\n const node = nodeAt(x, y)\n model.setSelectedNode(node)\n if (node) {\n model.showNodeDetails(node)\n }\n }\n }\n\n return {\n handlers: {\n onMouseDown,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel: onPointerUp,\n onLostPointerCapture: onPointerUp,\n onPointerLeave,\n onClick,\n onContextMenu,\n },\n contextNode,\n contextRow,\n closeContextMenu: () => {\n setContextNode(undefined)\n setContextRow(undefined)\n },\n }\n}\n\nexport type PaneHandlers = ReturnType<typeof usePaneGestures>['handlers']\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 WalkKey from './WalkKey'\nimport { useWheelZoom } from './usePaneGestures'\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 FacetPanel = observer(function FacetPanel({\n model,\n lift,\n width,\n height,\n cell,\n handlers,\n}: {\n model: GraphPaneModel\n lift: WalkLift\n width: number\n height: number\n cell: { gridRow: number; gridColumn: number }\n handlers: PaneHandlers\n}) {\n const [canvas, setCanvas] = useState<HTMLCanvasElement | null>(null)\n const walk = lift.walks[0]!\n useWheelZoom(canvas, model)\n\n useEffect(() => {\n if (!canvas) {\n return undefined\n }\n const renderer = new Canvas2DRenderer(canvas)\n renderer.resize(width, height)\n const drawing = computed(() => model.buildDrawing(lift, false))\n let uploaded: ReturnType<typeof model.buildDrawing>\n const dispose = autorun(() => {\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.applyHighlights(renderer)\n model.paint(renderer)\n })\n return () => {\n dispose()\n renderer.dispose()\n }\n }, [canvas, model, lift, width, height])\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 <WalkKey\n walk={walk}\n label={label}\n reference={model.walkReference}\n hint={`click to lift ${label} alone`}\n at={model.hoveredOn(walk)}\n />\n </button>\n <canvas\n ref={setCanvas}\n data-testid=\"graph-facet-canvas\"\n style={{\n width,\n height,\n display: 'block',\n cursor: model.isPanning || model.draggingNode ? 'grabbing' : 'grab',\n touchAction: model.hostPlacesX ? 'auto' : 'none',\n overscrollBehavior: 'contain',\n }}\n {...handlers}\n />\n </div>\n )\n})\n\nconst FacetPanels = observer(function FacetPanels({\n model,\n handlers,\n}: {\n model: GraphPaneModel\n handlers: PaneHandlers\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: model.darkMode ? '#1f1f1f' : 'white',\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 />\n ))}\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}\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 const { repeatChoices } = model\n if (model.chosenLayoutMode !== 'walkrows' || repeatChoices.length === 0) {\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={[\n { value: '', label: 'Whole window' },\n ...repeatChoices.map(({ key, name, unit }) => ({\n value: key,\n label: `${name} \u00B7 ${unit.toLocaleString()} bp unit`,\n })),\n ]}\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 { useState } from 'react'\n\nimport { CascadingMenuButton } from '@jbrowse/core/ui'\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 const [settingsOpen, setSettingsOpen] = useState(false)\n // the toolbar beside this menu picks the walks and the repeat\n const haplotypes = model.highlightMenuItems({ picks: false })\n\n return (\n <>\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 &&\n model.walkChoices.length > 1 &&\n model.popStack.length === 0\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: 'Settings',\n icon: SettingsIcon,\n onClick: () => {\n setSettingsOpen(true)\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 <GraphSettingsDialog\n model={model}\n open={settingsOpen}\n onClose={() => {\n setSettingsOpen(false)\n }}\n />\n </>\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.liftWalks(typeof value === 'string' ? value.split(',') : value)\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 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 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 model.zoom(1.5, model.viewBox.width / 2, model.viewBox.height / 2)\n }}\n >\n <ZoomInIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Zoom out\">\n <IconButton\n size=\"small\"\n onClick={() => {\n model.zoom(\n 1 / 1.5,\n model.viewBox.width / 2,\n model.viewBox.height / 2,\n )\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 { Button } from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\nconst style = {\n position: 'absolute' as const,\n left: 8,\n zIndex: 5,\n background: 'rgba(255,255,255,0.9)',\n textTransform: 'none' as const,\n}\n\nconst UnpopButton = observer(function UnpopButton({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { poppedFrom } = model\n return poppedFrom ? (\n <Button\n size=\"small\"\n variant=\"outlined\"\n style={{ ...style, ...(model.facetPanels ? { bottom: 8 } : { top: 8 }) }}\n data-testid=\"graph-unpop-bubble\"\n onClick={() => {\n void model.unpopBubble()\n }}\n >\n \u25C0 Back to {poppedFrom.label}\n </Button>\n ) : null\n})\n\nexport default UnpopButton\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');", "import { Menu } from '@jbrowse/core/ui'\nimport FilterListIcon from '@mui/icons-material/FilterList'\nimport FilterListOffIcon from '@mui/icons-material/FilterListOff'\nimport LineStyleIcon from '@mui/icons-material/LineStyle'\nimport { observer } from 'mobx-react'\n\nimport { locLabel } from '../../launchFromGraph/contributors'\n\nimport type { GraphPaneModel } from '../model'\nimport type { WalkRows } from '@jbrowse/bandage-core/layout/walkRows'\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\nexport const WalkRowContextMenu = observer(function WalkRowContextMenu({\n model,\n row,\n bars,\n top,\n left,\n onClose,\n}: {\n model: GraphPaneModel\n row: number\n // the rows `row` indexes, walk rows' own unless a strip's\n bars?: WalkRows\n top: number\n left: number\n onClose: () => void\n}) {\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 <Menu\n open\n anchorReference=\"anchorPosition\"\n anchorPosition={{ top, left }}\n onClose={() => {\n onClose()\n }}\n onMenuItemClick={callback => {\n callback()\n }}\n menuItems={[\n target && assembly\n ? {\n label: `Linear genome view \u2014 ${assembly} ${locLabel(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})\n", "import { useId, 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 from './ElTree'\nimport { WalkRowContextMenu } from './WalkRowContextMenu'\nimport { Swatch } from './WalkRowsOverlay'\nimport { legendRowStyle } from './legendStyles'\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 = useId().replace(/[^\\w-]/g, '')\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\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 { row: number; top: number; left: number } | undefined\n >(undefined)\n const [tip, setTip] = useState<\n { text: string; x: number; y: number } | undefined\n >(undefined)\n if (!bars || !frame) {\n return null\n }\n const hit = (e: React.MouseEvent<SVGSVGElement>) => {\n const box = e.currentTarget.getBoundingClientRect()\n const x = e.clientX - box.left\n const y = e.clientY - box.top\n return { ...stripRowAt(bars, frame, x, y), x, y }\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 setTip(undefined)\n }}\n >\n <svg\n width={frame.width}\n height={frame.height}\n style={{ display: 'block', cursor: 'pointer' }}\n onMouseMove={e => {\n const at = hit(e)\n if (at.row) {\n model.setStripHover({ row: at.row.name, offset: at.offset! })\n setTip(\n frame.labelled\n ? undefined\n : {\n text: `${at.row.label} \u00B7 ${walkRowReadout(\n at.row,\n at.index === 0 ? undefined : bars.reference,\n )}`,\n x: at.x,\n y: at.y,\n },\n )\n } else {\n model.setStripHover(null)\n setTip(undefined)\n }\n }}\n onClick={e => {\n const at = hit(e)\n if (at.row && at.index! > 0) {\n model.toggleWalk(at.row.name)\n }\n }}\n onContextMenu={e => {\n const at = hit(e)\n if (at.row) {\n e.preventDefault()\n setMenu({ row: at.index!, top: e.clientY, left: e.clientX })\n }\n }}\n >\n <StripBars\n bars={bars}\n frame={frame}\n ramp={model.referenceRampDomain}\n rowGenes={model.walkRowGenes}\n />\n <ElTree el={walkMarksTree(bars, frame, model.walkStripMarks)} />\n <ElTree\n el={walkStripLabelsTree(\n bars,\n frame,\n new Set(model.walkLayers.map(l => l.walk)),\n )}\n />\n </svg>\n {tip ? (\n <div style={{ ...tipStyle, left: tip.x + 12, top: tip.y - 18 }}>\n {tip.text}\n </div>\n ) : null}\n <div style={keyStyle} data-testid=\"graph-walk-strip-key\">\n {key.map(entry => (\n <div key={entry.label} style={legendRowStyle}>\n <Swatch swatch={entry.swatch} />\n <span>{entry.label}</span>\n </div>\n ))}\n <div style={legendRowStyle}>\n <span>\n \u25AE ticks: where each walk passes the node under the pointer \u00B7 click a\n bar to lift its walk\n </span>\n </div>\n </div>\n {menu ? (\n <WalkRowContextMenu\n model={model}\n row={menu.row}\n bars={bars}\n top={menu.top}\n left={menu.left}\n onClose={() => {\n setMenu(undefined)\n }}\n />\n ) : null}\n </div>\n )\n})\n\nexport default WalkStrip\n", "import { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\nconst svgStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n overflow: 'visible' as const,\n zIndex: 4,\n}\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 <svg\n style={svgStyle}\n width={model.paneWidth}\n height={model.canvasHeight}\n data-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 </svg>\n ) : null\n})\n\nexport default WalkStripLocator\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 } from 'react'\n\nimport { formatBp } from '@jbrowse/bandage-core/graphLabels'\nimport { edgeHoverText } from '@jbrowse/bandage-core/hoverText'\nimport { LEGEND_INSET_PX } from '@jbrowse/bandage-core/labelLayout'\nimport { RAMP_GRADIENT_CSS } from '@jbrowse/bandage-core/referenceRampCss'\nimport {\n LIFT_BACKDROP_CSS,\n REFERENCE_RAMP_ALT_CSS,\n} from '@jbrowse/bandage-core/renderer/GeometryBuilder'\nimport { ErrorBanner, LoadingOverlay, Menu } from '@jbrowse/core/ui'\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { useRenderingBackend } from '@jbrowse/render-core/useRenderingBackend'\nimport InfoIcon from '@mui/icons-material/Info'\nimport { observer } from 'mobx-react'\n\nimport BubbleHalos, { HaloLegend } from './BubbleHalos'\nimport FacetPanels from './FacetPanels'\nimport GenePins, { EXON_COLOR } from './GenePins'\nimport GraphToolbar from './GraphToolbar'\nimport LabelLayer from './LabelLayer'\nimport ReferenceStripOverlay, {\n ReferenceStripLegend,\n} from './ReferenceStripOverlay'\nimport TubeMapOverlay, { TubeMapLegend } from './TubeMapOverlay'\nimport UnpopButton from './UnpopButton'\nimport WalkKey, { walkSwatchStyle } from './WalkKey'\nimport { WalkRowContextMenu } from './WalkRowContextMenu'\nimport WalkRowsOverlay, { WalkRowsLegend } from './WalkRowsOverlay'\nimport WalkStrip from './WalkStrip'\nimport WalkStripLocator from './WalkStripLocator'\nimport { UNPLACED_SWATCH, legendBoxStyle, legendRowStyle } from './legendStyles'\nimport { usePaneGestures, useWheelZoom } from './usePaneGestures'\nimport { locLabel, nodeOwnLocation } from '../../launchFromGraph/contributors'\nimport { nodeLaunchMenuItems } from '../../launchFromGraph/graphMenuItems'\nimport { createGraphRenderer } from '../renderer/GraphRenderer'\n\nimport type { GraphPaneModel } from '../model'\n\n// Bottom RIGHT, not bottom left: the row labels of a row-structured layout are\n// pinned to the left edge, so a bottom-left tooltip lands on top of them and\n// covers the one thing that says which haplotype a row is. Nothing is drawn\n// against the right edge.\nconst tooltipStyle = {\n position: 'absolute' as const,\n bottom: 8,\n right: 8,\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\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. Rows scrolled out of the canvas are dropped rather\n// than clamped to the edge, so a label never points at a row that is not\n// there.\nconst RowLabels = observer(function RowLabels({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const rowLabels = model.drawnRowLabels\n return (\n <>\n {rowLabels.map(({ label, y }) => {\n const screenY = y * model.scaleY + model.translateY\n return screenY >= 0 && screenY <= model.canvasHeight ? (\n // Keyed on the row, not on the label: two rows can carry the same\n // words. The sample-row layout names row 0 for the assembly the\n // backbone comes from and the rows below it for the samples\n // contributing alleles, and a diploid reference is in both lists \u2014\n // one haplotype is the reference path, the other walks alleles of its\n // own, and `parsePanSN` reduces both to one sample name.\n <div\n key={y}\n data-testid=\"graph-row-label\"\n style={{ ...rowLabelStyle, top: screenY }}\n >\n {label}\n </div>\n ) : null\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. A row-structured\n// layout draws its band across the middle, which is what the keys are for. The\n// two keys stack rather than each claiming the corner, since a path-coloured\n// graph can also be reference-position coloured.\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 alignItems: 'flex-end',\n gap: 4,\n pointerEvents: 'none' as const,\n zIndex: 4,\n}\n\nconst pathSwatchStyle = { width: 18, height: 3, borderRadius: 2 }\n\n// Which haplotype each ribbon colour is. The ribbons are one stroke per path\n// fanned across every edge the path crosses, so without this the drawing states\n// that the alleles are taken by *different* samples and never which.\nconst PathLegend = observer(function PathLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { pathLegend } = model\n return pathLegend.length > 0 ? (\n <div style={legendBoxStyle} data-testid=\"graph-path-legend\">\n {pathLegend.map(({ name, label, color }) => (\n <div key={name} style={legendRowStyle}>\n <div style={{ ...pathSwatchStyle, backgroundColor: color }} />\n <span>{label}</span>\n </div>\n ))}\n </div>\n ) : null\n})\n\n// Each lifted walk's key, then what the faded rest is\nconst WalkReadout = observer(function WalkReadout({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const lift = model.walkLift\n if (!lift) {\n return null\n }\n return (\n <div style={legendBoxStyle} data-testid=\"graph-walk-readout\">\n {lift.walks.map(w => (\n <WalkKey\n key={w.name}\n walk={w}\n label={model.walkLabel(w.name)}\n reference={model.walkReference}\n at={model.hoveredOn(w)}\n />\n ))}\n {/* the ramp's own key, which names this, is off while walks are lifted */}\n {model.liftPaintsOffReference ? <OffReferenceRow /> : null}\n <div style={legendRowStyle}>\n <div style={{ ...walkSwatchStyle, background: LIFT_BACKDROP_CSS }} />\n <span>not on {model.liftedWalksLabel}</span>\n </div>\n </div>\n )\n})\n\n// The reference-position ramp, as a strip labelled with the interval it runs\n// over. Nothing on screen used to say that red-to-magenta means left-to-right of\n// the cut window, so two tutorials carried that sentence in prose and a reader\n// arriving at a figure had no way to know it at all.\nconst rampStripStyle = {\n minWidth: 90,\n height: 8,\n borderRadius: 2,\n background: RAMP_GRADIENT_CSS,\n}\n\nconst rampEndsStyle = {\n display: 'flex',\n justifyContent: 'space-between',\n gap: 8,\n}\n\nconst ReferenceRampLegend = observer(function ReferenceRampLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n // under lifted walks each lane states its own scale, and the rest is grey\n const domain = model.walkLift ? undefined : model.referenceRampDomain\n const { offReference, unplaced } = model.referenceRampOffKeys\n // a measured domain runs between node midpoints, which can fall on a half bp\n const start = Math.round(domain?.start ?? 0)\n const end = Math.round(domain?.end ?? 0)\n return domain ? (\n <div style={legendBoxStyle} data-testid=\"graph-ramp-legend\">\n <div style={rampStripStyle} />\n <div style={rampEndsStyle}>\n <span>{start.toLocaleString()}</span>\n <span>({formatBp(end - start)})</span>\n <span>{end.toLocaleString()}</span>\n </div>\n {offReference ? <OffReferenceRow /> : null}\n {unplaced ? (\n <div style={legendRowStyle}>\n <div style={{ ...walkSwatchStyle, background: UNPLACED_SWATCH }} />\n <span>no reference position</span>\n </div>\n ) : null}\n </div>\n ) : null\n})\n\n// The charcoal both the ramp and a lane coloured by reference position give\n// sequence the reference does not carry\nfunction OffReferenceRow() {\n return (\n <div style={legendRowStyle}>\n <div style={{ ...walkSwatchStyle, background: REFERENCE_RAMP_ALT_CSS }} />\n <span>off the reference</span>\n </div>\n )\n}\n\nconst exonSwatchStyle = {\n ...walkSwatchStyle,\n border: `2px solid ${EXON_COLOR}`,\n borderRadius: 5,\n boxSizing: 'border-box' as const,\n}\n\nconst GeneLegend = observer(function GeneLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n return model.genePins.some(pin => pin.exonsByNode.length > 0) ? (\n <div style={legendBoxStyle} data-testid=\"graph-gene-legend\">\n <div style={legendRowStyle}>\n <div style={exonSwatchStyle} />\n <span>exon</span>\n </div>\n </div>\n ) : null\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// Under the labels (z 3) and over the canvas, so a leader runs beneath the text\n// it points from rather than across it. `overflow: visible` because a label\n// displaced past the canvas edge is culled by the placement, not clipped here.\nconst leaderStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n overflow: 'visible' as const,\n zIndex: 2,\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: the walk keys' hover readout would otherwise refit the view,\n// and the refit clears the hover that grew it\nconst Legends = observer(function Legends({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const ref = useRef<HTMLDivElement>(null)\n useEffect(() => {\n const el = ref.current\n if (!el) {\n return\n }\n // the last callback can land after the track is closed\n const observer = new ResizeObserver(() => {\n if (isAlive(model) && model.hoveredNode === null) {\n model.setLegendSize({ width: el.offsetWidth, height: el.offsetHeight })\n }\n })\n observer.observe(el)\n return () => {\n observer.disconnect()\n }\n }, [model])\n return (\n <div\n ref={ref}\n style={{\n ...legendStackStyle,\n top: LEGEND_INSET_PX + model.referenceStripZonePx,\n }}\n >\n <ReferenceRampLegend model={model} />\n <ReferenceStripLegend model={model} />\n <HaloLegend model={model} />\n <GeneLegend model={model} />\n <PathLegend model={model} />\n <TubeMapLegend model={model} />\n <WalkRowsLegend model={model} />\n <WalkReadout 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 {leaders.length > 0 ? (\n <svg\n style={leaderStyle}\n width={model.paneWidth}\n height={model.canvasHeight}\n >\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 </svg>\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\nconst HoverTooltips = observer(function HoverTooltips({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const hoveredNodeData = model.hoveredNode\n ? model.nodeById?.get(model.hoveredNode)\n : null\n\n const hoveredEdgeData =\n model.hoveredEdge !== null && model.graph\n ? model.graph.edges[model.hoveredEdge]\n : null\n\n const ownLocation = hoveredNodeData\n ? nodeOwnLocation(hoveredNodeData)\n : undefined\n\n const hoveredEdgeText = hoveredEdgeData\n ? edgeHoverText(\n hoveredEdgeData,\n model.deletions.find(d => d.edgeIndex === model.hoveredEdge),\n id => model.nodeById?.get(id)?.name ?? id,\n )\n : undefined\n\n const walkRow = model.hoveredWalkRowText\n\n return (\n <>\n {walkRow && !hoveredNodeData ? (\n <div style={tooltipStyle} data-testid=\"graph-walk-row-tooltip\">\n <strong>{walkRow.label}</strong> \u2014 {walkRow.readout}\n </div>\n ) : null}\n {hoveredNodeData ? (\n <div style={tooltipStyle}>\n <strong>{hoveredNodeData.name}</strong> \u2014{' '}\n {hoveredNodeData.length.toLocaleString()} bp, depth{' '}\n {hoveredNodeData.depth.toFixed(1)}\n {/* Which assembly contributed this segment, and where it sits on it.\n rGFA states both, and until now neither reached the screen: the\n node was a bare id in a picture. */}\n {ownLocation ? (\n <>\n <br />\n {ownLocation.sample} {locLabel(ownLocation)} (rank{' '}\n {hoveredNodeData.stable?.rank})\n </>\n ) : null}\n </div>\n ) : null}\n {hoveredEdgeText ? (\n <div style={tooltipStyle}>\n {/* A deletion edge is the one link that means something on its own \u2014\n the backbone it skips is sequence some haplotype does not carry \u2014\n so it says how much rather than just naming its endpoints. */}\n {hoveredEdgeText.deletion ? (\n <>\n <strong>Deletion</strong> {hoveredEdgeText.deletion.bp}\n <br />\n {hoveredEdgeText.deletion.where}\n </>\n ) : (\n <>Edge: {hoveredEdgeText.ends}</>\n )}\n </div>\n ) : null}\n </>\n )\n})\n\n// Flat rather than under a \"Launch view\" submenu: this menu is two or three\n// items long and every one of them is contextual to the node just clicked. The\n// submenu grouping earns its keep in the long view and track menus.\nconst NodeContextMenu = observer(function NodeContextMenu({\n model,\n nodeId,\n top,\n left,\n onClose,\n}: {\n model: GraphPaneModel\n nodeId: string\n top: number\n left: number\n onClose: () => void\n}) {\n const { own, reference, highlight } = model.nodeLaunchTargets(nodeId)\n return (\n <Menu\n open\n anchorReference=\"anchorPosition\"\n anchorPosition={{ top, left }}\n onClose={() => {\n onClose()\n }}\n onMenuItemClick={callback => {\n callback()\n }}\n menuItems={[\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})\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 { handlers, contextNode, contextRow, closeContextMenu } =\n usePaneGestures(model)\n useWheelZoom(canvas, model)\n const faceted = model.facetPanels !== undefined\n\n return (\n <div style={wrapperStyle}>\n {ownChrome ? <GraphToolbar model={model} /> : null}\n\n <div\n style={canvasAreaStyle}\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: model.paperCss,\n }}\n />\n ) : null}\n <canvas\n ref={canvasRef}\n data-testid=\"graph-genome-canvas\"\n style={{\n width: model.paneWidth,\n height: model.canvasHeight,\n cursor: model.isPanning || model.draggingNode ? 'grabbing' : 'grab',\n // a pane the linear view drags leaves a finger its scroll\n touchAction: model.hostPlacesX ? 'auto' : 'none',\n overscrollBehavior: 'contain',\n display: 'block',\n position: 'relative',\n zIndex: 1,\n }}\n {...handlers}\n />\n\n {faceted ? (\n <FacetPanels model={model} handlers={handlers} />\n ) : (\n <>\n <TubeMapOverlay 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 <UnpopButton model={model} />\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 </div>\n\n {model.walkStripShown ? <WalkStrip model={model} /> : null}\n\n <HoverTooltips model={model} />\n\n {contextNode ? (\n <NodeContextMenu\n model={model}\n nodeId={contextNode.nodeId}\n top={contextNode.top}\n left={contextNode.left}\n onClose={closeContextMenu}\n />\n ) : null}\n\n {contextRow ? (\n <WalkRowContextMenu\n model={model}\n row={contextRow.row}\n top={contextRow.top}\n left={contextRow.left}\n onClose={closeContextMenu}\n />\n ) : null}\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
+ "mappings": "29BACA,SAASA,GAAYC,EAAK,CACxB,MAAO,GAAGA,EAAI,OAAO,KAAKA,EAAI,MAAQ,GAAG,eAAe,CAAC,IAAIA,EAAI,IAAI,eAAe,CAAC,EACvF,CACA,SAASC,GAAcC,EAAMC,EAAUC,EAAUC,GAAOA,EAAI,CAC1D,OAAOF,EAAW,CAChB,SAAU,CACR,GAAI,GAAGA,EAAS,GAAG,eAAe,CAAC,MACnC,MAAOJ,GAAYI,CAAQ,CAC7B,CACF,EAAI,CACF,KAAM,GAAGC,EAAOF,EAAK,IAAI,CAAC,GAAGA,EAAK,YAAc,EAAE,WAAWE,EAAOF,EAAK,EAAE,CAAC,GAAGA,EAAK,UAAY,EAAE,EACpG,CACF,CCbA,IAAMI,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,0JAC7C,CACF,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAOC,IAAMC,GAAsCC,GAAK,qBAAqB,EACtEC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECfxD,IAAOC,GAAQC,EAA2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,KAAMA,EAAY,KAClB,QAASE,EACX,EACE,KAEHD,EACCjG,EAACkH,EAAA,CACC,MAAOpH,EACP,IAAKmG,EAAW,IAChB,IAAKA,EAAW,IAChB,KAAMA,EAAW,KACjB,QAASC,EACX,EACE,KAEHP,EACC3F,EAACmH,EAAA,CAAY,MAAOxB,EAAa,QAASC,EAAa,EACrD,KAEHJ,GAAa1F,EAAM,MAClBE,EAACmH,EAAA,CACC,MAAOrH,EAAM,MACb,QACEA,EAAM,aACF,IAAM,CACJA,EAAM,UAAU,CAClB,EACA,OAER,EACE,MACN,CAEJ,CAAC,EAEMsH,GAAQ7B",
6
+ "names": ["regionLabel", "loc", "edgeHoverText", "edge", "deletion", "nameOf", "id", "host", "read", "name", "useRenderingBackend", "read", "useRenderingBackend_default", "host", "Info_default", "createSvgIcon", "jsx", "walkSwatchStyle", "walkBlockStyle", "walkBarStyle", "WalkKey", "walk", "label", "reference", "hint", "at", "key", "walkKey", "jsxs", "legendRowStyle", "jsx", "encodingSwatchCss", "ZOOM_PER_NOTCH", "NOTCH_PX", "LINE_PX", "PAGE_PX", "PINCH_GAIN", "MAX_NOTCHES_PER_EVENT", "wheelZoomFactor", "e", "px", "notches", "useWheelZoom", "canvas", "model", "useEffect", "c", "handleWheel", "e", "rect", "wheelZoomFactor", "CLICK_SLOP_PX", "usePaneGestures", "lastMouseRef", "useRef", "downRef", "hasMovedRef", "pendingRef", "contextNode", "setContextNode", "useState", "contextRow", "setContextRow", "screenToGraph", "screenX", "screenY", "getMouseCoord", "nodeAt", "x", "y", "nodePositions", "sx", "sy", "onStrip", "findHoveredNode", "onMouseDown", "onPointerDown", "node", "applyPending", "pending", "bars", "i", "findHoveredEdge", "scheduleFrame", "dropPending", "onPointerMove", "dx", "dy", "onPointerUp", "isAlive", "onPointerLeave", "onContextMenu", "row", "onClick", "gridStyle", "FACET_GAP_PX", "titleStyle", "FACET_TITLE_PX", "FacetPanel", "observer", "model", "lift", "width", "height", "cell", "handlers", "canvas", "setCanvas", "useState", "walk", "useWheelZoom", "useEffect", "renderer", "Canvas2DRenderer", "drawing", "computed", "uploaded", "dispose", "autorun", "built", "label", "jsxs", "jsx", "WalkKey", "FacetPanels", "panels", "grid", "place", "columns", "i", "FacetPanels_default", "CropFree_default", "createSvgIcon", "jsx", "ZoomIn_default", "createSvgIcon", "jsx", "ZoomOut_default", "createSvgIcon", "jsx", "ColorSchemeSelect", "observer", "model", "fixed", "jsx", "LabelledSelect", "COLOR_SCHEMES", "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", "repeatChoices", "jsx", "LabelledSelect", "key", "name", "unit", "RepeatSelect_default", "Close_default", "createSvgIcon", "jsx", "MoreVert_default", "createSvgIcon", "jsx", "SettingsMenu", "observer", "model", "settingsOpen", "setSettingsOpen", "useState", "haplotypes", "jsxs", "Fragment", "jsx", "CascadingMenuButton", "Route_default", "Visibility_default", "Settings_default", "Close_default", "MoreVert_default", "GraphSettingsDialog_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", "jsxs", "LayoutSelect_default", "ColorSchemeSelect_default", "WalkSelect_default", "RepeatSelect_default", "Tooltip", "IconButton", "ZoomIn_default", "ZoomOut_default", "CropFree_default", "GraphStats_default", "SettingsMenu_default", "GraphToolbar_default", "style", "UnpopButton", "observer", "model", "poppedFrom", "jsxs", "Button", "UnpopButton_default", "FilterList_default", "createSvgIcon", "jsx", "FilterListOff_default", "createSvgIcon", "jsx", "WalkRowContextMenu", "observer", "model", "row", "bars", "top", "left", "onClose", "rows", "target", "assembly", "walk", "sample", "filters", "shown", "jsx", "Menu", "callback", "locLabel", "LineStyle_default", "l", "FilterList_default", "FilterListOff_default", "keyStyle", "tipStyle", "StripBars", "observer", "bars", "frame", "ramp", "rowGenes", "idPrefix", "useId", "tree", "useMemo", "walkRowsTree", "jsx", "ElTree", "WalkStrip", "model", "menu", "setMenu", "useState", "tip", "setTip", "hit", "e", "box", "x", "stripRowAt", "key", "walkRowsKey", "RAMP_GRADIENT_CSS", "stripGeneGaps", "jsxs", "isAlive", "at", "walkRowReadout", "walkMarksTree", "walkStripLabelsTree", "l", "entry", "legendRowStyle", "Swatch", "WalkRowContextMenu", "WalkStrip_default", "svgStyle", "WalkStripLocator", "observer", "model", "at", "jsxs", "jsx", "WalkStripLocator_default", "createGraphRenderer", "canvas", "Canvas2DRenderer", "tooltipStyle", "wrapperStyle", "canvasAreaStyle", "paperStyle", "loadingLayerStyle", "rowLabelStyle", "RowLabels", "observer", "model", "rowLabels", "jsx", "Fragment", "label", "y", "screenY", "legendStackStyle", "LEGEND_INSET_PX", "pathSwatchStyle", "PathLegend", "pathLegend", "legendBoxStyle", "name", "color", "jsxs", "legendRowStyle", "WalkReadout", "lift", "w", "WalkKey", "OffReferenceRow", "walkSwatchStyle", "LIFT_BACKDROP_CSS", "rampStripStyle", "RAMP_GRADIENT_CSS", "rampEndsStyle", "ReferenceRampLegend", "domain", "offReference", "unplaced", "start", "end", "formatBp", "UNPLACED_SWATCH", "REFERENCE_RAMP_ALT_CSS", "exonSwatchStyle", "EXON_COLOR", "GeneLegend", "pin", "nodeLabelStyle", "deletionLabelStyle", "leaderStyle", "Legends", "ref", "useRef", "useEffect", "el", "isAlive", "ReferenceStripLegend", "HaloLegend", "TubeMapLegend", "WalkRowsLegend", "GraphSizeLabels", "labels", "leaders", "key", "leader", "arcX", "arcY", "labelX", "labelY", "text", "x", "kind", "HoverTooltips", "hoveredNodeData", "hoveredEdgeData", "ownLocation", "nodeOwnLocation", "hoveredEdgeText", "edgeHoverText", "d", "id", "walkRow", "locLabel", "NodeContextMenu", "nodeId", "top", "left", "onClose", "own", "reference", "highlight", "Menu", "callback", "Info_default", "nodeLaunchMenuItems", "target", "GraphCanvas", "ownChrome", "canvasRef", "canvas", "renderError", "retryRender", "useRenderingBackend", "createGraphRenderer", "handlers", "contextNode", "contextRow", "closeContextMenu", "usePaneGestures", "useWheelZoom", "faceted", "GraphToolbar_default", "FacetPanels_default", "TubeMapOverlay_default", "ReferenceStripOverlay_default", "BubbleHalos_default", "GenePins_default", "LabelLayer_default", "WalkRowsOverlay_default", "WalkStripLocator_default", "UnpopButton_default", "LoadingOverlay", "WalkStrip_default", "WalkRowContextMenu", "ErrorBanner", "GraphCanvas_default"]
7
+ }