jbrowse-plugin-graphgenomeviewer 4.0.7 → 4.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +26 -43
  2. package/dist/chunks/AddTrackWorkflow-LRRSAVSX.js +2 -0
  3. package/dist/chunks/{AddTrackWorkflow-J44PELJE.js.map → AddTrackWorkflow-LRRSAVSX.js.map} +1 -1
  4. package/dist/chunks/{GbzBaseSyntenyAdapter-BLSUE5LT.js → GbzBaseSyntenyAdapter-WI3VYEF2.js} +5 -5
  5. package/dist/chunks/{GbzBaseSyntenyAdapter-BLSUE5LT.js.map → GbzBaseSyntenyAdapter-WI3VYEF2.js.map} +4 -4
  6. package/dist/chunks/{GraphGenomeView-U4XVAEO3.js → GraphGenomeView-K5PZO33Q.js} +2 -2
  7. package/dist/chunks/{GraphGenomeView-U4XVAEO3.js.map → GraphGenomeView-K5PZO33Q.js.map} +1 -1
  8. package/dist/chunks/{GraphTrackSettingsDialog-6KKN5F3W.js → GraphTrackSettingsDialog-6STIFKVD.js} +2 -2
  9. package/dist/chunks/LinearGraphDisplay-3WQBA6ZX.js +2 -0
  10. package/dist/chunks/{LinearGraphDisplay-IBECRYKJ.js.map → LinearGraphDisplay-3WQBA6ZX.js.map} +2 -2
  11. package/dist/chunks/{chunk-N7EFSGPU.js → chunk-254OZVVL.js} +2 -2
  12. package/dist/chunks/chunk-5TBIQWPH.js +4 -0
  13. package/dist/chunks/chunk-5TBIQWPH.js.map +7 -0
  14. package/dist/chunks/chunk-FCWXYIFC.js +2 -0
  15. package/dist/chunks/chunk-FCWXYIFC.js.map +7 -0
  16. package/dist/chunks/chunk-JVMMNMQG.js +2 -0
  17. package/dist/chunks/chunk-JVMMNMQG.js.map +7 -0
  18. package/dist/chunks/chunk-NBDRTXH2.js +2 -0
  19. package/dist/chunks/chunk-NBDRTXH2.js.map +7 -0
  20. package/dist/chunks/chunk-VXUVWSY5.js +2 -0
  21. package/dist/chunks/chunk-VXUVWSY5.js.map +7 -0
  22. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +2 -2
  23. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  24. package/package.json +3 -1
  25. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +45 -1
  26. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts +26 -114
  27. package/src/GbzBaseSyntenyAdapter/configSchema.ts +1 -1
  28. package/src/GbzBaseSyntenyAdapter/gbzWindow.ts +166 -0
  29. package/src/GraphAddTrackWorkflow/buildTrackConfig.test.ts +1 -1
  30. package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +1 -1
  31. package/src/GraphGenomeView/components/GraphCanvas.tsx +16 -3
  32. package/src/GraphGenomeView/components/TubeMapOverlay.tsx +70 -0
  33. package/src/GraphGenomeView/labelLayout.test.ts +1 -0
  34. package/src/GraphGenomeView/labelLayout.ts +18 -14
  35. package/src/GraphGenomeView/layout/tubeMapLayout.test.ts +95 -0
  36. package/src/GraphGenomeView/layout/tubeMapLayout.ts +276 -0
  37. package/src/GraphGenomeView/layoutModes.ts +27 -0
  38. package/src/GraphGenomeView/model.test.ts +3 -1
  39. package/src/GraphGenomeView/model.ts +114 -68
  40. package/src/GraphGenomeView/pipeline.ts +14 -5
  41. package/src/GraphGenomeView/renderPasses.bench.ts +1 -0
  42. package/src/GraphGenomeView/tubeMap/draw.ts +264 -0
  43. package/src/GraphGenomeView/tubeMap/frame.test.ts +59 -0
  44. package/src/GraphGenomeView/tubeMap/frame.ts +78 -0
  45. package/src/GraphGenomeView/tubeMap/warp.test.ts +58 -0
  46. package/src/GraphGenomeView/tubeMap/warp.ts +99 -0
  47. package/src/GraphGenomeView/types.ts +8 -4
  48. package/src/GraphGenomeView/viewport.ts +91 -0
  49. package/src/GraphTrack/index.ts +53 -0
  50. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +25 -37
  51. package/src/LinearGraphDisplay/components/LinearGraphDisplay.tsx +1 -1
  52. package/src/LinearGraphDisplay/index.ts +12 -9
  53. package/src/LinearGraphDisplay/model.ts +5 -1
  54. package/src/RgfaTabixAdapter/configSchema.ts +1 -1
  55. package/src/core.test.ts +86 -6
  56. package/src/core.ts +38 -0
  57. package/src/graphTrackDefaults/graphTrackDefaults.test.ts +58 -36
  58. package/src/graphTrackDefaults/index.ts +66 -29
  59. package/src/index.ts +2 -0
  60. package/src/launchFromGraph/launchTracks.ts +1 -2
  61. package/src/version.ts +1 -1
  62. package/dist/chunks/AddTrackWorkflow-J44PELJE.js +0 -2
  63. package/dist/chunks/LinearGraphDisplay-IBECRYKJ.js +0 -2
  64. package/dist/chunks/chunk-C6PIPNZS.js +0 -2
  65. package/dist/chunks/chunk-C6PIPNZS.js.map +0 -7
  66. package/dist/chunks/chunk-IVUTPSHP.js +0 -2
  67. package/dist/chunks/chunk-IVUTPSHP.js.map +0 -7
  68. package/dist/chunks/chunk-J2UKZSOC.js +0 -2
  69. package/dist/chunks/chunk-J2UKZSOC.js.map +0 -7
  70. package/dist/chunks/chunk-MT25CI4U.js +0 -4
  71. package/dist/chunks/chunk-MT25CI4U.js.map +0 -7
  72. /package/dist/chunks/{GraphTrackSettingsDialog-6KKN5F3W.js.map → GraphTrackSettingsDialog-6STIFKVD.js.map} +0 -0
  73. /package/dist/chunks/{chunk-N7EFSGPU.js.map → chunk-254OZVVL.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as x}from"./chunk-MT25CI4U.js";import"./chunk-J2UKZSOC.js";import"./chunk-ZNGDWZ6Z.js";import"./chunk-N7EFSGPU.js";import{G as L}from"./chunk-IVUTPSHP.js";import"./chunk-F4C3BEPV.js";import{a as s,b as g,c as v,d as G,e as B}from"./chunk-XEJ47DLD.js";import{b as a}from"./chunk-FY3BTKY4.js";var S=a(g(),1);var m=a(G(),1),n=a(v(),1),C=a(g(),1),P=a(L(),1),o=a(s(),1),I=(0,P.makeStyles)()({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}}),b=(0,C.observer)(function({model:e}){let{classes:r}=I();return e.isLoading?(0,o.jsxs)(n.Paper,{className:r.paper,"data-testid":"graph-genome-loading",children:[(0,o.jsxs)("div",{className:r.row,children:[(0,o.jsx)(m.LoadingEllipses,{variant:"h6",message:e.statusMessage}),(0,o.jsx)(n.Button,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),(0,o.jsx)(n.LinearProgress,{variant:"indeterminate"})]}):e.error?(0,o.jsx)(n.Paper,{className:r.paper,children:(0,o.jsx)(m.ErrorBanner,{error:e.error,onReset:()=>{e.retryLoad()}})}):(0,o.jsx)(n.Paper,{className:r.paper,"data-testid":"graph-genome-load-canceled",children:(0,o.jsxs)("div",{className:r.row,children:[(0,o.jsx)(n.Typography,{variant:"h6",children:"Loading canceled"}),(0,o.jsx)(n.Button,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),h=b;var M=a(B(),1),N=a(G(),1),i=a(v(),1),w=a(g(),1),E=a(L(),1),t=a(s(),1),k=`H VN:Z:1.0
1
+ import{a as x}from"./chunk-5TBIQWPH.js";import"./chunk-VXUVWSY5.js";import"./chunk-ZNGDWZ6Z.js";import"./chunk-FCWXYIFC.js";import"./chunk-254OZVVL.js";import{H as L}from"./chunk-NBDRTXH2.js";import"./chunk-F4C3BEPV.js";import{a as s,b as g,c as v,d as G,e as B}from"./chunk-XEJ47DLD.js";import{b as a}from"./chunk-FY3BTKY4.js";var S=a(g(),1);var m=a(G(),1),n=a(v(),1),C=a(g(),1),P=a(L(),1),o=a(s(),1),I=(0,P.makeStyles)()({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}}),b=(0,C.observer)(function({model:e}){let{classes:r}=I();return e.isLoading?(0,o.jsxs)(n.Paper,{className:r.paper,"data-testid":"graph-genome-loading",children:[(0,o.jsxs)("div",{className:r.row,children:[(0,o.jsx)(m.LoadingEllipses,{variant:"h6",message:e.statusMessage}),(0,o.jsx)(n.Button,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),(0,o.jsx)(n.LinearProgress,{variant:"indeterminate"})]}):e.error?(0,o.jsx)(n.Paper,{className:r.paper,children:(0,o.jsx)(m.ErrorBanner,{error:e.error,onReset:()=>{e.retryLoad()}})}):(0,o.jsx)(n.Paper,{className:r.paper,"data-testid":"graph-genome-load-canceled",children:(0,o.jsxs)("div",{className:r.row,children:[(0,o.jsx)(n.Typography,{variant:"h6",children:"Loading canceled"}),(0,o.jsx)(n.Button,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),h=b;var M=a(B(),1),N=a(G(),1),i=a(v(),1),w=a(g(),1),E=a(L(),1),t=a(s(),1),k=`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`,z=(0,E.makeStyles)()({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"}}),R=(0,w.observer)(function({model:e}){let{classes:r}=z(),[d,T]=(0,M.useState)("");function y(){d.trim()&&e.loadGFAFromLocation({uri:d,locationType:"UriLocation"})}function A(p){let c=p.target.files?.[0];c&&c.text().then(f=>e.loadGFA(f,c.name)).catch(f=>{e.setError(f)})}return(0,t.jsxs)(i.Paper,{className:r.paper,children:[(0,t.jsx)("div",{className:r.header,children:(0,t.jsx)(i.Typography,{variant:"h6",children:"Load a GFA graph"})}),(0,t.jsxs)("div",{className:r.column,children:[(0,t.jsxs)("div",{className:r.rowCenter,children:[(0,t.jsxs)(i.Button,{variant:"outlined",component:"label",size:"small",children:["Choose file",(0,t.jsx)("input",{type:"file",accept:".gfa,.gfa1,.gfa2",hidden:!0,onChange:p=>{A(p)}})]}),(0,t.jsx)(i.Typography,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),(0,t.jsxs)("div",{className:r.rowEnd,children:[(0,t.jsx)(i.TextField,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:d,onChange:p=>{T(p.target.value)},onKeyDown:p=>{p.key==="Enter"&&y()},className:r.flex1}),(0,t.jsx)(i.Button,{variant:"contained",onClick:()=>{y()},disabled:!d.trim(),children:"Open"})]})]}),(0,t.jsx)("div",{className:r.footer,children:(0,t.jsx)(i.Button,{size:"small",onClick:()=>{e.loadGFA(k,"Example graph")},children:"Load 4-node example"})}),e.error?(0,t.jsx)(N.ErrorBanner,{error:e.error}):null]})}),F=R;var l=a(s(),1),U=(0,S.observer)(function({model:e}){return e.hasGraph?(0,l.jsx)(x,{model:e}):e.canRetryLoad&&(e.error||e.loadCanceled)?(0,l.jsx)(h,{model:e}):(0,l.jsxs)(l.Fragment,{children:[e.isLoading?(0,l.jsx)(h,{model:e}):null,(0,l.jsx)("div",{hidden:e.isLoading,children:(0,l.jsx)(F,{model:e})})]})}),O=U;export{O as default};
10
- //# sourceMappingURL=GraphGenomeView-U4XVAEO3.js.map
10
+ //# sourceMappingURL=GraphGenomeView-K5PZO33Q.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/GraphGenomeView/components/GraphGenomeView.tsx", "../../src/GraphGenomeView/components/GraphLoadStatus.tsx", "../../src/GraphGenomeView/components/ImportForm.tsx"],
4
4
  "sourcesContent": ["import { observer } from 'mobx-react'\n\nimport GraphCanvas from './GraphCanvas'\nimport GraphLoadStatus from './GraphLoadStatus'\nimport ImportForm from './ImportForm'\n\nimport type { GraphPaneModel } from '../model'\n\nconst GraphGenomeView = observer(function GraphGenomeView({\n model,\n}: {\n model: GraphPaneModel\n}) {\n if (model.hasGraph) {\n return <GraphCanvas model={model} />\n }\n // A launched or restored view has a source of its own, so the import form\n // has nothing to offer it when that source fails\n if (model.canRetryLoad && (model.error || model.loadCanceled)) {\n return <GraphLoadStatus model={model} />\n }\n // Hidden rather than unmounted, so a typed URL survives a failed load\n return (\n <>\n {model.isLoading ? <GraphLoadStatus model={model} /> : null}\n <div hidden={model.isLoading}>\n <ImportForm model={model} />\n </div>\n </>\n )\n})\n\nexport default GraphGenomeView\n", "import { ErrorBanner, LoadingEllipses } from '@jbrowse/core/ui'\nimport { Button, LinearProgress, Paper, 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 paper: {\n padding: 16,\n margin: 8,\n maxWidth: 560,\n marginInline: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 8,\n },\n})\n\n// What a view with no graph on screen shows while its load runs, and after a\n// load of a source it can retry was canceled or failed.\nconst GraphLoadStatus = observer(function GraphLoadStatus({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n if (model.isLoading) {\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-loading\">\n <div className={classes.row}>\n <LoadingEllipses variant=\"h6\" message={model.statusMessage} />\n <Button\n size=\"small\"\n data-testid=\"graph-genome-cancel\"\n onClick={() => {\n model.cancelLoad()\n }}\n >\n Cancel\n </Button>\n </div>\n <LinearProgress variant=\"indeterminate\" />\n </Paper>\n )\n }\n if (model.error) {\n return (\n <Paper className={classes.paper}>\n <ErrorBanner\n error={model.error}\n onReset={() => {\n model.retryLoad()\n }}\n />\n </Paper>\n )\n }\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-load-canceled\">\n <div className={classes.row}>\n <Typography variant=\"h6\">Loading canceled</Typography>\n <Button\n variant=\"contained\"\n size=\"small\"\n data-testid=\"graph-genome-retry\"\n onClick={() => {\n model.retryLoad()\n }}\n >\n Retry\n </Button>\n </div>\n </Paper>\n )\n})\n\nexport default GraphLoadStatus\n", "import { useState } from 'react'\n\nimport { ErrorBanner } from '@jbrowse/core/ui'\nimport { Button, Paper, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst EXAMPLE_GFA = `H\\tVN:Z:1.0\nS\\t1\\tACGT\nS\\t2\\tGGCC\nS\\t3\\tTTAA\nS\\t4\\tCCGG\nL\\t1\\t+\\t2\\t+\\t0M\nL\\t1\\t+\\t3\\t+\\t0M\nL\\t2\\t+\\t4\\t+\\t0M\nL\\t3\\t+\\t4\\t+\\t0M`\n\nconst useStyles = makeStyles()({\n column: { display: 'flex', flexDirection: 'column', gap: 8 },\n rowEnd: { display: 'flex', gap: 8, alignItems: 'flex-end' },\n rowCenter: { display: 'flex', gap: 8, alignItems: 'center' },\n flex1: { flex: 1 },\n paper: { padding: 16, margin: 8, maxWidth: 560, marginInline: 'auto' },\n header: { marginBottom: 12 },\n footer: { marginTop: 12, display: 'flex', justifyContent: 'flex-end' },\n})\n\nconst ImportForm = observer(function ImportForm({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const [url, setUrl] = useState('')\n\n function handleUrlLoad() {\n if (url.trim()) {\n void model.loadGFAFromLocation({ uri: url, locationType: 'UriLocation' })\n }\n }\n\n function handleFileUpload(event: React.ChangeEvent<HTMLInputElement>) {\n const file = event.target.files?.[0]\n if (file) {\n file\n .text()\n .then(text => model.loadGFA(text, file.name))\n .catch((err: unknown) => {\n model.setError(err)\n })\n }\n }\n\n return (\n <Paper className={classes.paper}>\n <div className={classes.header}>\n <Typography variant=\"h6\">Load a GFA graph</Typography>\n </div>\n\n <div className={classes.column}>\n <div className={classes.rowCenter}>\n <Button variant=\"outlined\" component=\"label\" size=\"small\">\n Choose file\n <input\n type=\"file\"\n accept=\".gfa,.gfa1,.gfa2\"\n hidden\n onChange={event => {\n handleFileUpload(event)\n }}\n />\n </Button>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Whole-file GFA; best for small/medium graphs.\n </Typography>\n </div>\n\n <div className={classes.rowEnd}>\n <TextField\n size=\"small\"\n label=\"URL\"\n placeholder=\"https://example.com/graph.gfa\"\n value={url}\n onChange={e => {\n setUrl(e.target.value)\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n handleUrlLoad()\n }\n }}\n className={classes.flex1}\n />\n <Button\n variant=\"contained\"\n onClick={() => {\n handleUrlLoad()\n }}\n disabled={!url.trim()}\n >\n Open\n </Button>\n </div>\n </div>\n\n <div className={classes.footer}>\n <Button\n size=\"small\"\n onClick={() => {\n void model.loadGFA(EXAMPLE_GFA, 'Example graph')\n }}\n >\n Load 4-node example\n </Button>\n </div>\n\n {model.error ? <ErrorBanner error={model.error} /> : null}\n </Paper>\n )\n})\n\nexport default ImportForm\n"],
5
- "mappings": "4SAAA,IAAAA,EAAyB,SCAzB,IAAAC,EAA6C,SAC7CC,EAA0D,SAC1DC,EAAyB,SACzBC,EAA2B,SAiCnBC,EAAA,SA7BFC,KAAY,cAAW,EAAE,CAC7B,MAAO,CACL,QAAS,GACT,OAAQ,EACR,SAAU,IACV,aAAc,OACd,QAAS,OACT,cAAe,SACf,IAAK,EACP,EACA,IAAK,CACH,QAAS,OACT,WAAY,SACZ,eAAgB,gBAChB,IAAK,CACP,CACF,CAAC,EAIKC,KAAkB,YAAS,SAAyB,CACxD,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIH,EAAU,EAC9B,OAAIE,EA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,EAEG,CACD,OAAIA,EAAM,YACD,OAACC,EAAA,CAAY,MAAOD,EAAO,EAIhCA,EAAM,eAAiBA,EAAM,OAASA,EAAM,iBACvC,OAACE,EAAA,CAAgB,MAAOF,EAAO,KAItC,oBACG,UAAAA,EAAM,aAAY,OAACE,EAAA,CAAgB,MAAOF,EAAO,EAAK,QACvD,OAAC,OAAI,OAAQA,EAAM,UACjB,mBAACG,EAAA,CAAW,MAAOH,EAAO,EAC5B,GACF,CAEJ,CAAC,EAEMI,EAAQL",
6
6
  "names": ["import_mobx_react", "import_ui", "import_material", "import_mobx_react", "import_mui", "import_jsx_runtime", "useStyles", "GraphLoadStatus", "model", "classes", "GraphLoadStatus_default", "import_react", "import_ui", "import_material", "import_mobx_react", "import_mui", "import_jsx_runtime", "EXAMPLE_GFA", "useStyles", "ImportForm", "model", "classes", "url", "setUrl", "handleUrlLoad", "handleFileUpload", "event", "file", "text", "err", "e", "ImportForm_default", "import_jsx_runtime", "GraphGenomeView", "model", "GraphCanvas_default", "GraphLoadStatus_default", "ImportForm_default", "GraphGenomeView_default"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-N7EFSGPU.js";import{G as f}from"./chunk-IVUTPSHP.js";import"./chunk-F4C3BEPV.js";import{a as l,b as m,c as y,e as x}from"./chunk-XEJ47DLD.js";import{b as o}from"./chunk-FY3BTKY4.js";var a=o(y(),1),b=o(m(),1),S=o(f(),1),n=o(l(),1),L=(0,S.makeStyles)()({section:{marginBottom:24},formControl:{minWidth:200}}),w=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],k=(0,b.observer)(function({model:e}){let{classes:t}=L();return(0,n.jsxs)("div",{className:t.section,children:[(0,n.jsxs)(a.FormControl,{className:t.formControl,children:[(0,n.jsx)(a.InputLabel,{children:"Graph context"}),(0,n.jsx)(a.Select,{value:e.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:p=>{e.setSubgraphContext(p.target.value),e.cut()},children:w.map(({value:p,label:u})=>(0,n.jsx)(a.MenuItem,{value:p,children:u},p))})]}),(0,n.jsx)(a.Typography,{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."})]})}),v=k;var C=o(x(),1),d=o(y(),1),c=o(m(),1),G=o(f(),1),i=o(l(),1),T=(0,G.makeStyles)()({section:{marginBottom:24}});function M(r){let e=r.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t!=="");return e.length===0?void 0:e}var F=(0,c.observer)(function({model:e}){let[t,p]=(0,C.useState)(e.chosenHaplotypes?.join(", ")??""),u=()=>{let s=M(t)??[];s.join(`
1
+ import{a as g}from"./chunk-254OZVVL.js";import{H as f}from"./chunk-NBDRTXH2.js";import"./chunk-F4C3BEPV.js";import{a as l,b as m,c as y,e as x}from"./chunk-XEJ47DLD.js";import{b as o}from"./chunk-FY3BTKY4.js";var a=o(y(),1),b=o(m(),1),S=o(f(),1),n=o(l(),1),L=(0,S.makeStyles)()({section:{marginBottom:24},formControl:{minWidth:200}}),w=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],k=(0,b.observer)(function({model:e}){let{classes:t}=L();return(0,n.jsxs)("div",{className:t.section,children:[(0,n.jsxs)(a.FormControl,{className:t.formControl,children:[(0,n.jsx)(a.InputLabel,{children:"Graph context"}),(0,n.jsx)(a.Select,{value:e.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:p=>{e.setSubgraphContext(p.target.value),e.cut()},children:w.map(({value:p,label:u})=>(0,n.jsx)(a.MenuItem,{value:p,children:u},p))})]}),(0,n.jsx)(a.Typography,{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."})]})}),v=k;var C=o(x(),1),d=o(y(),1),c=o(m(),1),G=o(f(),1),i=o(l(),1),T=(0,G.makeStyles)()({section:{marginBottom:24}});function M(r){let e=r.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t!=="");return e.length===0?void 0:e}var F=(0,c.observer)(function({model:e}){let[t,p]=(0,C.useState)(e.chosenHaplotypes?.join(", ")??""),u=()=>{let s=M(t)??[];s.join(`
2
2
  `)===(e.chosenHaplotypes??[]).join(`
3
3
  `)||(e.setSubgraphHaplotypes(s),e.cut())};return(0,i.jsx)(d.TextField,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:t,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:s=>{p(s.target.value)},onBlur:()=>{u()},onKeyDown:s=>{s.key==="Enter"&&u()}})}),N=(0,c.observer)(function({model:e}){let{classes:t}=T();return e.adapterConfig.type==="GbzBaseSyntenyAdapter"?(0,i.jsxs)("div",{className:t.section,children:[(0,i.jsx)(F,{model:e},e.chosenHaplotypes?.join(",")??""),(0,i.jsx)(d.Typography,{variant:"caption",color:"text.secondary",children:"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}),H=N;var h=o(l(),1);function B({model:r,open:e,onClose:t}){return(0,h.jsxs)(g,{model:r,open:e,onClose:t,children:[(0,h.jsx)(v,{model:r}),(0,h.jsx)(H,{model:r})]})}export{B as default};
4
- //# sourceMappingURL=GraphTrackSettingsDialog-6KKN5F3W.js.map
4
+ //# sourceMappingURL=GraphTrackSettingsDialog-6STIFKVD.js.map
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-5TBIQWPH.js";import"./chunk-VXUVWSY5.js";import"./chunk-ZNGDWZ6Z.js";import"./chunk-FCWXYIFC.js";import"./chunk-254OZVVL.js";import"./chunk-NBDRTXH2.js";import"./chunk-F4C3BEPV.js";import{a as e,b as d}from"./chunk-XEJ47DLD.js";import{a as h,b as t}from"./chunk-FY3BTKY4.js";var p=h((l,o)=>{o.exports=JBrowseExports["@jbrowse/display-kit/DisplayChrome"]});var s=t(p(),1),n=t(d(),1);var r=t(e(),1),y=(0,n.observer)(function({model:a}){return(0,r.jsx)(s.DisplayStatusChrome,{model:a,phase:a.displayPhase,drawn:a.painted&&a.geometryPainted,testid:"linear-graph-display","data-layout":a.chosenLayoutMode,"data-cut-tier":a.cutTier,"data-recuts":a.recuts,"data-node-count":a.hasGraph?a.nodeCount:void 0,"data-loading":a.isLoading?"":void 0,style:{width:a.paneWidth,height:a.height,overflow:"hidden"},children:(0,r.jsx)(i,{model:a,ownChrome:!1})})}),c=y;export{c as default};
2
+ //# sourceMappingURL=LinearGraphDisplay-3WQBA6ZX.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["global-externals:@jbrowse/display-kit/DisplayChrome", "../../src/LinearGraphDisplay/components/LinearGraphDisplay.tsx"],
4
- "sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/display-kit/DisplayChrome\"];", "import { DisplayStatusChrome } from '@jbrowse/display-kit/DisplayChrome'\nimport { observer } from 'mobx-react'\n\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <DisplayStatusChrome\n model={model}\n phase={model.displayPhase}\n drawn={model.painted}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n <GraphCanvas model={model} ownChrome={false} />\n </DisplayStatusChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
5
- "mappings": "kRAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,oCAAoC,ICApE,IAAAC,EAAoC,SACpCC,EAAyB,SA4BnB,IAAAC,EAAA,SAtBAC,KAAqB,YAAS,SAA4B,CAC9D,MAAAC,CACF,EAEG,CACD,SACE,OAAC,uBACC,MAAOA,EACP,MAAOA,EAAM,aACb,MAAOA,EAAM,QACb,OAAO,uBACP,cAAaA,EAAM,iBACnB,gBAAeA,EAAM,QACrB,cAAaA,EAAM,OACnB,kBAAiBA,EAAM,SAAWA,EAAM,UAAY,OACpD,eAAcA,EAAM,UAAY,GAAK,OACrC,MAAO,CACL,MAAOA,EAAM,UACb,OAAQA,EAAM,OACd,SAAU,QACZ,EAEA,mBAACC,EAAA,CAAY,MAAOD,EAAO,UAAW,GAAO,EAC/C,CAEJ,CAAC,EAEME,EAAQH",
4
+ "sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/display-kit/DisplayChrome\"];", "import { DisplayStatusChrome } from '@jbrowse/display-kit/DisplayChrome'\nimport { observer } from 'mobx-react'\n\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <DisplayStatusChrome\n model={model}\n phase={model.displayPhase}\n drawn={model.painted && model.geometryPainted}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n <GraphCanvas model={model} ownChrome={false} />\n </DisplayStatusChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
5
+ "mappings": "8SAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,oCAAoC,ICApE,IAAAC,EAAoC,SACpCC,EAAyB,SA4BnB,IAAAC,EAAA,SAtBAC,KAAqB,YAAS,SAA4B,CAC9D,MAAAC,CACF,EAEG,CACD,SACE,OAAC,uBACC,MAAOA,EACP,MAAOA,EAAM,aACb,MAAOA,EAAM,SAAWA,EAAM,gBAC9B,OAAO,uBACP,cAAaA,EAAM,iBACnB,gBAAeA,EAAM,QACrB,cAAaA,EAAM,OACnB,kBAAiBA,EAAM,SAAWA,EAAM,UAAY,OACpD,eAAcA,EAAM,UAAY,GAAK,OACrC,MAAO,CACL,MAAOA,EAAM,UACb,OAAQA,EAAM,OACd,SAAU,QACZ,EAEA,mBAACC,EAAA,CAAY,MAAOD,EAAO,UAAW,GAAO,EAC/C,CAEJ,CAAC,EAEME,EAAQH",
6
6
  "names": ["require_DisplayChrome", "__commonJSMin", "exports", "module", "import_DisplayChrome", "import_mobx_react", "import_jsx_runtime", "LinearGraphDisplay", "model", "GraphCanvas_default", "LinearGraphDisplay_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{D as c,G as M,k as m,n as u,u as g}from"./chunk-IVUTPSHP.js";import{a as d,b as N,c as I,d as G}from"./chunk-XEJ47DLD.js";import{a as T,b as l}from"./chunk-FY3BTKY4.js";var b=T((D,y)=>{y.exports=JBrowseExports["@mui/material/Button"]});var C=l(G(),1),t=l(I(),1),f=l(b(),1),h=l(N(),1),k=l(M(),1);var e=l(d(),1),B=(0,k.makeStyles)()({section:{marginBottom:24},formControl:{minWidth:200}}),R=["Lowest","Low","Medium","High","Highest"],v=(0,h.observer)(function({model:s}){return s.hasGraph&&!s.usesLayoutEngine?(0,e.jsx)(t.Typography,{variant:"caption",color:"warning.main",children:"No effect on this layout: only the force-directed layout is drawn by the engine that reads this."}):null}),x=(0,h.observer)(function(s){let{model:o,open:S,onClose:p,children:L}=s,{classes:n}=B();return(0,e.jsxs)(C.Dialog,{open:S,onClose:p,title:"Graph settings",children:[(0,e.jsxs)(t.DialogContent,{children:[(0,e.jsx)("div",{className:n.section,children:(0,e.jsxs)(t.FormControl,{fullWidth:!0,children:[(0,e.jsx)(t.FormLabel,{component:"legend",children:"Layout quality"}),(0,e.jsx)(t.RadioGroup,{value:o.layoutQuality,onChange:a=>{let r=parseInt(a.target.value);o.setLayoutQuality(r),o.recomputeLayout()},children:R.map((a,r)=>(0,e.jsx)(t.FormControlLabel,{value:r,control:(0,e.jsx)(t.Radio,{}),label:a},a))}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"FMMM's iteration budget, the same scale Bandage exposes. Higher is slower: on a thousand-node cut the top setting is seconds rather than tenths."}),(0,e.jsx)(v,{model:o})]})}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.drawPaths,onChange:a=>{o.setDrawPaths(a.target.checked)}}),label:"Draw paths"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Color each node and connector by the paths through it, one lane per path in legend order, so a path that skips a node leaves its lane empty"}),o.drawPaths&&!o.effectiveDrawPaths?(0,e.jsx)(t.Typography,{variant:"caption",color:"warning.main",children:o.pathCount>c?`Off: ${o.pathCount.toLocaleString()} paths is past the ${c} this can tell apart`:"Off: this graph states no paths"}):null]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.showBubbles,onChange:a=>{o.setShowBubbles(a.target.checked)}}),label:"Mark bubbles"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"A halo along the nodes of each bubble, labelled by what it is, with the label opening the bubble on its own"})]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.showGenes,onChange:a=>{o.setShowGenes(a.target.checked)}}),label:"Genes on the backbone"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Exons along the reference nodes that carry them and each gene's name at its midpoint, from the assembly's annotation track"}),o.geneTrackChoices.length>1?(0,e.jsxs)(t.FormControl,{className:n.formControl,sx:{mt:1},children:[(0,e.jsx)(t.InputLabel,{children:"Gene track"}),(0,e.jsx)(t.Select,{value:o.geneTrack?.trackId??"",label:"Gene track","data-testid":"graph-gene-track-select",onChange:a=>{o.setGeneTrackId(a.target.value),o.reloadGenes()},children:o.geneTrackChoices.map(({trackId:a,name:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]}):null,o.repeatTrackChoices.length>1?(0,e.jsxs)(t.FormControl,{className:n.formControl,sx:{mt:1},children:[(0,e.jsx)(t.InputLabel,{children:"Repeat track"}),(0,e.jsx)(t.Select,{value:o.repeatTrack?.trackId??"",label:"Repeat track","data-testid":"graph-repeat-track-select",onChange:a=>{o.setRepeatTrackId(a.target.value),o.reloadRepeats()},children:o.repeatTrackChoices.map(({trackId:a,name:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]}):null]}),o.anchorPaths.length>1?(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Reference path"}),(0,e.jsx)(t.Select,{value:o.activeReferencePath??"",label:"Reference path","data-testid":"graph-reference-path-select",onChange:a=>{o.setReferencePath(a.target.value),o.recomputeLayout()},children:o.anchorPaths.map(({name:a})=>(0,e.jsx)(t.MenuItem,{value:a,children:a},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Which path the anchored layouts draw x against. A GFA with no rGFA tags states its coordinates only in its paths, and marks none of them as the reference."})]}):null,(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Bubble spread"}),(0,e.jsx)(t.Select,{value:o.bubbleSpread,label:"Bubble spread","data-testid":"graph-bubble-spread-select",onChange:a=>{o.setBubbleSpread(a.target.value),o.recomputeLayout()},children:m.map(({value:a,label:r,description:i})=>(0,e.jsx)(t.MenuItem,{value:a,children:(0,e.jsx)(t.Tooltip,{title:i,placement:"right",children:(0,e.jsx)("span",{children:r})})},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"How far the force layout opens a bubble. A pangenome allele is a few bp, so at Bandage's own scale both arms land inside one node thickness and the graph draws as a rope."}),(0,e.jsx)(v,{model:o})]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Node width"}),(0,e.jsx)(t.Select,{value:o.nodeWidth,label:"Node width","data-testid":"graph-node-width-select",onChange:a=>{o.setNodeWidth(a.target.value)},children:g.map(({value:a,label:r,description:i})=>(0,e.jsx)(t.MenuItem,{value:a,children:(0,e.jsx)(t.Tooltip,{title:i,placement:"right",children:(0,e.jsx)("span",{children:r})})},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Bandage's depth as width. In a cut with walks, depth is how many haplotypes carry the node."})]}),L,(0,e.jsx)("div",{className:n.section,children:(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Color scheme"}),(0,e.jsx)(t.Select,{value:o.chosenColorScheme,label:"Color scheme",onChange:a=>{o.setColorScheme(a.target.value)},children:u.map(({value:a,label:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]})})]}),(0,e.jsx)(t.DialogActions,{children:(0,e.jsx)(f.default,{variant:"contained",color:"primary",onClick:p,children:"Close"})})]})}),O=x;export{O as a};
2
- //# sourceMappingURL=chunk-N7EFSGPU.js.map
1
+ import{C as g,H as M,k as m,n as u,y as c}from"./chunk-NBDRTXH2.js";import{a as d,b as N,c as I,d as G}from"./chunk-XEJ47DLD.js";import{a as T,b as l}from"./chunk-FY3BTKY4.js";var b=T((D,y)=>{y.exports=JBrowseExports["@mui/material/Button"]});var C=l(G(),1),t=l(I(),1),f=l(b(),1),h=l(N(),1),k=l(M(),1);var e=l(d(),1),B=(0,k.makeStyles)()({section:{marginBottom:24},formControl:{minWidth:200}}),R=["Lowest","Low","Medium","High","Highest"],v=(0,h.observer)(function({model:s}){return s.hasGraph&&!s.usesLayoutEngine?(0,e.jsx)(t.Typography,{variant:"caption",color:"warning.main",children:"No effect on this layout: only the force-directed layout is drawn by the engine that reads this."}):null}),x=(0,h.observer)(function(s){let{model:o,open:S,onClose:p,children:L}=s,{classes:n}=B();return(0,e.jsxs)(C.Dialog,{open:S,onClose:p,title:"Graph settings",children:[(0,e.jsxs)(t.DialogContent,{children:[(0,e.jsx)("div",{className:n.section,children:(0,e.jsxs)(t.FormControl,{fullWidth:!0,children:[(0,e.jsx)(t.FormLabel,{component:"legend",children:"Layout quality"}),(0,e.jsx)(t.RadioGroup,{value:o.layoutQuality,onChange:a=>{let r=parseInt(a.target.value);o.setLayoutQuality(r),o.recomputeLayout()},children:R.map((a,r)=>(0,e.jsx)(t.FormControlLabel,{value:r,control:(0,e.jsx)(t.Radio,{}),label:a},a))}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"FMMM's iteration budget, the same scale Bandage exposes. Higher is slower: on a thousand-node cut the top setting is seconds rather than tenths."}),(0,e.jsx)(v,{model:o})]})}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.drawPaths,onChange:a=>{o.setDrawPaths(a.target.checked)}}),label:"Draw paths"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Color each node and connector by the paths through it, one lane per path in legend order, so a path that skips a node leaves its lane empty"}),o.drawPaths&&!o.effectiveDrawPaths?(0,e.jsx)(t.Typography,{variant:"caption",color:"warning.main",children:o.pathCount>c?`Off: ${o.pathCount.toLocaleString()} paths is past the ${c} this can tell apart`:"Off: this graph states no paths"}):null]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.showBubbles,onChange:a=>{o.setShowBubbles(a.target.checked)}}),label:"Mark bubbles"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"A halo along the nodes of each bubble, labelled by what it is, with the label opening the bubble on its own"})]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsx)(t.FormControlLabel,{control:(0,e.jsx)(t.Switch,{checked:o.showGenes,onChange:a=>{o.setShowGenes(a.target.checked)}}),label:"Genes on the backbone"}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Exons along the reference nodes that carry them and each gene's name at its midpoint, from the assembly's annotation track"}),o.geneTrackChoices.length>1?(0,e.jsxs)(t.FormControl,{className:n.formControl,sx:{mt:1},children:[(0,e.jsx)(t.InputLabel,{children:"Gene track"}),(0,e.jsx)(t.Select,{value:o.geneTrack?.trackId??"",label:"Gene track","data-testid":"graph-gene-track-select",onChange:a=>{o.setGeneTrackId(a.target.value),o.reloadGenes()},children:o.geneTrackChoices.map(({trackId:a,name:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]}):null,o.repeatTrackChoices.length>1?(0,e.jsxs)(t.FormControl,{className:n.formControl,sx:{mt:1},children:[(0,e.jsx)(t.InputLabel,{children:"Repeat track"}),(0,e.jsx)(t.Select,{value:o.repeatTrack?.trackId??"",label:"Repeat track","data-testid":"graph-repeat-track-select",onChange:a=>{o.setRepeatTrackId(a.target.value),o.reloadRepeats()},children:o.repeatTrackChoices.map(({trackId:a,name:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]}):null]}),o.anchorPaths.length>1?(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Reference path"}),(0,e.jsx)(t.Select,{value:o.activeReferencePath??"",label:"Reference path","data-testid":"graph-reference-path-select",onChange:a=>{o.setReferencePath(a.target.value),o.recomputeLayout()},children:o.anchorPaths.map(({name:a})=>(0,e.jsx)(t.MenuItem,{value:a,children:a},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Which path the anchored layouts draw x against. A GFA with no rGFA tags states its coordinates only in its paths, and marks none of them as the reference."})]}):null,(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Bubble spread"}),(0,e.jsx)(t.Select,{value:o.bubbleSpread,label:"Bubble spread","data-testid":"graph-bubble-spread-select",onChange:a=>{o.setBubbleSpread(a.target.value),o.recomputeLayout()},children:m.map(({value:a,label:r,description:i})=>(0,e.jsx)(t.MenuItem,{value:a,children:(0,e.jsx)(t.Tooltip,{title:i,placement:"right",children:(0,e.jsx)("span",{children:r})})},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"How far the force layout opens a bubble. A pangenome allele is a few bp, so at Bandage's own scale both arms land inside one node thickness and the graph draws as a rope."}),(0,e.jsx)(v,{model:o})]}),(0,e.jsxs)("div",{className:n.section,children:[(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Node width"}),(0,e.jsx)(t.Select,{value:o.nodeWidth,label:"Node width","data-testid":"graph-node-width-select",onChange:a=>{o.setNodeWidth(a.target.value)},children:g.map(({value:a,label:r,description:i})=>(0,e.jsx)(t.MenuItem,{value:a,children:(0,e.jsx)(t.Tooltip,{title:i,placement:"right",children:(0,e.jsx)("span",{children:r})})},a))})]}),(0,e.jsx)(t.Typography,{variant:"caption",color:"text.secondary",children:"Bandage's depth as width. In a cut with walks, depth is how many haplotypes carry the node."})]}),L,(0,e.jsx)("div",{className:n.section,children:(0,e.jsxs)(t.FormControl,{className:n.formControl,children:[(0,e.jsx)(t.InputLabel,{children:"Color scheme"}),(0,e.jsx)(t.Select,{value:o.chosenColorScheme,label:"Color scheme",onChange:a=>{o.setColorScheme(a.target.value)},children:u.map(({value:a,label:r})=>(0,e.jsx)(t.MenuItem,{value:a,children:r},a))})]})})]}),(0,e.jsx)(t.DialogActions,{children:(0,e.jsx)(f.default,{variant:"contained",color:"primary",onClick:p,children:"Close"})})]})}),O=x;export{O as a};
2
+ //# sourceMappingURL=chunk-254OZVVL.js.map
@@ -0,0 +1,4 @@
1
+ import{B as Ye,F as le,G as _e,H as Oe,M as We,N as Ae,S as De,U as Fe,V as Ve,a as B,b as xn,c as Mn,d as Ne,g as A,k as Ge,l as Be,m as Me,n as ie,t as Xe,u as $e,v as Se}from"./chunk-VXUVWSY5.js";import{a as vn}from"./chunk-FCWXYIFC.js";import{a as Ze}from"./chunk-254OZVVL.js";import{H as Q,n as ze}from"./chunk-NBDRTXH2.js";import{a as M,b as H,c as j,d as He,e as xe}from"./chunk-XEJ47DLD.js";import{a as Te,b as d}from"./chunk-FY3BTKY4.js";var Ue=Te((Bo,Ke)=>{Ke.exports=JBrowseExports["@jbrowse/render-core/useRenderingBackend"]});var Qt=Te((zr,Jt)=>{Jt.exports=JBrowseExports["@jbrowse/render-core/renderingBackendBase"]});var z=d(xe(),1),J=d(He(),1),gn=d(vn(),1),bn=d(Ue(),1);var qe=d(M(),1),je=(0,B.createSvgIcon)((0,qe.jsx)("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 Y=d(H(),1);var Je=d(H(),1);var ce=d(M(),1),Sn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:2},kn=(0,Je.observer)(function({model:e}){let{bubbleHalos:t,walkHighlight:n}=e;if(t.length===0)return null;let{scaleX:o,scaleY:s,translateX:a,translateY:p,paneWidth:c,canvasHeight:i}=e,u=e.contigThickness*$e,l=m=>n!==void 0&&!m.nodeIds.some(y=>n.nodeIds.has(y));return(0,ce.jsx)("svg",{style:Sn,width:c,height:i,"data-testid":"graph-bubble-halos",children:(0,ce.jsx)("g",{transform:`translate(${a} ${p}) scale(${o} ${s})`,children:t.filter(m=>!m.whole).map(m=>(0,ce.jsx)("path",{d:m.path,fill:"none",stroke:A[m.kind],strokeOpacity:l(m)?.06:.22,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`${m.bubble.start}-${m.bubble.end}`))})})}),Qe=kn;var tt=d(j(),1),nt=d(H(),1);var N=d(M(),1),Cn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:3},wn={position:"absolute",left:8,top:8,zIndex:5,background:"rgba(255,255,255,0.9)",textTransform:"none"},Ln=10;function et(r,e){let t=12+26*Math.log10(1+r);return Math.min(t,e)}var En=(0,nt.observer)(function({model:e}){let{bubbleGlyphs:t,poppedFrom:n}=e,o=n?(0,N.jsxs)(tt.Button,{size:"small",variant:"outlined",style:wn,"data-testid":"graph-unpop-bubble",onClick:()=>{e.unpopBubble()},children:["\u25C0 Back to ",n.label]}):null;if(t.length===0)return o;let{scaleX:s,translateX:a,translateY:p,paneWidth:c,canvasHeight:i}=e,u=p,l=f=>f*s+a,m=e.overlayLabels.glyphs,y=Math.max(0,...m.map(f=>f.y+4)),v=Math.max(24,u-y-14),b=[...t].sort((f,S)=>S.bubble.end-S.bubble.start-(f.bubble.end-f.bubble.start));return(0,N.jsxs)(N.Fragment,{children:[o,(0,N.jsxs)("svg",{style:Cn,width:c,height:i,"data-testid":"graph-bubble-overlay",children:[b.map(({bubble:f,kind:S,label:P})=>{let L=l(f.start),E=l(f.end),x=Math.max(E-L,Ln),R=(L+E)/2,G=et(f.longestAlleleLength,v),g=A[S],I=f.end-f.start-f.shortestAlleleLength,C=I>0?6+10*Math.log10(1+I):0,q=`${f.start}-${f.end}`;return(0,N.jsxs)("g",{children:[(0,N.jsx)("path",{d:`M${R-x/2},${u} C${R-x/2},${u-G} ${R+x/2},${u-G} ${R+x/2},${u} Z`,fill:g,fillOpacity:.18,stroke:g,strokeWidth:2,style:{pointerEvents:"auto",cursor:"pointer"},onClick:()=>{e.popBubble(f)},children:(0,N.jsx)("title",{children:`${P}
2
+ ${f.segmentCount} segments \xB7 click to open`})}),C>0?(0,N.jsx)("path",{d:`M${R-x/2},${u} C${R-x/2},${u+C} ${R+x/2},${u+C} ${R+x/2},${u}`,fill:"none",stroke:g,strokeWidth:2,strokeDasharray:"4 3"}):null]},q)}),m.map(({item:{glyph:f,glyphX:S},x:P,y:L})=>{let E=A[f.kind],x=u-et(f.bubble.longestAlleleLength,v);return(0,N.jsxs)("g",{children:[(0,N.jsx)("line",{x1:S,x2:S,y1:L+4,y2:x-2,stroke:E,strokeWidth:.7,strokeOpacity:.5}),(0,N.jsx)("text",{x:P,y:L,fontSize:11,fontFamily:"sans-serif",fill:E,textAnchor:"middle",children:f.label})]},`${f.bubble.start}-${f.bubble.end}-label`)})]})]})}),ot=En;var rt=d(H(),1),de=d(M(),1),Rn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:2},pe="#1c1c22",In=(0,rt.observer)(function({model:e}){let{genePins:t}=e;if(t.length===0)return null;let{scaleX:n,scaleY:o,translateX:s,translateY:a,paneWidth:p,canvasHeight:c,contigThickness:i}=e;return(0,de.jsx)("svg",{style:Rn,width:p,height:c,"data-testid":"graph-gene-pins",children:(0,de.jsx)("g",{transform:`translate(${s} ${a}) scale(${n} ${o})`,children:t.map(u=>u.exons?(0,de.jsx)("path",{d:u.exons,fill:"none",stroke:pe,strokeOpacity:.9,strokeWidth:i*.55,strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`${u.gene.name}-${u.gene.start}`):null)})})}),st=In;var at=d(M(),1),it=(0,B.createSvgIcon)((0,at.jsx)("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 ke=d(M(),1),lt=(0,B.createSvgIcon)([(0,ke.jsx)("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"),(0,ke.jsx)("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var ct=d(M(),1),ut=(0,B.createSvgIcon)((0,ct.jsx)("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 $=d(j(),1),Ee=d(H(),1),Gt=d(Q(),1);var D=d(j(),1),dt=d(H(),1),pt=d(Q(),1);var ee=d(M(),1),Pn=(0,pt.makeStyles)()({formControl:{minWidth:100}}),Tn=(0,dt.observer)(function({model:e}){let{classes:t}=Pn();return(0,ee.jsxs)(D.FormControl,{size:"small",className:t.formControl,children:[(0,ee.jsx)(D.InputLabel,{children:"Color"}),(0,ee.jsx)(D.Select,{value:e.chosenColorScheme,label:"Color",onChange:n=>{e.setColorScheme(n.target.value)},children:ze.map(({value:n,label:o})=>(0,ee.jsx)(D.MenuItem,{value:n,children:o},n))})]})}),mt=Tn;var we=d(j(),1),Le=d(H(),1),ht=d(Q(),1),te=d(M(),1),ft=(0,ht.makeStyles)()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function Ce(r){return r===void 0?"\u2013":`${Math.round(r)}ms`}var Hn=(0,Le.observer)(function({model:e}){let{classes:t}=ft(),{lastFetchMs:n,lastLayoutMs:o,lastGeometryMs:s}=e,a=n!==void 0||o!==void 0||s!==void 0;return e.showPerf&&a?(0,te.jsxs)(we.Typography,{variant:"caption",className:t.perf,"data-testid":"graph-perf-stats",children:["fetch ",Ce(n)," \xB7 layout ",Ce(o)," \xB7 geom"," ",Ce(s)]}):null}),Nn=(0,Le.observer)(function({model:e}){let{classes:t}=ft();return(0,te.jsxs)("div",{className:t.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:[(0,te.jsxs)(we.Typography,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",(0,te.jsx)(Hn,{model:e})]})}),gt=Nn;var X=d(j(),1),bt=d(H(),1),yt=d(Q(),1);var F=d(M(),1),Gn=(0,yt.makeStyles)()({formControl:{minWidth:150}}),Bn=(0,bt.observer)(function({model:e}){let{classes:t}=Gn(),{graph:n}=e;return(0,F.jsxs)(X.FormControl,{size:"small",className:t.formControl,children:[(0,F.jsx)(X.InputLabel,{children:"Layout"}),(0,F.jsx)(X.Select,{value:e.chosenLayoutMode,label:"Layout","data-testid":"graph-layout-select",onChange:o=>{e.switchLayout(o.target.value)},children:Ye.map(({value:o,label:s,description:a,available:p})=>(0,F.jsx)(X.MenuItem,{value:o,disabled:n?!p(n):!1,children:(0,F.jsx)(X.Tooltip,{title:a,placement:"right",children:(0,F.jsx)("span",{children:s})})},o))})]})}),vt=Bn;var _=d(j(),1),xt=d(H(),1),Mt=d(Q(),1),V=d(M(),1),zn=(0,Mt.makeStyles)()({formControl:{minWidth:130,maxWidth:240}}),Xn=(0,xt.observer)(function({model:e}){let{classes:t}=zn(),{repeatChoices:n}=e;if(e.chosenLayoutMode!=="walkrows"||n.length===0)return null;let o=new Set(n.map(s=>s.key));return(0,V.jsxs)(_.FormControl,{size:"small",className:t.formControl,children:[(0,V.jsx)(_.InputLabel,{children:"Repeat"}),(0,V.jsxs)(_.Select,{value:o.has(e.repeatKey)?e.repeatKey:"",label:"Repeat","data-testid":"graph-repeat-select",onChange:s=>{e.setRepeatKey(s.target.value)},children:[(0,V.jsx)(_.MenuItem,{value:"",children:(0,V.jsx)("em",{children:"Whole window"})}),n.map(({key:s,name:a,unit:p})=>(0,V.jsxs)(_.MenuItem,{value:s,children:[a," \xB7 ",p.toLocaleString()," bp unit"]},s))]})]})}),St=Xn;var Et=d(xe(),1),Rt=d(He(),1);var kt=d(M(),1),Ct=(0,B.createSvgIcon)((0,kt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var wt=d(M(),1),Lt=(0,B.createSvgIcon)((0,wt.jsx)("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 It=d(H(),1);var Z=d(M(),1),$n=(0,It.observer)(function({model:e}){let[t,n]=(0,Et.useState)(!1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt.CascadingMenuButton,{size:"small",menuItems:[{type:"checkbox",label:"Linear layout",checked:e.linearLayout,onClick:()=>{e.setLinearLayout(!e.linearLayout),e.recomputeLayout()}},{type:"checkbox",label:"Show deletion edges",checked:e.showDeletionEdges,onClick:()=>{e.setShowDeletionEdges(!e.showDeletionEdges)}},{type:"checkbox",label:"Show timings",checked:e.showPerf,onClick:()=>{e.setShowPerf(!e.showPerf)}},{type:"divider"},{label:"Settings",icon:Ve,onClick:()=>{n(!0)}},{type:"divider"},{label:"Return to import form",icon:Ct,onClick:()=>{e.clearGraph()}}],children:(0,Z.jsx)(Lt,{})}),(0,Z.jsx)(Ze,{model:e,open:t,onClose:()=>{n(!1)}})]})}),Pt=$n;var O=d(j(),1),Tt=d(H(),1),Ht=d(Q(),1),K=d(M(),1),Yn=(0,Ht.makeStyles)()({formControl:{minWidth:130,maxWidth:220}}),_n=(0,Tt.observer)(function({model:e}){let{classes:t}=Yn(),{walkChoices:n}=e;if(n.length===0)return null;let o=new Set(n.map(s=>s.name));return(0,K.jsxs)(O.FormControl,{size:"small",className:t.formControl,children:[(0,K.jsx)(O.InputLabel,{children:"Walk"}),(0,K.jsxs)(O.Select,{value:o.has(e.highlightedPath)?e.highlightedPath:"",label:"Walk","data-testid":"graph-walk-select",onChange:s=>{e.setHighlightedPath(s.target.value)},children:[(0,K.jsx)(O.MenuItem,{value:"",children:(0,K.jsx)("em",{children:"None"})}),n.map(({name:s,label:a})=>(0,K.jsx)(O.MenuItem,{value:s,children:a},s))]})]})}),Nt=_n;var T=d(M(),1),On=(0,Gt.makeStyles)()({toolbar:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),Wn=(0,Ee.observer)(function({model:e}){return(0,T.jsx)($.Typography,{variant:"body2",children:e.zoomPercent})}),An=(0,Ee.observer)(function({model:e}){let{classes:t}=On();return(0,T.jsxs)("div",{className:t.toolbar,children:[(0,T.jsx)(vt,{model:e}),(0,T.jsx)(mt,{model:e}),(0,T.jsx)(Nt,{model:e}),(0,T.jsx)(St,{model:e}),(0,T.jsx)($.Tooltip,{title:"Zoom in",children:(0,T.jsx)($.IconButton,{size:"small",onClick:()=>{e.zoom(1.5,e.paneWidth/2,e.canvasHeight/2)},children:(0,T.jsx)(lt,{})})}),(0,T.jsx)($.Tooltip,{title:"Zoom out",children:(0,T.jsx)($.IconButton,{size:"small",onClick:()=>{e.zoom(1/1.5,e.paneWidth/2,e.canvasHeight/2)},children:(0,T.jsx)(ut,{})})}),(0,T.jsx)($.Tooltip,{title:"Zoom to fit",children:(0,T.jsx)($.IconButton,{size:"small",onClick:()=>{e.zoomToFit()},children:(0,T.jsx)(it,{})})}),(0,T.jsx)(Wn,{model:e}),(0,T.jsx)(gt,{model:e}),(0,T.jsx)(Pt,{model:e})]})}),Bt=An;var zt=d(H(),1);var oe=d(M(),1);function se({x:r,y:e,w:t,text:n,color:o,italic:s,small:a,dimmed:p,title:c,testId:i,onClick:u}){return(0,oe.jsxs)("g",{style:{pointerEvents:u?"auto":"none",cursor:u?"pointer":void 0,opacity:p?.35:1},"data-testid":i,onClick:u,children:[c?(0,oe.jsx)("title",{children:c}):null,(0,oe.jsx)("rect",{x:r-t/2,y:e-11-4+2,width:t,height:17,rx:3,fill:"rgba(255,255,255,0.85)",stroke:o,strokeWidth:a?.6:1}),(0,oe.jsx)("text",{x:r,y:e,fontSize:a?10:11,fontFamily:"sans-serif",fontStyle:s?"italic":void 0,fontWeight:s?600:void 0,fill:o,textAnchor:"middle",children:n})]})}var U=d(M(),1),Dn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:3},Fn=(0,zt.observer)(function({model:e}){let{bubbles:t,genes:n,routes:o}=e.overlayLabels;if(t.length+n.length+o.length===0)return null;let{walkHighlight:s,scaleY:a,translateY:p,contigThickness:c}=e,i=l=>s!==void 0&&!l.nodeIds.some(m=>s.nodeIds.has(m)),u=l=>s!==void 0&&!l.route.walks.includes(s.name);return(0,U.jsxs)("svg",{style:Dn,width:e.paneWidth,height:e.canvasHeight,"data-testid":"graph-label-layer",children:[n.map(({item:l,x:m,y,w:v,text:b})=>(0,U.jsxs)("g",{children:[(0,U.jsx)("line",{x1:m,x2:m,y1:y-11-2,y2:l.at.y*a+p+c/2,stroke:pe,strokeWidth:.8,strokeOpacity:.6}),(0,U.jsx)(se,{x:m,y,w:v,text:b,color:pe,italic:!0,title:`${l.gene.name} ${l.gene.refName}:${l.gene.start.toLocaleString()}-${l.gene.end.toLocaleString()}${l.covered<.98?", runs past the cut":""}`,testId:"graph-gene-pin-label"})]},`${l.gene.name}-${l.gene.start}`)),o.map(({item:{halo:l,route:m},x:y,y:v,w:b,text:f})=>(0,U.jsx)(se,{x:y,y:v,w:b,text:f,color:A[l.kind],small:!0,dimmed:u(m),title:`${m.route.walks.length} walk(s): ${m.route.walks.join(", ")}`,testId:"graph-route-label"},`${l.bubble.start}-${l.bubble.end}-${m.route.steps.join(",")}`)),t.map(({item:l,x:m,y,w:v,text:b})=>(0,U.jsx)(se,{x:m,y,w:v,text:b,color:A[l.kind],dimmed:i(l),title:`${l.label}
3
+ ${l.bubble.segmentCount} segments \xB7 click to open`,testId:"graph-bubble-halo-label",onClick:()=>{e.popBubble(l.bubble)}},`${l.bubble.start}-${l.bubble.end}`))]})}),Xt=Fn;var me=d(xe(),1),$t=d(Ne(),1),Yt=d(xn(),1),_t=d(H(),1);var Wt=d(M(),1),Vn={position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:1},Zn=(0,_t.observer)(function({model:e}){let t=(0,me.useRef)(null),{tubeMapPicture:n,paneWidth:o,canvasHeight:s}=e;return(0,me.useEffect)(()=>(0,Yt.autorun)(()=>{let a=t.current,p=e.tubeMapPicture,c=e.tubeMapFrame,i=a?.getContext("2d");if(a&&i&&p&&c){let u=(0,$t.getDpr)(),l=e.paneWidth,m=e.canvasHeight;a.width=Math.round(l*u),a.height=Math.round(m*u),i.setTransform(u,0,0,u,0,0),i.clearRect(0,0,l,m),We(i,p,{...c,width:l,highlightNode:e.hoveredNode??e.selectedNode,darkMode:e.darkMode})}}),[e]),(0,Wt.jsx)("canvas",{ref:t,"data-testid":n?"graph-tube-map":void 0,style:{...Vn,width:o,height:s,display:n?"block":"none"}})}),Ot=Zn;var Re=d(H(),1);var w=d(M(),1),jn={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:3},Dt="#2f8fd6",Ft="#111",Vt="#9e9e9e",Zt="#c62828",Kt="#8e3fbf",W=12,Jn={background:"rgba(255,255,255,0.82)",padding:"4px 6px",borderRadius:3,fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},ae={display:"flex",alignItems:"center",gap:5},he={width:18,height:W-4,borderRadius:2},Qn={...he,display:"flex",justifyContent:"center"};function At({color:r}){return(0,w.jsx)("div",{style:Qn,children:(0,w.jsx)("div",{style:{width:2,backgroundColor:r}})})}var Ut=(0,Re.observer)(function({model:e}){let t=e.walkRowBars;if(!t)return null;let n=t.rows.flatMap(o=>o.call??[]);return(0,w.jsxs)("div",{style:Jn,"data-testid":"graph-walk-rows-legend",children:[(0,w.jsxs)("div",{style:ae,children:[(0,w.jsx)("div",{style:{...he,backgroundColor:Dt}}),(0,w.jsxs)("span",{children:["sequence ",t.reference.label," also carries"]})]}),(0,w.jsxs)("div",{style:ae,children:[(0,w.jsx)("div",{style:{...he,backgroundColor:Kt}}),(0,w.jsx)("span",{children:"sequence it does not"})]}),n.some(o=>o.spanningReads!==0)?(0,w.jsxs)("div",{style:ae,children:[(0,w.jsx)(At,{color:Ft}),(0,w.jsx)("span",{children:"allele length called for this walk"})]}):null,n.some(o=>o.spanningReads===0)?(0,w.jsxs)("div",{style:ae,children:[(0,w.jsx)(At,{color:Vt}),(0,w.jsx)("span",{children:"called with no read spanning it"})]}):null,n.some(o=>o.agrees===!1)?(0,w.jsxs)("div",{style:ae,children:[(0,w.jsx)("div",{style:he}),(0,w.jsxs)("span",{style:{color:Zt},children:["walk and call over ",Math.round(.1*100),"% apart"]})]}):null]})});function fe(r){return`${(r/1e3).toFixed(r<1e4?1:0)} kb`}function qt(r,e){return e?` \u2248 ${Math.round(r/e)} units`:""}function eo(r,e,t,n){let o=r-e,s=o===0?"":` (${o>0?"+":"\u2212"}${fe(Math.abs(o))})`;return`${fe(r)}${qt(r,n)}${s}${t?"":" \xB7 partial walk"}`}function to(r){let e=r.spanningReads===0?" \xB7 no spanning read":"";return` \xB7 called ${fe(r.bp)}${e}`}var no=3;function oo(r,e,t){if(t(e)-t(0)<no)return[];let n=[];for(let o=e;o<r;o+=e)n.push(o);return n}var ro=(0,Re.observer)(function({model:e}){let{walkRowBars:t}=e;if(!t)return null;let{scaleX:n,scaleY:o,translateX:s,translateY:a,paneWidth:p,canvasHeight:c}=e,i=S=>S*n+s,u=S=>S*20*o+a,{origin:l,unit:m,reference:y,rows:v}=t,b=Math.max(l+y.bp,e.graphRegion?.end??0),f=(S,P,L,E="#333")=>{let x=i(P)+6,R=x+S.length*6.2<p;return(0,w.jsx)("text",{x:R?x:i(P)-6,y:L+4,fontSize:11,fontFamily:"sans-serif",fill:E,stroke:R?void 0:"white",strokeWidth:R?void 0:3,paintOrder:"stroke",textAnchor:R?"start":"end",children:S})};return(0,w.jsxs)("svg",{style:jn,width:p,height:c,"data-testid":"graph-walk-rows",children:[f(`${fe(y.bp)}${qt(y.bp,m)}`,b,u(0)),v.map((S,P)=>{let L=u(P+1);if(L<-W||L>c+W)return null;let{call:E}=S;return(0,w.jsxs)("g",{"data-testid":"graph-walk-row",children:[S.runs.map(x=>(0,w.jsx)("rect",{x:i(l+x.start),y:L-W/2,width:Math.max(1,x.bp*n),height:W,fill:x.onReference?Dt:Kt},x.start)),m?oo(S.bp,m,x=>x*n).map(x=>(0,w.jsx)("line",{x1:i(l+x),x2:i(l+x),y1:L-W/2,y2:L+W/2,stroke:"white",strokeWidth:1},x)):null,E?(0,w.jsx)("rect",{"data-testid":"graph-walk-call",x:i(l+E.bp)-1,y:L-W/2-3,width:2,height:W+6,fill:E.spanningReads===0?Vt:Ft}):null,f(`${eo(S.bp,y.bp,S.complete,m)}${E?to(E):""}`,l+S.bp,L,E?.agrees===!1?Zt:void 0)]},S.name)})]})}),jt=ro;var re=d(Mn(),1),en=d(Ne(),1),tn=d(Qt(),1);var be=class extends tn.Canvas2DRenderingBackendBase{constructor(){super(...arguments);this.transform=null;this.batch=null;this.nodeHighlights=new Map;this.highlightedEdge=null;this.highlightFactor=1}resize(t,n){(0,en.syncCanvasSize)(this.ctx.canvas,t,n)}uploadGeometry(t){this.batch=t,this.highlightedEdge=null}setNodeHighlights(t){this.nodeHighlights=t}setEdgeHighlight(t,n){this.highlightedEdge=t,this.highlightFactor=n}updateTransform(t){this.transform=t}render(t){if(!this.transform)return;let o=this.ctx,{width:s,height:a}=o.canvas;o.fillStyle=(0,re.normalizedRgbToCssRgba)([t[0],t[1],t[2]],t[3]),o.fillRect(0,0,s,a);let p=this.batch;p&&(o.lineCap="round",o.lineJoin="round",this.renderEdges(p),this.renderNodes(p),this.renderArrows(p))}renderEdges(t){let n=this.transform,o=this.ctx,s=this.highlightedEdge===null?void 0:t.edgeCurveRuns.get(this.highlightedEdge);for(let{color:a,items:p}of Ie(t.edgeCurves,(c,i)=>({color:ge(s,i)?le(c.color,this.highlightFactor):c.color,weight:c.thickness,last:ge(s,i)}))){o.strokeStyle=(0,re.abgrToCssRgba)(a),o.lineWidth=p[0].thickness*2*n.dpr,o.beginPath();for(let c of p){let i=c.curves[0];o.moveTo(i.x0*n.scaleX+n.translateX,i.y0*n.scaleY+n.translateY);for(let u of c.curves)o.bezierCurveTo(u.cx0*n.scaleX+n.translateX,u.cy0*n.scaleY+n.translateY,u.cx1*n.scaleX+n.translateX,u.cy1*n.scaleY+n.translateY,u.x1*n.scaleX+n.translateX,u.y1*n.scaleY+n.translateY)}o.stroke()}}renderNodes(t){let n=this.transform,o=this.ctx,s=new Map;for(let[a,p]of this.nodeHighlights){let c=t.nodeStrokeRuns.get(a);if(c)for(let i=c.start;i<c.start+c.count;i++)s.set(i,p)}for(let{color:a,items:p}of Ie(t.nodeStrokes,(c,i)=>{let u=s.get(i);return{color:u===void 0?c.color:le(c.color,u),weight:c.thickness,last:u!==void 0}})){o.strokeStyle=(0,re.abgrToCssRgba)(a),o.lineWidth=p[0].thickness*2*n.dpr,o.beginPath();for(let c of p){let i=c.points[0];o.moveTo(i.x*n.scaleX+n.translateX,i.y*n.scaleY+n.translateY);for(let u=1,l=c.points.length;u<l;u++){let m=c.points[u];o.lineTo(m.x*n.scaleX+n.translateX,m.y*n.scaleY+n.translateY)}}o.stroke()}}renderArrows(t){let n=this.transform,o=this.ctx,s=this.highlightedEdge===null?void 0:t.arrowRuns.get(this.highlightedEdge);for(let{color:a,items:p}of Ie(t.arrows,(c,i)=>({color:ge(s,i)?le(c.color,this.highlightFactor):c.color,weight:0,last:ge(s,i)}))){o.fillStyle=(0,re.abgrToCssRgba)(a),o.beginPath();for(let c of p){let i=c.x*n.scaleX+n.translateX,u=c.y*n.scaleY+n.translateY,l=c.size*n.dpr;o.moveTo(i,u),o.lineTo(i-Math.cos(c.angle-.5)*l,u-Math.sin(c.angle-.5)*l),o.lineTo(i-Math.cos(c.angle+.5)*l,u-Math.sin(c.angle+.5)*l),o.closePath()}o.fill()}}dispose(){super.dispose(),this.batch=null,this.nodeHighlights=new Map,this.highlightedEdge=null}};function ge(r,e){return r!==void 0&&e>=r.start&&e<r.start+r.count}function Ie(r,e){let t=new Map,n=new Map;for(let o=0,s=r.length;o<s;o++){let a=r[o],{color:p,weight:c,last:i}=e(a,o),u=i?n:t,l=`${p}:${c}`,m=u.get(l);m?m.items.push(a):u.set(l,{color:p,items:[a]})}return[...t.values(),...n.values()]}function nn(r){return Promise.resolve(new be(r))}var so=50;function on(r,e){return e>0?Math.max(1,r/e):so}function ao(r){let e=new Set,t=1/0,n=-1/0;for(let o of r)e.add(o.minY),t=Math.min(t,o.minY),n=Math.max(n,o.minY);return e.size>1?(n-t)/(e.size-1):void 0}function io(r,e,t){let n=on(e,r.length);return{x:n,y:t>0?on(t,r.length):ao(r)??n}}function rn(r,e,t,n){return r===void 0?io(e,t,n):typeof r=="number"?{x:r,y:r}:r}function lo(r,e,t){let n=r.get(e);n||(n=new Map,r.set(e,n));let o=n.get(t);return o||(o=[],n.set(t,o)),o}function sn(r,e,t,n,o,s,a){let p=Math.floor(t/e.x),c=Math.floor(o/e.x),i=Math.floor(n/e.y),u=Math.floor(s/e.y);for(let l=p;l<=c;l++)for(let m=i;m<=u;m++)lo(r,l,m).push(a)}function an(r,e,t,n,o,s){let a=Math.floor((t-o)/e.x),p=Math.floor((t+o)/e.x),c=Math.floor((n-s)/e.y),i=Math.floor((n+s)/e.y),u=[],l=new Set;for(let m=a;m<=p;m++){let y=r.get(m);if(y)for(let v=c;v<=i;v++){let b=y.get(v);if(b)for(let f of b)l.has(f)||(l.add(f),u.push(f))}}return u}var ye=class{constructor(e,t){this.cells=new Map;let n=[],o=0,s=0;for(let[a,p]of Object.entries(e))for(let c=0;c<p.length-1;c++){let i=p[c],u=p[c+1],l=Math.min(i.x,u.x),m=Math.min(i.y,u.y),y=Math.max(i.x,u.x),v=Math.max(i.y,u.y);o+=y-l,s+=v-m,n.push({entry:{nodeId:a,segmentIdx:c},minX:l,minY:m,maxX:y,maxY:v})}this.cellSize=rn(t,n,o,s);for(let a of n)sn(this.cells,this.cellSize,a.minX,a.minY,a.maxX,a.maxY,a.entry)}query(e,t,n,o=n){return an(this.cells,this.cellSize,e,t,n,o)}},ve=class{constructor(e,t,n,o,s,a,p=0){this.cells=new Map;this.edgeCurves=_e(e,t,o,a,p);let c=[],i=0,u=0;for(let l=0;l<t.edges.length;l++){let m=t.edges[l],y=e[m.from],v=e[m.to],b=this.edgeCurves.get(l);if(y?.length&&v?.length&&b){let{minX:f,minY:S,maxX:P,maxY:L}=Ge(b),E=m.pathIds?.length??0;if(n&&E>0){let x=0,R=0;for(let G of ie(y,v,E,o))x=Math.max(x,Math.abs(G.x)),R=Math.max(R,Math.abs(G.y));f-=x,S-=R,P+=x,L+=R}i+=P-f,u+=L-S,c.push({ei:l,minX:f,minY:S,maxX:P,maxY:L})}}this.cellSize=rn(s,c,i,u);for(let l of c)sn(this.cells,this.cellSize,l.minX,l.minY,l.maxX,l.maxY,l.ei)}getCurves(e){return this.edgeCurves.get(e)}query(e,t,n,o=n){return an(this.cells,this.cellSize,e,t,n,o)}};function dn(r,e,t,n,o,s){let a=o-t,p=s-n,c=a*a+p*p;if(c===0)return Math.hypot(r-t,e-n);let i=Math.max(0,Math.min(1,((r-t)*a+(e-n)*p)/c));return Math.hypot(r-(t+i*a),e-(n+i*p))}function co(r,e,t,n,o,s,a,p,c,i){let u=1/0,l=20,m=t,y=n;for(let v=1;v<=l;v++){let b=v/l,f=1-b,S=f*f*f*t+3*f*f*b*o+3*f*b*b*a+b*b*b*c,P=f*f*f*n+3*f*f*b*s+3*f*b*b*p+b*b*b*i;u=Math.min(u,dn(r,e,m,y,S,P)),m=S,y=P}return u}function uo(r,e,t){return co(r,e,t.x0,t.y0,t.cx0,t.cy0,t.cx1,t.cy1,t.x1,t.y1)}function ln(r,e,t,n=1){let o=1/0;for(let s of t){let a=uo(r,e,n===1?s:{x0:s.x0,y0:s.y0*n,cx0:s.cx0,cy0:s.cy0*n,cx1:s.cx1,cy1:s.cy1*n,x1:s.x1,y1:s.y1*n});a<o&&(o=a)}return o}var cn=new WeakMap;function po(r,e){let t=cn.get(r);if(t?.version===e)return t.index;let n=new ye(r);return cn.set(r,{version:e,index:n}),n}var un=new WeakMap;function mo(r,e,t,n,o,s){let a=un.get(r);if(a?.graph===e&&a.drawPaths===t&&a.scaleX===n.scaleX&&a.scaleY===n.scaleY&&a.version===o&&a.deletions===s)return a.index;let p=new ve(r,e,t,n,void 0,s,o);return un.set(r,{graph:e,drawPaths:t,scaleX:n.scaleX,scaleY:n.scaleY,version:o,index:p,deletions:s}),p}var ho=5;function pn(r,e,t,n,o=0,s){let a=Me(n),p=po(r,o),c=y=>Math.max(ho,y)/n.scaleX,i=c(s?.maxHalfWidthPx??0),u=p.query(e,t,i,i/a),l=null,m=1/0;for(let{nodeId:y,segmentIdx:v}of u){let b=r[y],f=dn(e,t*a,b[v].x,b[v].y*a,b[v+1].x,b[v+1].y*a);f<m&&f<c(s?.halfWidthPx(y)??0)&&(m=f,l=y)}return l}function mn(r,e,t,n,o,s,a=0,p,c){let i=Me(o),u=10/o.scaleX,l=mo(r,e,s,o,a,p),m=l.query(t,n,u,u/i),y=null,v=u;for(let b of m){let f=e.edges[b],S=r[f.from],P=r[f.to];if(!S?.length||!P?.length||c?.has(b))continue;let L=f.pathIds?.length??0,E=l.getCurves(b);if(!E)continue;let x;if(!s||L===0)x=ln(t,n*i,E,i);else{let R=1/0;for(let G of ie(S,P,L,o)){let g=G.x===0&&G.y===0?E:Be(E,G.x,G.y),k=ln(t,n*i,g,i);k<R&&(R=k)}x=R}x<v&&(v=x,y=b)}return y}function hn(r){let e=r.deltaY*(r.deltaMode===1?40:r.deltaMode===2?800:1),t=(r.ctrlKey?10:1)*e/100;return 1.1**-Math.max(-2,Math.min(2,t))}var h=d(M(),1),fn={position:"absolute",bottom:8,right:8,background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none"},fo={position:"relative"},go={position:"relative",lineHeight:0},bo={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},yo={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},vo=(0,Y.observer)(function({model:e}){let t=e.drawnRowLabels;return(0,h.jsx)(h.Fragment,{children:t.map(({label:n,y:o})=>{let s=o*e.scaleY+e.translateY;return s>=0&&s<=e.canvasHeight?(0,h.jsx)("div",{"data-testid":"graph-row-label",style:{...yo,top:s},children:n},o):null})})}),xo={position:"absolute",top:Se,right:Se,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none",zIndex:4},Pe={background:"rgba(255,255,255,0.82)",padding:"4px 6px",borderRadius:3,fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Mo={display:"flex",alignItems:"center",gap:5},So={width:18,height:3,borderRadius:2},ko=(0,Y.observer)(function({model:e}){let{pathLegend:t}=e;return t.length>0?(0,h.jsx)("div",{style:Pe,"data-testid":"graph-path-legend",children:t.map(({name:n,label:o,color:s})=>(0,h.jsxs)("div",{style:Mo,children:[(0,h.jsx)("div",{style:{...So,backgroundColor:s}}),(0,h.jsx)("span",{children:o})]},n))}):null}),Co=(0,Y.observer)(function({model:e}){let t=e.walkHighlight;if(!t)return null;let n=e.walkChoices.find(s=>s.name===t.name)?.label??t.name,o=t.referenceBp===void 0?"":t.bp===t.referenceBp?", the reference length":`, ${t.bp>t.referenceBp?"+":"\u2212"}${Math.abs(t.bp-t.referenceBp).toLocaleString()} bp against the reference`;return(0,h.jsxs)("div",{style:Pe,"data-testid":"graph-walk-readout",children:[(0,h.jsx)("strong",{children:n}),": ",t.steps.toLocaleString()," steps,"," ",t.bp.toLocaleString()," bp",o]})}),wo={minWidth:90,height:8,borderRadius:2,background:`linear-gradient(to right, ${Array.from({length:7},(r,e)=>`hsl(${e/6*Oe}, 70%, 50%) ${e/6*100}%`).join(", ")})`},Lo={display:"flex",justifyContent:"space-between",gap:8},Eo=(0,Y.observer)(function({model:e}){let t=e.referenceRampDomain;return t?(0,h.jsxs)("div",{style:Pe,"data-testid":"graph-ramp-legend",children:[(0,h.jsx)("div",{style:wo}),(0,h.jsxs)("div",{style:Lo,children:[(0,h.jsx)("span",{children:t.start.toLocaleString()}),(0,h.jsxs)("span",{children:["(",Xe(t.end-t.start),")"]}),(0,h.jsx)("span",{children:t.end.toLocaleString()})]})]}):null}),yn={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},Ro={...yn,color:"#18181c",fontWeight:600},Io={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:2},Po=(0,Y.observer)(function({model:e}){let t=(0,z.useRef)(null);return(0,z.useEffect)(()=>{let n=t.current;if(!n)return;let o=new ResizeObserver(()=>{(0,gn.isAlive)(e)&&e.setLegendSize({width:n.offsetWidth,height:n.offsetHeight})});return o.observe(n),()=>{o.disconnect()}},[e]),(0,h.jsxs)("div",{ref:t,style:xo,children:[(0,h.jsx)(Eo,{model:e}),(0,h.jsx)(ko,{model:e}),(0,h.jsx)(Ut,{model:e}),(0,h.jsx)(Co,{model:e})]})}),To=(0,Y.observer)(function({model:e}){let t=e.overlayLabels.sizes,n=t.flatMap(({key:o,leader:s})=>s?[{key:o,...s}]:[]);return(0,h.jsxs)(h.Fragment,{children:[n.length>0?(0,h.jsx)("svg",{style:Io,width:e.paneWidth,height:e.canvasHeight,children:n.map(({key:o,arcX:s,arcY:a,labelX:p,labelY:c})=>(0,h.jsx)("line",{"data-testid":"graph-label-leader",x1:s,y1:a,x2:p,y2:c,stroke:"#18181c",strokeWidth:1},o))}):null,t.map(({key:o,text:s,x:a,y:p,kind:c})=>(0,h.jsx)("div",{"data-testid":"graph-size-label",style:{...c==="deletion"?Ro:yn,left:a,top:p},children:s},o))]})}),Ho=(0,Y.observer)(function({model:e}){let t=e.hoveredNode?e.nodeById?.get(e.hoveredNode):null,n=e.hoveredEdge!==null&&e.graph?e.graph.edges[e.hoveredEdge]:null,o=t?Ae(t):void 0,s=e.hoveredEdge===null?void 0:e.deletions.find(a=>a.edgeIndex===e.hoveredEdge);return(0,h.jsxs)(h.Fragment,{children:[t?(0,h.jsxs)("div",{style:fn,children:[(0,h.jsx)("strong",{children:t.name})," \u2014 length:"," ",t.length.toLocaleString(),", depth:"," ",t.depth.toFixed(1),o?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("br",{}),o.sample," ",De(o)," (rank"," ",t.stable?.rank,")"]}):null]}):null,n?(0,h.jsx)("div",{style:fn,children:s?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("strong",{children:"Deletion"})," ",s.bp.toLocaleString()," bp",(0,h.jsx)("br",{}),s.refName,":",s.start.toLocaleString(),"-",s.end.toLocaleString()]}):(0,h.jsxs)(h.Fragment,{children:["Edge: ",n.from," \u2192 ",n.to]})}):null]})}),No=(0,Y.observer)(function({model:e,nodeId:t,top:n,left:o,onClose:s}){let{own:a,reference:p,highlight:c}=e.nodeLaunchTargets(t);return(0,h.jsx)(J.Menu,{open:!0,anchorReference:"anchorPosition",anchorPosition:{top:n,left:o},onClose:()=>{s()},onMenuItemClick:i=>{i()},menuItems:[{label:"Node details",icon:je,onClick:()=>{e.showNodeDetails(t)}},...Fe({own:a,reference:p,highlight:c,onShowLinear:i=>{e.showInLinearView(i)},onHighlight:e.canHighlightInLinearView?i=>{e.highlightInLinearView(i)}:void 0})]})}),Go=(0,Y.observer)(function({model:e,ownChrome:t=!0}){let{canvasRef:n,canvas:o,error:s,retry:a}=(0,bn.useRenderingBackend)(nn,e),p=(0,z.useRef)({x:0,y:0}),c=(0,z.useRef)(!1),i=(0,z.useRef)({frame:0,pan:null,hover:null});(0,z.useEffect)(()=>()=>{cancelAnimationFrame(i.current.frame)},[]);let[u,l]=(0,z.useState)(void 0);(0,z.useEffect)(()=>{if(o){let I=function(C){if(e.hostPlacesX)return;e.host&&C.stopPropagation(),C.preventDefault();let q=k.getBoundingClientRect();e.zoom(hn(C),C.clientX-q.left,C.clientY-q.top)};var g=I;let k=o;return k.addEventListener("wheel",I,{passive:!1}),()=>{k.removeEventListener("wheel",I)}}},[o,e]);function m(g,k){return{x:(g-e.translateX)/e.scaleX,y:(k-e.translateY)/e.scaleY}}function y(g){let k=g.currentTarget.getBoundingClientRect();return m(g.clientX-k.left,g.clientY-k.top)}function v(g,k){let{nodePositions:I}=e;return e.layoutResult?.tubeMap?e.tubeMapNodeAt(g*e.scaleX+e.translateX,k*e.scaleY+e.translateY):I?pn(I,g,k,e.axisScale,e.positionsVersion,e.nodeInk):null}function b(g){if(g.button===0){if(c.current=!1,e.hostPlacesX)return;e.host&&g.stopPropagation();let{x:k,y:I}=y(g),C=e.layoutResult?.tubeMap?null:v(k,I);C?e.setDraggingNode(C):e.setPanning(!0),p.current={x:g.clientX,y:g.clientY}}}function f(){let g=i.current;if(g.frame=0,g.pan&&(e.setTransform(e.scale,e.translateX+g.pan.dx,e.translateY+g.pan.dy),g.pan=null),g.hover&&e.nodePositions&&e.graph){let{x:k,y:I}=m(g.hover.x,g.hover.y);g.hover=null;let C=v(k,I);e.setHoveredNode(C),e.setHoveredEdge(C||e.layoutResult?.tubeMap?null:mn(e.nodePositions,e.graph,k,I,e.axisScale,e.effectiveDrawPaths,e.positionsVersion,e.deletionEdgeIndexes,e.hiddenEdgeIndexes))}}function S(){i.current.frame||(i.current.frame=requestAnimationFrame(f))}function P(){let g=i.current;cancelAnimationFrame(g.frame),g.frame=0,g.pan=null,g.hover=null}function L(g){let k=g.clientX-p.current.x,I=g.clientY-p.current.y;p.current={x:g.clientX,y:g.clientY},(Math.abs(k)>1||Math.abs(I)>1)&&(c.current=!0);let C=i.current;if(e.draggingNode)e.moveNode(e.draggingNode,k/e.scaleX,I/e.scaleY);else if(e.isPanning)C.pan={dx:(C.pan?.dx??0)+k,dy:(C.pan?.dy??0)+I},S();else{let q=g.currentTarget.getBoundingClientRect();C.hover={x:g.clientX-q.left,y:g.clientY-q.top},S()}}function E(){e.stopDragging()}function x(){P(),e.stopDragging(),e.setHoveredNode(null),e.setHoveredEdge(null)}function R(g){let{x:k,y:I}=y(g),C=v(k,I);C&&(g.preventDefault(),l({nodeId:C,top:g.clientY,left:g.clientX}))}function G(g){if(!c.current){let{x:k,y:I}=y(g),C=v(k,I);e.setSelectedNode(C),C&&e.showNodeDetails(C)}}return(0,h.jsxs)("div",{style:fo,children:[t?(0,h.jsx)(Bt,{model:e}):null,(0,h.jsxs)("div",{style:go,children:[(0,h.jsx)("canvas",{ref:n,"data-testid":"graph-genome-canvas",style:{width:e.paneWidth,height:e.canvasHeight,cursor:e.isPanning||e.draggingNode?"grabbing":"grab",display:"block"},onMouseDown:b,onMouseMove:L,onMouseUp:E,onMouseLeave:x,onClick:G,onContextMenu:R}),(0,h.jsx)(Ot,{model:e}),(0,h.jsx)(vo,{model:e}),(0,h.jsx)(To,{model:e}),(0,h.jsx)(Qe,{model:e}),(0,h.jsx)(st,{model:e}),(0,h.jsx)(Xt,{model:e}),(0,h.jsx)(ot,{model:e}),(0,h.jsx)(jt,{model:e}),(0,h.jsx)(Po,{model:e}),t?(0,h.jsx)("div",{style:bo,children:(0,h.jsx)(J.LoadingOverlay,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null]}),(0,h.jsx)(Ho,{model:e}),u?(0,h.jsx)(No,{model:e,nodeId:u.nodeId,top:u.top,left:u.left,onClose:()=>{l(void 0)}}):null,s?(0,h.jsx)(J.ErrorBanner,{error:s,onReset:a}):null,t&&e.error?(0,h.jsx)(J.ErrorBanner,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),us=Go;export{us as a};
4
+ //# sourceMappingURL=chunk-5TBIQWPH.js.map