jbrowse-plugin-graphgenomeviewer 6.3.1 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunks/AddTrackWorkflow-ANWIWCO6.js +2 -0
- package/dist/chunks/{AddTrackWorkflow-F5YBOJ3E.js.map → AddTrackWorkflow-ANWIWCO6.js.map} +1 -1
- package/dist/chunks/ChooseSamplesDialog-OYAB355I.js +2 -0
- package/dist/chunks/{ChooseSamplesDialog-KVTDIA4A.js.map → ChooseSamplesDialog-OYAB355I.js.map} +1 -1
- package/dist/chunks/ChooseWalksDialog-HJE4CAKU.js +2 -0
- package/dist/chunks/{ChooseWalksDialog-L6QKOT7M.js.map → ChooseWalksDialog-HJE4CAKU.js.map} +1 -1
- package/dist/chunks/{GraphGenomeView-VIKLXNQD.js → GraphGenomeView-ULQ6U5MK.js} +2 -2
- package/dist/chunks/{GraphGenomeView-VIKLXNQD.js.map → GraphGenomeView-ULQ6U5MK.js.map} +1 -1
- package/dist/chunks/GraphTrackSettingsDialog-O6IYVHNJ.js +4 -0
- package/dist/chunks/{GraphTrackSettingsDialog-MRMSH2FO.js.map → GraphTrackSettingsDialog-O6IYVHNJ.js.map} +1 -1
- package/dist/chunks/HighlightColorDialog-LXT72W7R.js +2 -0
- package/dist/chunks/{HighlightColorDialog-SABW5OMB.js.map → HighlightColorDialog-LXT72W7R.js.map} +1 -1
- package/dist/chunks/LinearGraphDisplay-KM5SOSQQ.js +2 -0
- package/dist/chunks/{LinearGraphDisplay-AHCKWNFJ.js.map → LinearGraphDisplay-KM5SOSQQ.js.map} +1 -1
- package/dist/chunks/TrackWarningsDialog-YL2UP35Z.js +2 -0
- package/dist/chunks/{TrackWarningsDialog-HPHM5S7U.js.map → TrackWarningsDialog-YL2UP35Z.js.map} +1 -1
- package/dist/chunks/chunk-64LZZURD.js +2 -0
- package/dist/chunks/chunk-64LZZURD.js.map +7 -0
- package/dist/chunks/chunk-7KFSWOWX.js +3 -0
- package/dist/chunks/chunk-7KFSWOWX.js.map +7 -0
- package/dist/chunks/chunk-AMD4KXQV.js +2 -0
- package/dist/chunks/chunk-AMD4KXQV.js.map +7 -0
- package/dist/chunks/chunk-GB7CF6Z2.js +2 -0
- package/dist/chunks/chunk-GB7CF6Z2.js.map +7 -0
- package/dist/chunks/chunk-GXQ7NYB3.js +2 -0
- package/dist/chunks/chunk-GXQ7NYB3.js.map +7 -0
- package/dist/chunks/chunk-NXZT63HN.js +2 -0
- package/dist/chunks/chunk-NXZT63HN.js.map +7 -0
- package/dist/chunks/chunk-PLV6SE4Y.js +2 -0
- package/dist/chunks/chunk-PLV6SE4Y.js.map +7 -0
- package/dist/chunks/chunk-X4DGSMS6.js +2 -0
- package/dist/chunks/{chunk-A6GKF63C.js.map → chunk-X4DGSMS6.js.map} +1 -1
- package/dist/chunks/renderSvg-J7L374ND.js +2 -0
- package/dist/chunks/renderSvg-J7L374ND.js.map +7 -0
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +6 -6
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +1 -1
- package/src/GraphGenomeView/components/PaneSvg.tsx +828 -0
- package/src/GraphGenomeView/components/ReferenceStripOverlay.tsx +23 -5
- package/src/GraphGenomeView/components/TubeMapOverlay.tsx +46 -35
- package/src/GraphGenomeView/model.test.ts +52 -0
- package/src/GraphGenomeView/pane/graphViews.ts +4 -0
- package/src/GraphGenomeView/pane/loadActions.ts +5 -2
- package/src/GraphGenomeView/pane/settingActions.ts +30 -12
- package/src/GraphGenomeView/viewModel.ts +16 -0
- package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +17 -0
- package/src/LinearGraphDisplay/model.ts +24 -1
- package/src/LinearGraphDisplay/renderSvg.tsx +27 -0
- package/src/version.ts +1 -1
- package/dist/chunks/AddTrackWorkflow-F5YBOJ3E.js +0 -2
- package/dist/chunks/ChooseSamplesDialog-KVTDIA4A.js +0 -2
- package/dist/chunks/ChooseWalksDialog-L6QKOT7M.js +0 -2
- package/dist/chunks/GraphTrackSettingsDialog-MRMSH2FO.js +0 -4
- package/dist/chunks/HighlightColorDialog-SABW5OMB.js +0 -2
- package/dist/chunks/LinearGraphDisplay-AHCKWNFJ.js +0 -2
- package/dist/chunks/TrackWarningsDialog-HPHM5S7U.js +0 -2
- package/dist/chunks/chunk-2SL675KP.js +0 -3
- package/dist/chunks/chunk-2SL675KP.js.map +0 -7
- package/dist/chunks/chunk-A6GKF63C.js +0 -2
- package/dist/chunks/chunk-B7KMMGFB.js +0 -2
- package/dist/chunks/chunk-B7KMMGFB.js.map +0 -7
- package/dist/chunks/chunk-TYJTJGPO.js +0 -2
- package/dist/chunks/chunk-TYJTJGPO.js.map +0 -7
package/README.md
CHANGED
|
@@ -53,8 +53,8 @@ node in the view bands its bp in the linear view:
|
|
|
53
53
|
thickness, walks lifted out as metro-map lanes or side by side, a panel per
|
|
54
54
|
walk or a row per sample, each shading from its start to its end
|
|
55
55
|
- GAF reads in the tube map, with their mismatches, from a gbz-base track
|
|
56
|
-
- Figures as SVG
|
|
57
|
-
with no browser
|
|
56
|
+
- Figures as SVG: the graph track in the linear view's Export SVG, the graph
|
|
57
|
+
genome view's own Export SVG, or a JSON spec with no browser
|
|
58
58
|
([docs/figures.md](https://github.com/GMOD/bandage-core/blob/main/docs/figures.md))
|
|
59
59
|
|
|
60
60
|
## Usage
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as W}from"./chunk-FCWXYIFC.js";import{b as F,c as T,i as y}from"./chunk-4T7DPQTR.js";import{a as N}from"./chunk-J4OLMLS5.js";import{a as O}from"./chunk-J6KYLXRD.js";import{a as B,b as _}from"./chunk-NXZT63HN.js";import{a as C,b as H}from"./chunk-64LZZURD.js";import{a as w,b as t}from"./chunk-FY3BTKY4.js";var S=w((q,L)=>{L.exports=JBrowseExports["@jbrowse/core/util/tss-react"]});var s=t(O(),1),i=t(B(),1),l=t(N(),1),A=t(S(),1),R=t(W(),1),e=t(_(),1),x=t(H(),1);var o=t(C(),1),j=(0,A.makeStyles)()(n=>({paper:{margin:n.spacing(),padding:n.spacing()},field:{marginTop:n.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),D=["RgfaTabixAdapter","MinigraphBubbleAdapter"],J=(0,x.observer)(function({model:r}){let{classes:c}=j(),h=(0,l.getSession)(r),b=(0,R.getRoot)(r),[m,G]=(0,s.useState)("RgfaTabixAdapter"),[p,v]=(0,s.useState)(),[g,P]=(0,s.useState)(),[u,I]=(0,s.useState)(""),[d,M]=(0,s.useState)("Pangenome graph"),[f,k]=(0,s.useState)();function E(){if(!(!p||!r.assembly))try{k(void 0);let a=d.trim();(0,l.addTrackFromWidget)({model:r,session:h,conf:y({choice:m,loc:p,indexLoc:g,assembly:r.assembly,sample:u,trackId:(0,l.makeTrackId)({name:a}),name:a})})}catch(a){k(a)}}return(0,o.jsxs)(e.Paper,{className:c.paper,children:[f?(0,o.jsx)(i.ErrorMessage,{error:f}):null,(0,o.jsxs)(e.FormControl,{children:[(0,o.jsx)(e.FormLabel,{children:"File type"}),(0,o.jsx)(e.RadioGroup,{value:m,onChange:a=>{G(a.target.value)},children:D.map(a=>(0,o.jsx)(e.FormControlLabel,{value:a,control:(0,o.jsx)(e.Radio,{}),label:F[a]},a))})]}),(0,o.jsx)(i.FileSelector,{location:p,name:T[m],rootModel:b,setLocation:v}),(0,o.jsx)(i.FileSelector,{location:g,name:"Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)",rootModel:b,setLocation:P}),(0,o.jsx)(e.TextField,{className:c.field,value:u,onChange:a=>{I(a.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:"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}),(0,o.jsx)(e.TextField,{className:c.field,value:d,helperText:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:a=>{M(a.target.value)}}),(0,o.jsx)(i.AssemblySelector,{session:h,helperText:"Select assembly to add track to",selected:r.assembly,onChange:a=>{r.setAssembly(a)},fullWidth:!0}),(0,o.jsx)(e.Button,{variant:"contained",className:c.submit,disabled:!p||!d.trim()||!r.assembly,onClick:E,children:"Submit"})]})}),K=J;export{K as default};
|
|
2
|
+
//# sourceMappingURL=AddTrackWorkflow-ANWIWCO6.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["global-externals:@jbrowse/core/util/tss-react", "../../src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx"],
|
|
4
4
|
"sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/core/util/tss-react\"];", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport { addTrackFromWidget, getSession, makeTrackId } from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot } from '@jbrowse/mobx-state-tree'\nimport {\n Button,\n FormControl,\n FormControlLabel,\n FormLabel,\n Paper,\n Radio,\n RadioGroup,\n TextField,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n GRAPH_FILE_FIELDS,\n GRAPH_FILE_LABELS,\n buildTrackConfig,\n} from './buildTrackConfig'\n\nimport type { GraphFileChoice } from './buildTrackConfig'\nimport type {\n AbstractRootModel,\n AddTrackWorkflowModel,\n FileLocation,\n} from '@jbrowse/core/util'\n\nconst useStyles = makeStyles()(theme => ({\n paper: {\n margin: theme.spacing(),\n padding: theme.spacing(),\n },\n field: {\n marginTop: theme.spacing(2),\n },\n submit: {\n marginTop: 25,\n marginBottom: 100,\n display: 'block',\n },\n}))\n\nconst CHOICES: GraphFileChoice[] = [\n 'RgfaTabixAdapter',\n 'MinigraphBubbleAdapter',\n]\n\nconst GraphAddTrackWidget = observer(function GraphAddTrackWidget({\n model,\n}: {\n model: AddTrackWorkflowModel\n}) {\n const { classes } = useStyles()\n const session = getSession(model)\n const rootModel = getRoot<AbstractRootModel>(model)\n const [choice, setChoice] = useState<GraphFileChoice>('RgfaTabixAdapter')\n const [loc, setLoc] = useState<FileLocation>()\n const [indexLoc, setIndexLoc] = useState<FileLocation>()\n const [sample, setSample] = useState('')\n const [trackName, setTrackName] = useState('Pangenome graph')\n const [error, setError] = useState<unknown>()\n\n function handleSubmit() {\n if (!loc || !model.assembly) {\n return\n }\n try {\n setError(undefined)\n const name = trackName.trim()\n addTrackFromWidget({\n model,\n session,\n conf: buildTrackConfig({\n choice,\n loc,\n indexLoc,\n assembly: model.assembly,\n sample,\n trackId: makeTrackId({ name }),\n name,\n }),\n })\n } catch (e) {\n setError(e)\n }\n }\n\n return (\n <Paper className={classes.paper}>\n {error ? <ErrorMessage error={error} /> : null}\n <FormControl>\n <FormLabel>File type</FormLabel>\n <RadioGroup\n value={choice}\n onChange={event => {\n setChoice(event.target.value as GraphFileChoice)\n }}\n >\n {CHOICES.map(option => (\n <FormControlLabel\n key={option}\n value={option}\n control={<Radio />}\n label={GRAPH_FILE_LABELS[option]}\n />\n ))}\n </RadioGroup>\n </FormControl>\n <FileSelector\n location={loc}\n name={GRAPH_FILE_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setLoc}\n />\n <FileSelector\n location={indexLoc}\n name=\"Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)\"\n rootModel={rootModel}\n setLocation={setIndexLoc}\n />\n <TextField\n className={classes.field}\n value={sample}\n onChange={event => {\n setSample(event.target.value)\n }}\n label=\"Sample name in the graph\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-sample-input' } }}\n helperText=\"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\"\n placeholder=\"GRCh38\"\n fullWidth\n />\n <TextField\n className={classes.field}\n value={trackName}\n helperText=\"Track name\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-track-name-input' } }}\n onChange={event => {\n setTrackName(event.target.value)\n }}\n />\n <AssemblySelector\n session={session}\n helperText=\"Select assembly to add track to\"\n selected={model.assembly}\n onChange={arg => {\n model.setAssembly(arg)\n }}\n fullWidth\n />\n <Button\n variant=\"contained\"\n className={classes.submit}\n disabled={!loc || !trackName.trim() || !model.assembly}\n onClick={handleSubmit}\n >\n Submit\n </Button>\n </Paper>\n )\n})\n\nexport default GraphAddTrackWidget\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "2TAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,8BAA8B,ICA9D,IAAAC,EAAyB,SAEzBC,EAA6D,SAC7DC,EAA4D,SAC5DC,EAA2B,SAC3BC,EAAwB,SACxBC,EASO,SACPC,EAAyB,SA6EV,IAAAC,EAAA,SA9DTC,KAAY,cAAW,EAAEC,IAAU,CACvC,MAAO,CACL,OAAQA,EAAM,QAAQ,EACtB,QAASA,EAAM,QAAQ,CACzB,EACA,MAAO,CACL,UAAWA,EAAM,QAAQ,CAAC,CAC5B,EACA,OAAQ,CACN,UAAW,GACX,aAAc,IACd,QAAS,OACX,CACF,EAAE,EAEIC,EAA6B,CACjC,mBACA,wBACF,EAEMC,KAAsB,YAAS,SAA6B,CAChE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIL,EAAU,EACxBM,KAAU,cAAWF,CAAK,EAC1BG,KAAY,WAA2BH,CAAK,EAC5C,CAACI,EAAQC,CAAS,KAAI,YAA0B,kBAAkB,EAClE,CAACC,EAAKC,CAAM,KAAI,YAAuB,EACvC,CAACC,EAAUC,CAAW,KAAI,YAAuB,EACjD,CAACC,EAAQC,CAAS,KAAI,YAAS,EAAE,EACjC,CAACC,EAAWC,CAAY,KAAI,YAAS,iBAAiB,EACtD,CAACC,EAAOC,CAAQ,KAAI,YAAkB,EAE5C,SAASC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ACA,OAAC,oBACC,QAASlB,EACT,WAAW,kCACX,SAAUF,EAAM,SAChB,SAAUwB,GAAO,CACfxB,EAAM,YAAYwB,CAAG,CACvB,EACA,UAAS,GACX,KACA,OAAC,UACC,QAAQ,YACR,UAAWvB,EAAQ,OACnB,SAAU,CAACK,GAAO,CAACM,EAAU,KAAK,GAAK,CAACZ,EAAM,SAC9C,QAASgB,EACV,kBAED,GACF,CAEJ,CAAC,EAEMS,EAAQ1B",
|
|
6
6
|
"names": ["require_tss_react", "__commonJSMin", "exports", "module", "import_react", "import_ui", "import_util", "import_tss_react", "import_mobx_state_tree", "import_material", "import_mobx_react", "import_jsx_runtime", "useStyles", "theme", "CHOICES", "GraphAddTrackWidget", "model", "classes", "session", "rootModel", "choice", "setChoice", "loc", "setLoc", "indexLoc", "setIndexLoc", "sample", "setSample", "trackName", "setTrackName", "error", "setError", "handleSubmit", "name", "buildTrackConfig", "e", "event", "option", "GRAPH_FILE_LABELS", "GRAPH_FILE_FIELDS", "arg", "AddTrackWorkflow_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as C}from"./chunk-J6KYLXRD.js";import{a as S,b as w}from"./chunk-NXZT63HN.js";import{a as r,b as u}from"./chunk-64LZZURD.js";import{b as a}from"./chunk-FY3BTKY4.js";var c=a(C(),1),m=a(S(),1),e=a(w(),1),h=a(u(),1),o=a(r(),1),y=(0,h.observer)(function({model:t,onClose:i}){let{samples:s}=t.walkRowSampleChoices,[p,d]=(0,c.useState)(()=>(t.walkRowSamples??[]).filter(l=>s.includes(l)));return(0,o.jsxs)(m.Dialog,{open:!0,onClose:i,title:"Choose samples",children:[(0,o.jsxs)(e.DialogContent,{children:[(0,o.jsx)(e.Autocomplete,{multiple:!0,disableCloseOnSelect:!0,"data-testid":"graph-choose-samples",options:s,value:p,onChange:(l,n)=>{d(n)},renderOption:({key:l,...n},k,{selected:g})=>(0,o.jsxs)("li",{...n,children:[(0,o.jsx)(e.Checkbox,{size:"small",checked:g}),k]},l),renderInput:l=>(0,o.jsx)(e.TextField,{...l,autoFocus:!0,label:"Samples",placeholder:"type to search"})}),(0,o.jsxs)(e.Typography,{variant:"caption",color:"text.secondary",children:[s.length.toLocaleString()," samples in this cut. Their walks show in pairs, in the order picked."]})]}),(0,o.jsxs)(e.DialogActions,{children:[(0,o.jsx)(e.Button,{onClick:i,children:"Cancel"}),(0,o.jsx)(e.Button,{variant:"contained",disabled:p.length===0,onClick:()=>{t.setWalkRowSamples(p),i()},children:"Show these samples"})]})]})}),D=y;export{D as default};
|
|
2
|
+
//# sourceMappingURL=ChooseSamplesDialog-OYAB355I.js.map
|
package/dist/chunks/{ChooseSamplesDialog-KVTDIA4A.js.map → ChooseSamplesDialog-OYAB355I.js.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/ChooseSamplesDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import { useState } from 'react'\n\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Autocomplete,\n Button,\n Checkbox,\n DialogActions,\n DialogContent,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\ntype SamplePicker = Pick<\n GraphPaneModel,\n 'walkRowSampleChoices' | 'walkRowSamples' | 'setWalkRowSamples'\n>\n\n// Which samples' walks walk rows show, searched by name, in the order picked\nconst ChooseSamplesDialog = observer(function ChooseSamplesDialog({\n model,\n onClose,\n}: {\n model: SamplePicker\n onClose: () => void\n}) {\n const { samples } = model.walkRowSampleChoices\n const [picked, setPicked] = useState(() =>\n (model.walkRowSamples ?? []).filter(s => samples.includes(s)),\n )\n return (\n <Dialog open onClose={onClose} title=\"Choose samples\">\n <DialogContent>\n <Autocomplete\n multiple\n disableCloseOnSelect\n data-testid=\"graph-choose-samples\"\n options={samples}\n value={picked}\n onChange={(_, value) => {\n setPicked(value)\n }}\n renderOption={({ key, ...props }, sample, { selected }) => (\n <li key={key} {...props}>\n <Checkbox size=\"small\" checked={selected} />\n {sample}\n </li>\n )}\n renderInput={params => (\n <TextField\n {...params}\n autoFocus\n label=\"Samples\"\n placeholder=\"type to search\"\n />\n )}\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {samples.length.toLocaleString()} samples in this cut. Their walks\n show in pairs, in the order picked.\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>Cancel</Button>\n <Button\n variant=\"contained\"\n disabled={picked.length === 0}\n onClick={() => {\n model.setWalkRowSamples(picked)\n onClose()\n }}\n >\n Show these samples\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default ChooseSamplesDialog\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "8KAAA,IAAAA,EAAyB,SAEzBC,EAAuB,SACvBC,EAQO,SACPC,EAAyB,SAkCbC,EAAA,SAxBNC,KAAsB,YAAS,SAA6B,CAChE,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIF,EAAM,qBACpB,CAACG,EAAQC,CAAS,KAAI,YAAS,KAClCJ,EAAM,gBAAkB,CAAC,GAAG,OAAOK,GAAKH,EAAQ,SAASG,CAAC,CAAC,CAC9D,EACA,SACE,QAAC,UAAO,KAAI,GAAC,QAASJ,EAAS,MAAM,iBACnC,qBAAC,iBACC,oBAAC,gBACC,SAAQ,GACR,qBAAoB,GACpB,cAAY,uBACZ,QAASC,EACT,MAAOC,EACP,SAAU,CAACG,EAAGC,IAAU,CACtBH,EAAUG,CAAK,CACjB,EACA,aAAc,CAAC,CAAE,IAAAC,EAAK,GAAGC,CAAM,EAAGC,EAAQ,CAAE,SAAAC,CAAS,OACnD,QAAC,MAAc,GAAGF,EAChB,oBAAC,YAAS,KAAK,QAAQ,QAASE,EAAU,EACzCD,IAFMF,CAGT,EAEF,YAAaI,MACX,OAAC,aACE,GAAGA,EACJ,UAAS,GACT,MAAM,UACN,YAAY,iBACd,EAEJ,KACA,QAAC,cAAW,QAAQ,UAAU,MAAM,iBACjC,UAAAV,EAAQ,OAAO,eAAe,EAAE,yEAEnC,GACF,KACA,QAAC,iBACC,oBAAC,UAAO,QAASD,EAAS,kBAAM,KAChC,OAAC,UACC,QAAQ,YACR,SAAUE,EAAO,SAAW,EAC5B,QAAS,IAAM,CACbH,EAAM,kBAAkBG,CAAM,EAC9BF,EAAQ,CACV,EACD,8BAED,GACF,GACF,CAEJ,CAAC,EAEMY,EAAQd",
|
|
6
6
|
"names": ["import_react", "import_ui", "import_material", "import_mobx_react", "import_jsx_runtime", "ChooseSamplesDialog", "model", "onClose", "samples", "picked", "setPicked", "s", "_", "value", "key", "props", "sample", "selected", "params", "ChooseSamplesDialog_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as w}from"./chunk-J6KYLXRD.js";import{a as u,b as f}from"./chunk-NXZT63HN.js";import{a as p,b as C}from"./chunk-64LZZURD.js";import{b as a}from"./chunk-FY3BTKY4.js";var c=a(w(),1),h=a(u(),1),e=a(f(),1),k=a(C(),1),t=a(p(),1),b=(0,k.observer)(function({model:l,onClose:i}){let{walkChoices:n}=l,d=new Set(n.map(o=>o.name)),[r,g]=(0,c.useState)(()=>l.walkLayers.map(o=>o.walk).filter(o=>d.has(o)));return(0,t.jsxs)(h.Dialog,{open:!0,onClose:i,title:"Choose haplotypes",children:[(0,t.jsxs)(e.DialogContent,{children:[(0,t.jsx)(e.Autocomplete,{multiple:!0,disableCloseOnSelect:!0,"data-testid":"graph-choose-walks",options:n.map(o=>o.name),getOptionLabel:o=>l.walkLabel(o),value:r,onChange:(o,s)=>{g(s)},renderOption:({key:o,...s},m,{selected:y})=>(0,t.jsxs)("li",{...s,children:[(0,t.jsx)(e.Checkbox,{size:"small",checked:y}),l.walkLabel(m)]},o),renderInput:o=>(0,t.jsx)(e.TextField,{...o,autoFocus:!0,label:"Haplotypes",placeholder:"type to search"})}),(0,t.jsxs)(e.Typography,{variant:"caption",color:"text.secondary",children:[n.length.toLocaleString()," haplotypes in this cut. The ones picked are highlighted in this order, and the rest fades."]})]}),(0,t.jsxs)(e.DialogActions,{children:[(0,t.jsx)(e.Button,{onClick:i,children:"Cancel"}),(0,t.jsx)(e.Button,{variant:"contained",onClick:()=>{l.liftWalks(r),i()},children:"Highlight these"})]})]})}),L=b;export{L as default};
|
|
2
|
+
//# sourceMappingURL=ChooseWalksDialog-HJE4CAKU.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/ChooseWalksDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import { useState } from 'react'\n\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Autocomplete,\n Button,\n Checkbox,\n DialogActions,\n DialogContent,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\ntype WalkPicker = Pick<\n GraphPaneModel,\n 'walkChoices' | 'walkLayers' | 'walkLabel' | 'liftWalks'\n>\n\n// Which haplotypes to highlight, searched by name, for a graph with more walks than a\n// menu can list\nconst ChooseWalksDialog = observer(function ChooseWalksDialog({\n model,\n onClose,\n}: {\n model: WalkPicker\n onClose: () => void\n}) {\n const { walkChoices } = model\n const names = new Set(walkChoices.map(c => c.name))\n const [picked, setPicked] = useState(() =>\n model.walkLayers.map(l => l.walk).filter(name => names.has(name)),\n )\n return (\n <Dialog open onClose={onClose} title=\"Choose haplotypes\">\n <DialogContent>\n <Autocomplete\n multiple\n disableCloseOnSelect\n data-testid=\"graph-choose-walks\"\n options={walkChoices.map(c => c.name)}\n getOptionLabel={name => model.walkLabel(name)}\n value={picked}\n onChange={(_, value) => {\n setPicked(value)\n }}\n renderOption={({ key, ...props }, name, { selected }) => (\n <li key={key} {...props}>\n <Checkbox size=\"small\" checked={selected} />\n {model.walkLabel(name)}\n </li>\n )}\n renderInput={params => (\n <TextField\n {...params}\n autoFocus\n label=\"Haplotypes\"\n placeholder=\"type to search\"\n />\n )}\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {walkChoices.length.toLocaleString()} haplotypes in this cut. The ones\n picked are highlighted in this order, and the rest fades.\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>Cancel</Button>\n <Button\n variant=\"contained\"\n onClick={() => {\n model.liftWalks(picked)\n onClose()\n }}\n >\n Highlight these\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default ChooseWalksDialog\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "8KAAA,IAAAA,EAAyB,SAEzBC,EAAuB,SACvBC,EAQO,SACPC,EAAyB,SAqCbC,EAAA,SA1BNC,KAAoB,YAAS,SAA2B,CAC5D,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,GAAM,CAAE,YAAAC,CAAY,EAAIF,EAClBG,EAAQ,IAAI,IAAID,EAAY,IAAIE,GAAKA,EAAE,IAAI,CAAC,EAC5C,CAACC,EAAQC,CAAS,KAAI,YAAS,IACnCN,EAAM,WAAW,IAAIO,GAAKA,EAAE,IAAI,EAAE,OAAOC,GAAQL,EAAM,IAAIK,CAAI,CAAC,CAClE,EACA,SACE,QAAC,UAAO,KAAI,GAAC,QAASP,EAAS,MAAM,oBACnC,qBAAC,iBACC,oBAAC,gBACC,SAAQ,GACR,qBAAoB,GACpB,cAAY,qBACZ,QAASC,EAAY,IAAIE,GAAKA,EAAE,IAAI,EACpC,eAAgBI,GAAQR,EAAM,UAAUQ,CAAI,EAC5C,MAAOH,EACP,SAAU,CAACI,EAAGC,IAAU,CACtBJ,EAAUI,CAAK,CACjB,EACA,aAAc,CAAC,CAAE,IAAAC,EAAK,GAAGC,CAAM,EAAGJ,EAAM,CAAE,SAAAK,CAAS,OACjD,QAAC,MAAc,GAAGD,EAChB,oBAAC,YAAS,KAAK,QAAQ,QAASC,EAAU,EACzCb,EAAM,UAAUQ,CAAI,IAFdG,CAGT,EAEF,YAAaG,MACX,OAAC,aACE,GAAGA,EACJ,UAAS,GACT,MAAM,aACN,YAAY,iBACd,EAEJ,KACA,QAAC,cAAW,QAAQ,UAAU,MAAM,iBACjC,UAAAZ,EAAY,OAAO,eAAe,EAAE,+FAEvC,GACF,KACA,QAAC,iBACC,oBAAC,UAAO,QAASD,EAAS,kBAAM,KAChC,OAAC,UACC,QAAQ,YACR,QAAS,IAAM,CACbD,EAAM,UAAUK,CAAM,EACtBJ,EAAQ,CACV,EACD,2BAED,GACF,GACF,CAEJ,CAAC,EAEMc,EAAQhB",
|
|
6
6
|
"names": ["import_react", "import_ui", "import_material", "import_mobx_react", "import_jsx_runtime", "ChooseWalksDialog", "model", "onClose", "walkChoices", "names", "c", "picked", "setPicked", "l", "name", "_", "value", "key", "props", "selected", "params", "ChooseWalksDialog_default"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as x}from"./chunk-
|
|
1
|
+
import{a as x}from"./chunk-AMD4KXQV.js";import"./chunk-X4DGSMS6.js";import"./chunk-7KFSWOWX.js";import"./chunk-GXQ7NYB3.js";import{j as L}from"./chunk-GMSOU6VO.js";import"./chunk-GB7CF6Z2.js";import"./chunk-WTOQRUK2.js";import"./chunk-B7GF3TC3.js";import"./chunk-KRXALLQG.js";import"./chunk-EHV7EUMI.js";import"./chunk-MYJYGSOH.js";import"./chunk-YBLNN5FU.js";import"./chunk-DILFGQIL.js";import"./chunk-FCWXYIFC.js";import{a as B}from"./chunk-J6KYLXRD.js";import{a as v,b as G}from"./chunk-NXZT63HN.js";import{a as s,b as g}from"./chunk-64LZZURD.js";import{b as a}from"./chunk-FY3BTKY4.js";var S=a(g(),1);var m=a(v(),1),n=a(G(),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(v(),1),i=a(G(),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-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-ULQ6U5MK.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": "
|
|
5
|
+
"mappings": "8kBAAA,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,CA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,IAAM,CACbG,EAAc,CAChB,EACA,SAAU,CAACF,EAAI,KAAK,EACrB,gBAED,GACF,GACF,KAEA,OAAC,OAAI,UAAWD,EAAQ,OACtB,mBAAC,UACC,KAAK,QACL,QAAS,IAAM,CACRD,EAAM,QAAQH,EAAa,eAAe,CACjD,EACD,+BAED,EACF,EAECG,EAAM,SAAQ,OAAC,eAAY,MAAOA,EAAM,MAAO,EAAK,MACvD,CAEJ,CAAC,EAEMW,EAAQZ,EF7GJ,IAAAa,EAAA,SANLC,KAAkB,YAAS,SAAyB,CACxD,MAAAC,CACF,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
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as g}from"./chunk-X4DGSMS6.js";import{j as f}from"./chunk-GMSOU6VO.js";import"./chunk-B7GF3TC3.js";import"./chunk-MYJYGSOH.js";import"./chunk-DILFGQIL.js";import{a as x}from"./chunk-J6KYLXRD.js";import{b as y}from"./chunk-NXZT63HN.js";import{a as l,b as m}from"./chunk-64LZZURD.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
|
+
`)===(e.chosenHaplotypes??[]).join(`
|
|
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-O6IYVHNJ.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGraphDisplay/components/SubgraphContextSelect.tsx", "../../src/LinearGraphDisplay/components/SubgraphHaplotypesField.tsx", "../../src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n formControl: {\n minWidth: 200,\n },\n})\n\n// Hops past the region's own segments, each costing a tabix query per\n// off-reference segment already reached. One is the default: at none a single\n// detour draws as two unrelated stubs, which is a wrong picture of the graph\n// rather than a cheaper one. Two exists for a graph whose alleles have alleles\n// (HPRC's amylase window keeps growing at 2, the E. coli paa locus does not), and\n// it stops there because a frontier is still not a bubble decomposition. Cut an\n// exact slice with gfatools when that is what is wanted.\nconst SUBGRAPH_CONTEXTS = [\n { value: 0, label: 'None' },\n { value: 1, label: '1 hop' },\n { value: 2, label: '2 hops' },\n]\n\nconst SubgraphContextSelect = observer(function SubgraphContextSelect({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <FormControl className={classes.formControl}>\n <InputLabel>Graph context</InputLabel>\n <Select\n value={model.subgraphContext}\n label=\"Graph context\"\n data-testid=\"graph-context-select\"\n onChange={e => {\n model.setSubgraphContext(e.target.value)\n void model.cut()\n }}\n >\n {SUBGRAPH_CONTEXTS.map(({ value, label }) => (\n <MenuItem key={value} value={value}>\n {label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <Typography variant=\"caption\" color=\"text.secondary\">\n How far the cut follows links out of the region, one hop by default. A\n detour that leaves the reference before the window and rejoins after it\n is indexed under its own sequence, so at none its middle is missing and\n the one bubble draws as two unrelated stubs. Each hop costs a query per\n off-reference segment already reached.\n </Typography>\n </div>\n )\n})\n\nexport default SubgraphContextSelect\n", "import { useState } from 'react'\n\nimport { TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\nexport function parseHaplotypeList(text: string) {\n const names = text\n .split(/[\\s,]+/)\n .map(name => name.trim())\n .filter(name => name !== '')\n return names.length === 0 ? undefined : names\n}\n\nconst HaplotypeListField = observer(function HaplotypeListField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const [draft, setDraft] = useState(model.chosenHaplotypes?.join(', ') ?? '')\n const apply = () => {\n const parsed = parseHaplotypeList(draft) ?? []\n const unchanged =\n parsed.join('\\n') === (model.chosenHaplotypes ?? []).join('\\n')\n if (!unchanged) {\n model.setSubgraphHaplotypes(parsed)\n void model.cut()\n }\n }\n return (\n <TextField\n fullWidth\n label=\"Haplotypes\"\n placeholder=\"every haplotype\"\n value={draft}\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-field' } }}\n onChange={e => {\n setDraft(e.target.value)\n }}\n onBlur={() => {\n apply()\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n apply()\n }\n }}\n />\n )\n})\n\n// Only a GBZ cut reads the set. The inner field is keyed on it so an outside\n// change (a restored session, a launch) resets the draft rather than fighting\n// it.\nconst SubgraphHaplotypesField = observer(function SubgraphHaplotypesField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n return model.adapterConfig.type === 'GbzBaseSyntenyAdapter' ? (\n <div className={classes.section}>\n <HaplotypeListField\n key={model.chosenHaplotypes?.join(',') ?? ''}\n model={model}\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n The haplotypes the cut is for, as lane assembly names or PanSN prefixes\n (HG002#1, or HG002 for both), separated by commas. The cut keeps their\n walks and the nodes those walks visit, with the reference. Empty is\n every haplotype.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphHaplotypesField\n", "import SubgraphContextSelect from './SubgraphContextSelect'\nimport SubgraphHaplotypesField from './SubgraphHaplotypesField'\nimport GraphSettingsDialog from '../../GraphGenomeView/components/GraphSettingsDialog'\n\nimport type { LinearGraphCutModel } from '../model'\n\nexport default function GraphTrackSettingsDialog({\n model,\n open,\n onClose,\n}: {\n model: LinearGraphCutModel\n open: boolean\n onClose: () => void\n}) {\n return (\n <GraphSettingsDialog model={model} open={open} onClose={onClose}>\n <SubgraphContextSelect model={model} />\n <SubgraphHaplotypesField model={model} />\n </GraphSettingsDialog>\n )\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "2UAAA,IAAAA,EAMO,SACPC,EAAyB,SACzBC,EAA2B,SAkCrBC,EAAA,SA9BAC,KAAY,cAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,EACA,YAAa,CACX,SAAU,GACZ,CACF,CAAC,EASKC,EAAoB,CACxB,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,OAAQ,EAC3B,CAAE,MAAO,EAAG,MAAO,QAAS,CAC9B,EAEMC,KAAwB,YAAS,SAA+B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AS,GACT,MAAM,aACN,YAAY,kBACZ,MAAOC,EACP,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,SAAUI,GAAK,CACbH,EAASG,EAAE,OAAO,KAAK,CACzB,EACA,OAAQ,IAAM,CACZF,EAAM,CACR,EACA,UAAWE,GAAK,CACVA,EAAE,MAAQ,SACZF,EAAM,CAEV,EACF,CAEJ,CAAC,EAKKG,KAA0B,YAAS,SAAiC,CACxE,MAAAN,CACF,EAEG,CACD,GAAM,CAAE,QAAAO,CAAQ,EAAIb,EAAU,EAC9B,OAAOM,EAAM,cAAc,OAAS,2BAClC,QAAC,OAAI,UAAWO,EAAQ,QACtB,oBAACR,EAAA,CAEC,MAAOC,GADFA,EAAM,kBAAkB,KAAK,GAAG,GAAK,EAE5C,KACA,OAAC,cAAW,QAAQ,UAAU,MAAM,iBAAiB,+OAKrD,GACF,EACE,IACN,CAAC,EAEMQ,EAAQF,ECpEX,IAAAG,EAAA,SAVW,SAARC,EAA0C,CAC/C,MAAAC,EACA,KAAAC,EACA,QAAAC,CACF,EAIG,CACD,SACE,QAACC,EAAA,CAAoB,MAAOH,EAAO,KAAMC,EAAM,QAASC,EACtD,oBAACE,EAAA,CAAsB,MAAOJ,EAAO,KACrC,OAACK,EAAA,CAAwB,MAAOL,EAAO,GACzC,CAEJ",
|
|
6
6
|
"names": ["import_material", "import_mobx_react", "import_mui", "import_jsx_runtime", "useStyles", "SUBGRAPH_CONTEXTS", "SubgraphContextSelect", "model", "classes", "e", "value", "label", "SubgraphContextSelect_default", "import_react", "import_material", "import_mobx_react", "import_mui", "import_jsx_runtime", "useStyles", "parseHaplotypeList", "text", "names", "name", "HaplotypeListField", "model", "draft", "setDraft", "apply", "parsed", "e", "SubgraphHaplotypesField", "classes", "SubgraphHaplotypesField_default", "import_jsx_runtime", "GraphTrackSettingsDialog", "model", "open", "onClose", "GraphSettingsDialog_default", "SubgraphContextSelect_default", "SubgraphHaplotypesField_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as h,o as s}from"./chunk-WTOQRUK2.js";import"./chunk-B7GF3TC3.js";import"./chunk-MYJYGSOH.js";import"./chunk-DILFGQIL.js";import{a as d,b as v}from"./chunk-NXZT63HN.js";import{a as g,b as y}from"./chunk-64LZZURD.js";import{b as i}from"./chunk-FY3BTKY4.js";var u=i(d(),1),o=i(v(),1),m=i(y(),1),e=i(g(),1),c=(0,m.observer)(function({model:a,onClose:r}){return(0,e.jsxs)(u.Dialog,{open:!0,onClose:r,title:"Color highlighted haplotypes",children:[(0,e.jsxs)(o.DialogContent,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[(0,e.jsx)(o.Typography,{variant:"subtitle2",children:"Haplotype"}),(0,e.jsx)(o.Typography,{variant:"subtitle2",children:"Color by"}),(0,e.jsx)(o.Typography,{variant:"subtitle2",children:"Palette"}),a.drawnWalks.map(({name:t,encoding:n})=>(0,e.jsx)(C,{label:a.walkLabel(t),field:n.field,scheme:n.scheme,onField:l=>{a.setWalkColor(t,{field:l})},onScheme:l=>{a.setWalkColor(t,{scheme:l})}},t))]}),(0,e.jsx)(o.DialogActions,{children:(0,e.jsx)(o.Button,{variant:"contained",onClick:r,children:"Done"})})]})});function C({label:p,field:a,scheme:r,onField:t,onScheme:n}){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.Typography,{variant:"body2",children:p}),(0,e.jsx)(o.TextField,{select:!0,size:"small",value:a,onChange:l=>{t(l.target.value)},children:h.map(l=>(0,e.jsx)(o.MenuItem,{value:l.value,children:l.label},l.value))}),(0,e.jsx)(o.TextField,{select:!0,size:"small",value:r,onChange:l=>{n(l.target.value)},children:s.filter(l=>l.value!=="rainbow"||a==="reference").map(l=>(0,e.jsx)(o.MenuItem,{value:l.value,children:l.label},l.value))})]})}var f=c;export{f as default};
|
|
2
|
+
//# sourceMappingURL=HighlightColorDialog-LXT72W7R.js.map
|
package/dist/chunks/{HighlightColorDialog-SABW5OMB.js.map → HighlightColorDialog-LXT72W7R.js.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/HighlightColorDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import { WALK_FIELDS, WALK_SCHEMES } from '@jbrowse/bandage-core/walkEncoding'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n MenuItem,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { GraphPaneModel } from '../model'\n\ntype HighlightColors = Pick<\n GraphPaneModel,\n 'drawnWalks' | 'walkLabel' | 'setWalkColor'\n>\n\nconst HighlightColorDialog = observer(function HighlightColorDialog({\n model,\n onClose,\n}: {\n model: HighlightColors\n onClose: () => void\n}) {\n return (\n <Dialog open onClose={onClose} title=\"Color highlighted haplotypes\">\n <DialogContent\n sx={{\n display: 'grid',\n gridTemplateColumns: 'auto 1fr 1fr',\n alignItems: 'center',\n gap: 1.5,\n }}\n >\n <Typography variant=\"subtitle2\">Haplotype</Typography>\n <Typography variant=\"subtitle2\">Color by</Typography>\n <Typography variant=\"subtitle2\">Palette</Typography>\n {model.drawnWalks.map(({ name, encoding }) => (\n <Row\n key={name}\n label={model.walkLabel(name)}\n field={encoding.field}\n scheme={encoding.scheme}\n onField={field => {\n model.setWalkColor(name, { field })\n }}\n onScheme={scheme => {\n model.setWalkColor(name, { scheme })\n }}\n />\n ))}\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\ntype Field = (typeof WALK_FIELDS)[number]['value']\ntype Scheme = (typeof WALK_SCHEMES)[number]['value']\n\nfunction Row({\n label,\n field,\n scheme,\n onField,\n onScheme,\n}: {\n label: string\n field: Field\n scheme: Scheme\n onField: (field: Field) => void\n onScheme: (scheme: Scheme) => void\n}) {\n return (\n <>\n <Typography variant=\"body2\">{label}</Typography>\n <TextField\n select\n size=\"small\"\n value={field}\n onChange={e => {\n onField(e.target.value as Field)\n }}\n >\n {WALK_FIELDS.map(f => (\n <MenuItem key={f.value} value={f.value}>\n {f.label}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n select\n size=\"small\"\n value={scheme}\n onChange={e => {\n onScheme(e.target.value as Scheme)\n }}\n >\n {WALK_SCHEMES.filter(\n s => s.value !== 'rainbow' || field === 'reference',\n ).map(s => (\n <MenuItem key={s.value} value={s.value}>\n {s.label}\n </MenuItem>\n ))}\n </TextField>\n </>\n )\n}\n\nexport default HighlightColorDialog\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "yQACA,IAAAA,EAAuB,SACvBC,EAOO,SACPC,EAAyB,SAkBnBC,EAAA,SATAC,KAAuB,YAAS,SAA8B,CAClE,MAAAC,EACA,QAAAC,CACF,EAGG,CACD,SACE,QAAC,UAAO,KAAI,GAAC,QAASA,EAAS,MAAM,+BACnC,qBAAC,iBACC,GAAI,CACF,QAAS,OACT,oBAAqB,eACrB,WAAY,SACZ,IAAK,GACP,EAEA,oBAAC,cAAW,QAAQ,YAAY,qBAAS,KACzC,OAAC,cAAW,QAAQ,YAAY,oBAAQ,KACxC,OAAC,cAAW,QAAQ,YAAY,mBAAO,EACtCD,EAAM,WAAW,IAAI,CAAC,CAAE,KAAAE,EAAM,SAAAC,CAAS,OACtC,OAACC,EAAA,CAEC,MAAOJ,EAAM,UAAUE,CAAI,EAC3B,MAAOC,EAAS,MAChB,OAAQA,EAAS,OACjB,QAASE,GAAS,CAChBL,EAAM,aAAaE,EAAM,CAAE,MAAAG,CAAM,CAAC,CACpC,EACA,SAAUC,GAAU,CAClBN,EAAM,aAAaE,EAAM,CAAE,OAAAI,CAAO,CAAC,CACrC,GATKJ,CAUP,CACD,GACH,KACA,OAAC,iBACC,mBAAC,UAAO,QAAQ,YAAY,QAASD,EAAS,gBAE9C,EACF,GACF,CAEJ,CAAC,EAKD,SAASG,EAAI,CACX,MAAAG,EACA,MAAAF,EACA,OAAAC,EACA,QAAAE,EACA,SAAAC,CACF,EAMG,CACD,SACE,oBACE,oBAAC,cAAW,QAAQ,QAAS,SAAAF,EAAM,KACnC,OAAC,aACC,OAAM,GACN,KAAK,QACL,MAAOF,EACP,SAAUK,GAAK,CACbF,EAAQE,EAAE,OAAO,KAAc,CACjC,EAEC,SAAAC,EAAY,IAAIC,MACf,OAAC,YAAuB,MAAOA,EAAE,MAC9B,SAAAA,EAAE,OADUA,EAAE,KAEjB,CACD,EACH,KACA,OAAC,aACC,OAAM,GACN,KAAK,QACL,MAAON,EACP,SAAUI,GAAK,CACbD,EAASC,EAAE,OAAO,KAAe,CACnC,EAEC,SAAAG,EAAa,OACZC,GAAKA,EAAE,QAAU,WAAaT,IAAU,WAC1C,EAAE,IAAIS,MACJ,OAAC,YAAuB,MAAOA,EAAE,MAC9B,SAAAA,EAAE,OADUA,EAAE,KAEjB,CACD,EACH,GACF,CAEJ,CAEA,IAAOC,EAAQhB",
|
|
6
6
|
"names": ["import_ui", "import_material", "import_mobx_react", "import_jsx_runtime", "HighlightColorDialog", "model", "onClose", "name", "encoding", "Row", "field", "scheme", "label", "onField", "onScheme", "e", "WALK_FIELDS", "f", "WALK_SCHEMES", "s", "HighlightColorDialog_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-AMD4KXQV.js";import"./chunk-X4DGSMS6.js";import"./chunk-7KFSWOWX.js";import"./chunk-GXQ7NYB3.js";import"./chunk-GMSOU6VO.js";import"./chunk-GB7CF6Z2.js";import"./chunk-WTOQRUK2.js";import"./chunk-B7GF3TC3.js";import"./chunk-KRXALLQG.js";import"./chunk-EHV7EUMI.js";import"./chunk-MYJYGSOH.js";import"./chunk-YBLNN5FU.js";import"./chunk-DILFGQIL.js";import"./chunk-FCWXYIFC.js";import"./chunk-J6KYLXRD.js";import"./chunk-NXZT63HN.js";import{a as e,b as d}from"./chunk-64LZZURD.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-KM5SOSQQ.js.map
|
package/dist/chunks/{LinearGraphDisplay-AHCKWNFJ.js.map → LinearGraphDisplay-KM5SOSQQ.js.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["global-externals:@jbrowse/display-kit/DisplayChrome", "../../src/LinearGraphDisplay/components/LinearGraphDisplay.tsx"],
|
|
4
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": "
|
|
5
|
+
"mappings": "0iBAAA,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
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d,b as y}from"./chunk-NXZT63HN.js";import{a as u,b as h}from"./chunk-64LZZURD.js";import{b as r}from"./chunk-FY3BTKY4.js";var t=r(u(),1),a=r(d(),1),o=r(y(),1),i=r(h(),1),k=(0,i.observer)(function({model:n,title:s,children:l,handleClose:m}){return(0,t.jsxs)(a.InfoDialog,{open:!0,title:s,onClose:()=>{m()},children:[l,n.trackWarnings.flatMap(({name:f,warnings:g},p)=>g.map((e,c)=>(0,t.jsxs)(o.Alert,{severity:"warning",style:{marginBottom:8},children:[(0,t.jsxs)(o.Typography,{variant:"subtitle2",children:[f,": ",e.message]}),e.effect]},`${p}_${c}`)))]})}),x=k;export{x as default};
|
|
2
|
+
//# sourceMappingURL=TrackWarningsDialog-YL2UP35Z.js.map
|
package/dist/chunks/{TrackWarningsDialog-HPHM5S7U.js.map → TrackWarningsDialog-YL2UP35Z.js.map}
RENAMED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.11_@emotion+react@11.14.0_@types+react@19.3.0_react@19_62128aa7a8a5629affa9cb1a58afadc3/node_modules/@jbrowse/synteny-core/esm/TrackWarningsDialog.js"],
|
|
4
4
|
"sourcesContent": ["import { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { InfoDialog } from '@jbrowse/core/ui';\nimport { Alert, Typography } from '@mui/material';\nimport { observer } from 'mobx-react';\n/**\n * The render-warnings report both comparative views open, over the rows\n * `collectTrackWarnings` builds for them. Reads them off the view rather than\n * taking a copy, so a refetch that raises or clears a warning while the dialog\n * is open shows in it.\n *\n * Grouped by track, with the track name leading each row: a stacked view's\n * levels raise the same swapped-assemblies warning verbatim, and so does every\n * overlaid track that hits it, so an ungrouped list repeated one sentence N\n * times without ever naming the file to go fix.\n *\n * Keyed by position \u2014 the message is not an identity, and neither is the track\n * name once one track raises two warnings.\n */\nconst TrackWarningsDialog = observer(function TrackWarningsDialog({ model, title, children, handleClose, }) {\n return (_jsxs(InfoDialog, { open: true, title: title, onClose: () => {\n handleClose();\n }, children: [children, model.trackWarnings.flatMap(({ name, warnings }, i) => warnings.map((w, j) => (_jsxs(Alert\n // eslint-disable-next-line @eslint-react/no-array-index-key -- see above\n , { severity: \"warning\", style: { marginBottom: 8 }, children: [_jsxs(Typography, { variant: \"subtitle2\", children: [name, \": \", w.message] }), w.effect] }, `${i}_${j}`))))] }));\n});\nexport default TrackWarningsDialog;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "sIAAA,IAAAA,EAA8B,SAC9BC,EAA2B,SAC3BC,EAAkC,SAClCC,EAAyB,SAenBC,KAAsB,YAAS,SAA6B,CAAE,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,YAAAC,CAAa,EAAG,CACxG,SAAQ,EAAAC,MAAM,aAAY,CAAE,KAAM,GAAM,MAAOH,EAAO,QAAS,IAAM,CAC7DE,EAAY,CAChB,EAAG,SAAU,CAACD,EAAUF,EAAM,cAAc,QAAQ,CAAC,CAAE,KAAAK,EAAM,SAAAC,CAAS,EAAGC,IAAMD,EAAS,IAAI,CAACE,EAAGC,OAAO,EAAAL,MAAM,QAEvG,CAAE,SAAU,UAAW,MAAO,CAAE,aAAc,CAAE,EAAG,SAAU,IAAC,EAAAA,MAAM,aAAY,CAAE,QAAS,YAAa,SAAU,CAACC,EAAM,KAAMG,EAAE,OAAO,CAAE,CAAC,EAAGA,EAAE,MAAM,CAAE,EAAG,GAAGD,CAAC,IAAIE,CAAC,EAAE,CAAE,CAAC,CAAC,CAAE,CAAC,CAC3L,CAAC,EACMC,EAAQX",
|
|
6
6
|
"names": ["import_jsx_runtime", "import_ui", "import_material", "import_mobx_react", "TrackWarningsDialog", "model", "title", "children", "handleClose", "_jsxs", "name", "warnings", "i", "w", "j", "TrackWarningsDialog_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["global-externals:react/jsx-runtime", "global-externals:mobx-react"],
|
|
4
|
+
"sourcesContent": ["module.exports = JBrowseExports[\"react/jsx-runtime\"];", "module.exports = JBrowseExports[\"mobx-react\"];"],
|
|
5
|
+
"mappings": "wCAAA,IAAAA,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,mBAAmB,ICAnD,IAAAC,EAAAC,EAAA,CAAAC,EAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,YAAY",
|
|
6
|
+
"names": ["require_jsx_runtime", "__commonJSMin", "exports", "module", "require_mobx_react", "__commonJSMin", "exports", "module"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Aa as Se,C as pe,Ca as xe,D as ce,Da as Le,E as de,K as fe,L as he,M as ue,N as ge,Q as T,R as $,T as G,U as z,V as j,a as oe,aa as be,ca as me,e as X,f as Y,ha as we,ia as ye,ma as ke,o as ae,oa as ve,ua as Re,w as P,x as le,z as F}from"./chunk-GB7CF6Z2.js";import{g as K,t as se}from"./chunk-WTOQRUK2.js";import{b as R,d as W,z as re}from"./chunk-B7GF3TC3.js";import{b as ie}from"./chunk-KRXALLQG.js";import{a as Ie}from"./chunk-FCWXYIFC.js";import{a as B}from"./chunk-J6KYLXRD.js";import{a as w,b as C}from"./chunk-64LZZURD.js";import{b as d}from"./chunk-FY3BTKY4.js";var S={background:"rgba(255,255,255,0.82)",padding:"4px 6px",borderRadius:3,fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},y={display:"flex",alignItems:"center",gap:5};var U=d(C(),1);var v=d(w(),1),Ne={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:2},De=(0,U.observer)(function({model:e}){let{bubbleHalos:o,walkLift:n,hoveredBubble:a}=e;if(o.length===0)return null;let{scaleX:r,scaleY:i,translateX:p,translateY:l,paneWidth:g,canvasHeight:b}=e,c=e.contigThickness*be,s=u=>n!==void 0&&!u.nodeIds.some(M=>n.nodeIds.has(M));return(0,v.jsx)("svg",{style:Ne,width:g,height:b,"data-testid":"graph-bubble-halos",children:(0,v.jsx)("g",{transform:`translate(${p} ${l}) scale(${r} ${i})`,children:o.filter(u=>!u.whole).map(u=>(0,v.jsx)("path",{d:u.path,fill:"none",stroke:P[u.kind],strokeOpacity:a&&ie(u.bubble,a)?.45:s(u)?.06:.22,strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`${u.bubble.start}-${u.bubble.end}`))})})}),Dt=De;function Xe({color:t}){return(0,v.jsx)("svg",{width:18,height:10,style:{flex:"none"},children:(0,v.jsx)("line",{x1:5,y1:5,x2:13,y2:5,stroke:t,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"})})}var Xt=(0,U.observer)(function({model:e}){let o=new Map;for(let n of e.bubbleHalos)if(!n.whole){let a=P[n.kind],r=o.get(a)??new Set;r.add(le[n.kind]),o.set(a,r)}return o.size>0?(0,v.jsx)("div",{style:S,"data-testid":"graph-halo-legend",children:[...o].map(([n,a])=>(0,v.jsxs)("div",{style:y,children:[(0,v.jsx)(Xe,{color:n}),(0,v.jsxs)("span",{children:["bubble: ",[...a].join(", ")]})]},n))}):null});var Me=d(B(),1);function Ye(t){return t==="class"?"className":/^(data|aria)-/.test(t)?t:t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}function Ee(t,e){if(typeof t=="string")return t;let o={key:e};for(let[n,a]of Object.entries(t.attrs))a!==void 0&&(o[Ye(n)]=a);return(0,Me.createElement)(t.tag,o,...t.children.map(Ee))}function A({el:t}){return Ee(t,0)}var Ce=d(B(),1);var Pe=d(C(),1);var V=d(w(),1),Ke={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:2},Fe=(0,Pe.observer)(function({model:e}){let o=`exon-outline-${(0,Ce.useId)().replaceAll(/[^\w-]/g,"")}`,{genePins:n,walkLift:a,nodeInk:r}=e,{scaleX:i,scaleY:p,translateX:l,translateY:g,paneWidth:b,canvasHeight:c}=e,s=j(z(n,r.halfWidthPx,a),{id:o,width:b,height:c,transform:`translate(${l} ${g}) scale(${i} ${p})`});return s?(0,V.jsx)("svg",{style:Ke,width:b,height:c,"data-testid":"graph-gene-pins",children:(0,V.jsx)(A,{el:s})}):null}),nn=Fe;var Be=d(Ie(),1),Ae=d(C(),1);var E=d(w(),1);function O({x:t,y:e,w:o,text:n,note:a,color:r,edge:i=r,italic:p,small:l,dimmed:g,title:b,testId:c,onClick:s,onHover:u}){return(0,E.jsxs)("g",{style:{pointerEvents:s||u?"auto":"none",cursor:s?"pointer":void 0,opacity:g?.35:1},"data-testid":c,onClick:s,onMouseEnter:()=>{u?.(!0)},onMouseLeave:()=>{u?.(!1)},children:[b?(0,E.jsx)("title",{children:b}):null,(0,E.jsx)("rect",{x:t-o/2,y:e-R-W+2,width:o,height:R+W*2-2,rx:3,fill:"rgba(255,255,255,0.85)",stroke:i,strokeWidth:l?.6:1}),(0,E.jsxs)("text",{x:t,y:e,fontSize:l?R-1:R,fontFamily:"sans-serif",fontStyle:p?"italic":void 0,fontWeight:p?600:void 0,fill:r,textAnchor:"middle",children:[n,a?(0,E.jsx)("tspan",{fontStyle:"normal",fontWeight:"normal",children:a}):null]})]})}var x=d(w(),1),ze={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"hidden",zIndex:3},_e="#1c1c22",je=(0,Ae.observer)(function({model:e}){let{bubbles:o,genes:n,routes:a}=e.overlayLabels;if(o.length+n.length+a.length===0)return null;let{walkLift:r,scaleY:i,translateY:p,contigThickness:l}=e,g=c=>r!==void 0&&!c.nodeIds.some(s=>r.nodeIds.has(s)),b=c=>r!==void 0&&!c.route.walks.some(s=>r.names.has(s));return(0,x.jsxs)("svg",{style:ze,width:e.paneWidth,height:e.canvasHeight,"data-testid":"graph-label-layer",children:[n.map(({item:c,x:s,y:u,w:M,text:_})=>{let{gene:k}=c,ne=me(c);return(0,x.jsxs)("g",{children:[(0,x.jsx)("line",{x1:s,x2:s,y1:u-R-2,y2:c.at.y*i+p+l/2,stroke:_e,strokeWidth:.8,strokeOpacity:.6}),(0,x.jsx)(O,{x:s,y:u,w:M,text:k.name,note:_.slice(k.name.length)||void 0,color:_e,edge:G,italic:!0,title:`${k.name} ${k.refName}:${k.start.toLocaleString()}-${k.end.toLocaleString()}${ne?`, ${ne} in the cut`:""}`,testId:"graph-gene-pin-label"})]},`${k.name}-${k.start}`)}),a.map(({item:{halo:c,route:s},x:u,y:M,w:_,text:k})=>(0,x.jsx)(O,{x:u,y:M,w:_,text:k,color:P[c.kind],small:!0,dimmed:b(s),title:`${s.route.walks.length} walk(s): ${s.route.walks.join(", ")}`,testId:"graph-route-label"},`${c.bubble.start}-${c.bubble.end}-${s.route.steps.join(",")}`)),o.map(({item:c,x:s,y:u,w:M,text:_})=>(0,x.jsx)(O,{x:s,y:u,w:M,text:_,color:P[c.kind],dimmed:g(c),title:`${c.label}
|
|
2
|
+
${c.bubble.segmentCount} segments \xB7 click to open`,testId:"graph-bubble-halo-label",onClick:()=>{e.popBubble(c.bubble)},onHover:k=>{(0,Be.isAlive)(e)&&e.setHoveredBubble(k?c.bubble:null)}},`${c.bubble.start}-${c.bubble.end}`))]})}),kn=je;var H=d(B(),1);var We=d(oe(),1),Z=d(C(),1);var m=d(w(),1),Ue={position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:5};function Ve(t,e,{lit:o,dpr:n}){let a=e.referenceStripFrame;a&&Se(t,e.referenceStripBlocks,a,{width:e.paneWidth,lit:o,darkMode:e.darkMode,dpr:n})}var Ze=(0,Z.observer)(function({model:e}){let o=(0,H.useRef)(null),{referenceStripShown:n,paneWidth:a,canvasHeight:r}=e;return(0,H.useEffect)(()=>(0,We.autorun)(()=>{let i=o.current,p=i?.getContext("2d");if(i&&p&&e.referenceStripShown){let l=$(),g=e.paneWidth,b=e.canvasHeight;i.width=Math.round(g*l),i.height=Math.round(b*l),p.setTransform(l,0,0,l,0,0),p.clearRect(0,0,g,b),Ve(p,e,{lit:e.referenceStripLit,dpr:l})}}),[e]),(0,m.jsx)("canvas",{ref:o,"data-testid":n?"graph-reference-strip":void 0,style:{...Ue,width:a,height:r,display:n?"block":"none"}})}),En=Ze,Te=18,qe="linear-gradient(to right, hsl(0, 70%, 50%) 0 33%, hsl(120, 70%, 50%) 33% 61%, hsl(240, 70%, 50%) 61%)",Je=6;function Qe(t){let e=t.filter((a,r)=>a!==t[r-1]),o=Math.min(Je,e.length),n=Array.from({length:o},(a,r)=>e[o>1?Math.round(r*(e.length-1)/(o-1)):0]);return n.length>1?`linear-gradient(to right, ${n.join(", ")})`:n[0]??K}function Oe({rows:t}){return(0,m.jsx)("div",{style:{width:Te,flex:"none"},children:t.map(({key:e,background:o})=>(0,m.jsx)("div",{style:{height:t.length>1?3:4,background:o}},e))})}function et(t){return t.walkLift?.walks.map(e=>({key:e.name,background:se(e.encoding)}))??[{key:"scheme",background:t.effectiveColorScheme==="reference-position"?qe:Qe(t.referenceStripBlocks.map(e=>e.colors[0]))}]}function tt(){return(0,m.jsx)("svg",{width:Te,height:10,style:{flex:"none"},children:(0,m.jsx)("path",{d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"})})}var Cn=(0,Z.observer)(function({model:e}){let o=(e.walkLift?.walks.length??0)>1;return e.referenceStripShown?(0,m.jsxs)("div",{style:S,"data-testid":"graph-reference-strip-legend",children:[(0,m.jsxs)("div",{style:y,children:[(0,m.jsx)(Oe,{rows:et(e)}),(0,m.jsxs)("span",{children:["top strip: reference segments at their bp",o?", a row per walk":""]})]}),e.referenceStripFaded?(0,m.jsxs)("div",{style:y,children:[(0,m.jsx)(Oe,{rows:[{key:"pale",background:K}]}),(0,m.jsxs)("span",{children:["reference not on"," ",o?"that row's walk":e.liftedWalksLabel]})]}):null,e.referenceStripOverhangs?(0,m.jsxs)("div",{style:y,children:[(0,m.jsx)(tt,{}),(0,m.jsx)("span",{children:"the graph draws reference past this edge"})]}):null]}):null});var N=d(B(),1);var Ge=d(oe(),1),J=d(C(),1);var f=d(w(),1),nt={position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:1};function ot(t,e,{highlightNode:o}){let n=e.tubeMapPicture,a=e.tubeMapFrame;if(!n||!a)return;let r=e.paneWidth,i={...a,width:r,highlightNode:o,darkMode:e.darkMode,tubeColors:e.tubeMapTubeColors,nodeColors:e.tubeMapNodeColors};ve(t,n,i),Le(t,e.tubeMapDeviations,i),ke(t,e.tubeMapConnectors,e.connectorZoneBottom,i);let{bounds:p}=n;Re(t,e.tubeMapGenes,i,a.y(p.minY)-2);let l=e.tubeMapRulerBoxes;l&&ye(t,l,i,a.y(p.maxY)+4,e.layoutResult?.referenceAxis)}var rt=(0,J.observer)(function({model:e}){let o=(0,N.useRef)(null),{tubeMapPicture:n,paneWidth:a,canvasHeight:r}=e;return(0,N.useEffect)(()=>(0,Ge.autorun)(()=>{let i=o.current,p=i?.getContext("2d");if(i&&p&&e.tubeMapPicture&&e.tubeMapFrame){let l=$(),g=e.paneWidth,b=e.canvasHeight;i.width=Math.round(g*l),i.height=Math.round(b*l),p.setTransform(l,0,0,l,0,0),p.clearRect(0,0,g,b),ot(p,e,{highlightNode:e.litNode??e.selectedNode})}}),[e]),(0,f.jsx)("canvas",{ref:o,"data-testid":n?"graph-tube-map":void 0,style:{...nt,width:a,height:r,display:n?"block":"none"}})}),zn=rt,I=18;function at(){let t=[[.5,5.5],[8.5,I-.5]];return(0,f.jsx)("svg",{width:I,height:7,style:{flex:"none"},children:(0,f.jsx)("path",{d:t.map(([e,o])=>`M${e},6 V1.5 H${o} V6`).join(" "),fill:"none",stroke:we(),strokeWidth:1})})}var Q={width:I,height:7,flex:"none"},st={...Q,display:"flex",justifyContent:"center",backgroundColor:"#b8b8c0"};function it(){return(0,f.jsx)("div",{style:st,children:(0,f.jsx)("div",{style:{width:2,backgroundColor:xe()}})})}function $e({colors:t}){let e=100/t.length,o=t.map((n,a)=>`${n} ${a*e}% ${(a+1)*e}%`);return(0,f.jsx)("div",{style:{...Q,background:`linear-gradient(to right, ${o.join(", ")})`}})}var q={width:I,flex:"none",textAlign:"center",fontFamily:"monospace",fontSize:12};function lt(){return(0,f.jsx)("div",{style:{...Q,backgroundColor:"grey"}})}function L({swatch:t,children:e}){return(0,f.jsxs)("div",{style:y,children:[t,(0,f.jsx)("span",{children:e})]})}var jn=(0,J.observer)(function({model:e}){let{logWidths:o,foldBp:n,forwardReads:a,reverseReads:r,mismatches:i}=e.tubeMapKeys,p=e.readsShown,l=p&&p.shown<p.total?p:void 0,g=[a&&(0,f.jsx)(L,{swatch:(0,f.jsx)($e,{colors:X}),children:"read on the forward strand"},"fwd"),r&&(0,f.jsx)(L,{swatch:(0,f.jsx)($e,{colors:Y}),children:"read on the reverse strand"},"rev"),l&&(0,f.jsxs)(L,{swatch:(0,f.jsx)("span",{style:q}),children:[l.shown.toLocaleString("en-US")," of"," ",l.total.toLocaleString("en-US")," reads shown"]},"sampled"),i.has("substitution")&&(0,f.jsx)(L,{swatch:(0,f.jsx)("span",{style:q,children:"A"}),children:"a read's base unlike the node's"},"sub"),i.has("insertion")&&(0,f.jsx)(L,{swatch:(0,f.jsx)("span",{style:q,children:"*"}),children:"bases a read inserts"},"ins"),i.has("deletion")&&(0,f.jsx)(L,{swatch:(0,f.jsx)(lt,{}),children:"bases a read skips"},"del"),n!==void 0&&(0,f.jsxs)(L,{swatch:(0,f.jsx)(it,{}),children:["a haplotype's variant under ",re(n)]},"fold"),o&&(0,f.jsx)(L,{swatch:(0,f.jsx)(at,{}),children:"width grows with log of length"},"log")].filter(Boolean);return g.length>0?(0,f.jsx)("div",{style:S,"data-testid":"graph-tube-map-legend",children:g}):null});var He=d(B(),1);var te=d(C(),1);var h=d(w(),1),ct={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:3},D={width:18,height:ce-4,borderRadius:2},dt={...D,display:"flex",justifyContent:"center"};function ee({color:t}){return(0,h.jsx)("div",{style:dt,children:(0,h.jsx)("div",{style:{width:2,backgroundColor:t}})})}function ft({swatch:t}){return t.kind==="gene"?(0,h.jsx)("div",{style:{...D,boxSizing:"border-box",border:`1.5px solid ${pe}`,borderRadius:0}}):(0,h.jsx)("div",{style:{...D,height:t.kind==="gap"?de:D.height,background:t.fill}})}var to=(0,te.observer)(function({model:e}){let o=e.walkRowBars;if(!o)return null;let n=[o.reference,...o.rows].flatMap(r=>r.call??[]),a=fe(o,{ramp:e.referenceRampDomain,rampCss:F,genes:e.walkRowGeneKey});return(0,h.jsxs)("div",{style:S,"data-testid":"graph-walk-rows-legend",children:[a.map(r=>r.note?(0,h.jsx)("div",{style:{color:"#666",fontStyle:"italic"},children:r.label},r.label):(0,h.jsxs)("div",{style:y,children:[(0,h.jsx)(ft,{swatch:r.swatch}),(0,h.jsx)("span",{children:r.label})]},r.label)),n.some(r=>r.spanningReads!==0)?(0,h.jsxs)("div",{style:y,children:[(0,h.jsx)(ee,{color:he}),(0,h.jsx)("span",{children:"allele length called for this walk"})]}):null,n.some(r=>r.spanningReads===0)?(0,h.jsxs)("div",{style:y,children:[(0,h.jsx)(ee,{color:ue}),(0,h.jsx)("span",{children:"called with no read spanning it"})]}):null,n.some(r=>r.agrees===!1)?(0,h.jsxs)("div",{style:y,children:[(0,h.jsx)(ee,{color:ge}),(0,h.jsxs)("span",{children:["walk and call over ",Math.round(.1*100),"% apart"]})]}):null]})});function ht(t,e,o,n,a){return e.length===0?[T(t,n,a)]:[T({...t,rows:[]},n,a),...e.flatMap((r,i)=>T({...t,rows:t.rows.slice(r.first-1,r.first-1+r.count)},{...n,translateY:n.translateY+(o(r.first)-n.rowPx)*n.scaleY},{...a,idPrefix:`${a.idPrefix}-s${i}`}).children.filter(l=>typeof l!="string"&&l.attrs["data-testid"]!=="graph-walk-reference"))]}var ut=(0,te.observer)(function({model:e}){let o=(0,He.useId)().replace(/[^\w-]/g,""),n=e.walkRowBars,a=e.walkRowPlacement,r=e.walkRowPitch;if(!n||!a||!r)return null;let{paneWidth:i,canvasHeight:p}=e,l=s=>s*e.scaleY+e.translateY,g=e.hoveredWalkRowText?[n.reference,...n.rows].findIndex(s=>s.name===e.hoveredWalkRow):-1,b=g>=0?[n.reference,...n.rows][g]:void 0,c={scaleX:e.scaleX,scaleY:e.scaleY,translateX:e.translateX,translateY:e.translateY,width:i,height:p,...r};return(0,h.jsxs)("svg",{style:ct,width:i,height:p,"data-testid":"graph-walk-rows",children:[ht(n,e.walkRowGroups?.sections??[],a.rowY,c,{ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes,idPrefix:o}).map((s,u)=>(0,h.jsx)(A,{el:s},u)),a.headers.map(s=>(0,h.jsx)("text",{x:10,y:l(s.top)+ae-4,fontFamily:"sans-serif",fontSize:11,fontWeight:"bold",fill:"#333","data-testid":"graph-walk-section",children:s.title},s.key)),b?(0,h.jsx)("rect",{"data-testid":"graph-walk-row-hovered",x:n.origin*e.scaleX+e.translateX-2,y:l(a.rowY(g))-r.rowPx/2-1,width:b.bp*e.scaleX+4,height:r.rowPx+2,fill:"none",stroke:"#111",strokeWidth:1}):null]})}),no=ut;export{S as a,y as b,Dt as c,Xt as d,A as e,nn as f,kn as g,Ve as h,En as i,Cn as j,ot as k,zn as l,jn as m,ft as n,to as o,no as p};
|
|
3
|
+
//# sourceMappingURL=chunk-7KFSWOWX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/GraphGenomeView/components/legendStyles.ts", "../../src/GraphGenomeView/components/BubbleHalos.tsx", "../../src/GraphGenomeView/components/ElTree.tsx", "../../src/GraphGenomeView/components/GenePins.tsx", "../../src/GraphGenomeView/components/LabelLayer.tsx", "../../src/GraphGenomeView/components/LabelChip.tsx", "../../src/GraphGenomeView/components/ReferenceStripOverlay.tsx", "../../src/GraphGenomeView/components/TubeMapOverlay.tsx", "../../src/GraphGenomeView/components/WalkRowsOverlay.tsx"],
|
|
4
|
+
"sourcesContent": ["// A key's box over the drawing, and one row in it: a swatch beside its words\nexport const legendBoxStyle = {\n background: 'rgba(255,255,255,0.82)',\n padding: '4px 6px',\n borderRadius: 3,\n fontSize: 11,\n lineHeight: '15px',\n whiteSpace: 'nowrap' as const,\n}\n\nexport const legendRowStyle = { display: 'flex', alignItems: 'center', gap: 5 }\n", "import { sameBubble } from '@jbrowse/bandage-core/bubbles/bubbleLine'\nimport {\n BUBBLE_KIND_COLORS,\n BUBBLE_KIND_NAMES,\n} from '@jbrowse/bandage-core/bubbles/classifyBubble'\nimport { HALO_FACTOR } from '@jbrowse/bandage-core/labelLayout'\nimport { observer } from 'mobx-react'\n\nimport { legendBoxStyle, legendRowStyle } from './legendStyles'\n\nimport type { GraphPaneModel } from '../model'\nimport type { BubbleHalo } from '@jbrowse/bandage-core/bubbles/bubbleHalos'\n\n// The bubbles over a node drawing: each a translucent halo along its nodes,\n// drawn once in layout units and moved with the canvas by one transform. The\n// halo takes no pointer events, so the nodes under it still hover and drag;\n// its name and its routes' chips are LabelLayer's.\n\nconst svgStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n overflow: 'hidden' as const,\n zIndex: 2,\n}\n\nconst BubbleHalos = observer(function BubbleHalos({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { bubbleHalos, walkLift, hoveredBubble } = model\n if (bubbleHalos.length === 0) {\n return null\n }\n const {\n scaleX,\n scaleY,\n translateX,\n translateY,\n paneWidth: width,\n canvasHeight,\n } = model\n const halo = model.contigThickness * HALO_FACTOR\n // lifted walks dim the bubbles none of them enters\n const dimmedBubble = (h: BubbleHalo) =>\n walkLift !== undefined && !h.nodeIds.some(id => walkLift.nodeIds.has(id))\n\n return (\n <svg\n style={svgStyle}\n width={width}\n height={canvasHeight}\n data-testid=\"graph-bubble-halos\"\n >\n <g\n transform={`translate(${translateX} ${translateY}) scale(${scaleX} ${scaleY})`}\n >\n {bubbleHalos\n .filter(h => !h.whole)\n .map(h => (\n <path\n key={`${h.bubble.start}-${h.bubble.end}`}\n d={h.path}\n fill=\"none\"\n stroke={BUBBLE_KIND_COLORS[h.kind]}\n strokeOpacity={\n hoveredBubble && sameBubble(h.bubble, hoveredBubble)\n ? 0.45\n : dimmedBubble(h)\n ? 0.06\n : 0.22\n }\n strokeWidth={halo}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n ))}\n </g>\n </svg>\n )\n})\n\nexport default BubbleHalos\n\nfunction HaloSwatch({ color }: { color: string }) {\n return (\n <svg width={18} height={10} style={{ flex: 'none' }}>\n <line\n x1={5}\n y1={5}\n x2={13}\n y2={5}\n stroke={color}\n strokeOpacity={0.35}\n strokeWidth={8}\n strokeLinecap=\"round\"\n />\n </svg>\n )\n}\n\n// One row per halo colour on screen, naming the kinds it stands for\nexport const HaloLegend = observer(function HaloLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const kindsByColor = new Map<string, Set<string>>()\n for (const h of model.bubbleHalos) {\n if (!h.whole) {\n const color = BUBBLE_KIND_COLORS[h.kind]\n const kinds = kindsByColor.get(color) ?? new Set<string>()\n kinds.add(BUBBLE_KIND_NAMES[h.kind])\n kindsByColor.set(color, kinds)\n }\n }\n return kindsByColor.size > 0 ? (\n <div style={legendBoxStyle} data-testid=\"graph-halo-legend\">\n {[...kindsByColor].map(([color, kinds]) => (\n <div key={color} style={legendRowStyle}>\n <HaloSwatch color={color} />\n <span>bubble: {[...kinds].join(', ')}</span>\n </div>\n ))}\n </div>\n ) : null\n})\n", "import { createElement } from 'react'\nimport type { ReactNode } from 'react'\n\nimport type { El } from '@jbrowse/bandage-core/el'\n\n// SVG's attribute names as React's props: `class` is className, `data-` and\n// `aria-` keep their dashes, the rest are camel-cased (`stroke-width` is\n// strokeWidth)\nfunction propName(name: string) {\n return name === 'class'\n ? 'className'\n : /^(data|aria)-/.test(name)\n ? name\n : name.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())\n}\n\nfunction toReact(node: El | string, key: number): ReactNode {\n if (typeof node === 'string') {\n return node\n }\n const props: Record<string, unknown> = { key }\n for (const [name, value] of Object.entries(node.attrs)) {\n if (value !== undefined) {\n props[propName(name)] = value\n }\n }\n return createElement(node.tag, props, ...node.children.map(toReact))\n}\n\n// A core element tree as React elements\nexport default function ElTree({ el }: { el: El }) {\n return toReact(el, 0)\n}\n", "import { useId } from 'react'\n\nimport {\n exonOutlineTree,\n exonStretches,\n} from '@jbrowse/bandage-core/genes/exonOutline'\nimport { observer } from 'mobx-react'\n\nimport ElTree from './ElTree'\n\nimport type { GraphPaneModel } from '../model'\n\n// The session's genes drawn onto the graph: each exon outlined round its\n// stretch of node, as core's exonOutlineTree draws it for every host, moved by\n// the same transform the halos use. Their names are LabelLayer's.\n\nconst svgStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n overflow: 'hidden' as const,\n zIndex: 2,\n}\n\nexport { EXON_COLOR } from '@jbrowse/bandage-core/genes/exonOutline'\n\nconst GenePins = observer(function GenePins({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const id = `exon-outline-${useId().replaceAll(/[^\\w-]/g, '')}`\n const { genePins, walkLift, nodeInk } = model\n const { scaleX, scaleY, translateX, translateY, paneWidth, canvasHeight } =\n model\n const tree = exonOutlineTree(\n exonStretches(genePins, nodeInk.halfWidthPx, walkLift),\n {\n id,\n width: paneWidth,\n height: canvasHeight,\n transform: `translate(${translateX} ${translateY}) scale(${scaleX} ${scaleY})`,\n },\n )\n return tree ? (\n <svg\n style={svgStyle}\n width={paneWidth}\n height={canvasHeight}\n data-testid=\"graph-gene-pins\"\n >\n <ElTree el={tree} />\n </svg>\n ) : null\n})\n\nexport default GenePins\n", "import { BUBBLE_KIND_COLORS } from '@jbrowse/bandage-core/bubbles/classifyBubble'\nimport { geneCoverageNote } from '@jbrowse/bandage-core/labelLayout'\nimport { LABEL_PX } from '@jbrowse/bandage-core/overlayLabels'\nimport { isAlive } from '@jbrowse/mobx-state-tree'\nimport { observer } from 'mobx-react'\n\nimport { EXON_COLOR } from './GenePins'\nimport LabelChip from './LabelChip'\n\nimport type { GraphPaneModel } from '../model'\nimport type {\n BubbleHalo,\n RouteLabel,\n} from '@jbrowse/bandage-core/bubbles/bubbleHalos'\n\n// Every chip drawn over the graph, above all of its ink: bubble names, gene\n// names on their pins, and the routes' walkers. `overlayLabels` has placed\n// them against each other and against the row labels already.\n\nconst svgStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n overflow: 'hidden' as const,\n zIndex: 3,\n}\n\nconst GENE_INK = '#1c1c22'\n\nconst LabelLayer = observer(function LabelLayer({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { bubbles, genes, routes } = model.overlayLabels\n if (bubbles.length + genes.length + routes.length === 0) {\n return null\n }\n const { walkLift, scaleY, translateY, contigThickness } = model\n // lifted walks dim the bubbles none of them enters and the routes none of\n // them takes\n const dimmedBubble = (h: BubbleHalo) =>\n walkLift !== undefined && !h.nodeIds.some(id => walkLift.nodeIds.has(id))\n const dimmedRoute = (r: RouteLabel) =>\n walkLift !== undefined && !r.route.walks.some(w => walkLift.names.has(w))\n\n return (\n <svg\n style={svgStyle}\n width={model.paneWidth}\n height={model.canvasHeight}\n data-testid=\"graph-label-layer\"\n >\n {genes.map(({ item: pin, x, y, w, text }) => {\n const { gene } = pin\n const note = geneCoverageNote(pin)\n return (\n <g key={`${gene.name}-${gene.start}`}>\n <line\n x1={x}\n x2={x}\n y1={y - LABEL_PX - 2}\n y2={pin.at.y * scaleY + translateY + contigThickness / 2}\n stroke={GENE_INK}\n strokeWidth={0.8}\n strokeOpacity={0.6}\n />\n <LabelChip\n x={x}\n y={y}\n w={w}\n text={gene.name}\n note={text.slice(gene.name.length) || undefined}\n color={GENE_INK}\n edge={EXON_COLOR}\n italic\n title={`${gene.name} ${gene.refName}:${gene.start.toLocaleString()}-${gene.end.toLocaleString()}${note ? `, ${note} in the cut` : ''}`}\n testId=\"graph-gene-pin-label\"\n />\n </g>\n )\n })}\n {routes.map(({ item: { halo: h, route }, x, y, w, text }) => (\n <LabelChip\n key={`${h.bubble.start}-${h.bubble.end}-${route.route.steps.join(',')}`}\n x={x}\n y={y}\n w={w}\n text={text}\n color={BUBBLE_KIND_COLORS[h.kind]}\n small\n dimmed={dimmedRoute(route)}\n title={`${route.route.walks.length} walk(s): ${route.route.walks.join(', ')}`}\n testId=\"graph-route-label\"\n />\n ))}\n {bubbles.map(({ item: h, x, y, w, text }) => (\n <LabelChip\n key={`${h.bubble.start}-${h.bubble.end}`}\n x={x}\n y={y}\n w={w}\n text={text}\n color={BUBBLE_KIND_COLORS[h.kind]}\n dimmed={dimmedBubble(h)}\n title={`${h.label}\\n${h.bubble.segmentCount} segments \u00B7 click to open`}\n testId=\"graph-bubble-halo-label\"\n onClick={() => {\n void model.popBubble(h.bubble)\n }}\n // a leave also fires as the view closing it unmounts the chip\n onHover={hovered => {\n if (isAlive(model)) {\n model.setHoveredBubble(hovered ? h.bubble : null)\n }\n }}\n />\n ))}\n </svg>\n )\n})\n\nexport default LabelLayer\n", "import { LABEL_PAD, LABEL_PX } from '@jbrowse/bandage-core/overlayLabels'\n\n// One label on an overlay: a white chip with a coloured edge and text, its\n// baseline at y and centred on x. A note follows the text in plain type.\nexport default function LabelChip({\n x,\n y,\n w,\n text,\n note,\n color,\n edge = color,\n italic,\n small,\n dimmed,\n title,\n testId,\n onClick,\n onHover,\n}: {\n x: number\n y: number\n w: number\n text: string\n note?: string\n color: string\n edge?: string\n italic?: boolean\n small?: boolean\n dimmed?: boolean\n title?: string\n testId?: string\n onClick?: () => void\n onHover?: (hovered: boolean) => void\n}) {\n return (\n <g\n style={{\n pointerEvents: onClick || onHover ? 'auto' : 'none',\n cursor: onClick ? 'pointer' : undefined,\n opacity: dimmed ? 0.35 : 1,\n }}\n data-testid={testId}\n onClick={onClick}\n onMouseEnter={() => {\n onHover?.(true)\n }}\n onMouseLeave={() => {\n onHover?.(false)\n }}\n >\n {title ? <title>{title}</title> : null}\n <rect\n x={x - w / 2}\n y={y - LABEL_PX - LABEL_PAD + 2}\n width={w}\n height={LABEL_PX + LABEL_PAD * 2 - 2}\n rx={3}\n fill=\"rgba(255,255,255,0.85)\"\n stroke={edge}\n strokeWidth={small ? 0.6 : 1}\n />\n <text\n x={x}\n y={y}\n fontSize={small ? LABEL_PX - 1 : LABEL_PX}\n fontFamily=\"sans-serif\"\n fontStyle={italic ? 'italic' : undefined}\n fontWeight={italic ? 600 : undefined}\n fill={color}\n textAnchor=\"middle\"\n >\n {text}\n {note ? (\n <tspan fontStyle=\"normal\" fontWeight=\"normal\">\n {note}\n </tspan>\n ) : null}\n </text>\n </g>\n )\n}\n", "import { useEffect, useRef } from 'react'\n\nimport { drawReferenceStrip } from '@jbrowse/bandage-core/referenceStrip'\nimport { LIFT_BACKDROP_CSS } from '@jbrowse/bandage-core/renderer/GeometryBuilder'\nimport { getDpr } from '@jbrowse/bandage-core/renderer/canvas'\nimport { encodingSwatchCss } from '@jbrowse/bandage-core/walkEncoding'\nimport { autorun } from 'mobx'\nimport { observer } from 'mobx-react'\n\nimport { legendBoxStyle, legendRowStyle } from './legendStyles'\n\nimport type { GraphPaneModel } from '../model'\n\nconst canvasStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n zIndex: 5,\n}\n\n// Each reference segment at its bp in the linear view, onto the pane's\n// canvas or the linear view's SVG export\nexport function paintReferenceStrip(\n ctx: CanvasRenderingContext2D,\n model: GraphPaneModel,\n {\n lit,\n dpr,\n }: { lit: GraphPaneModel['referenceStripLit'] | undefined; dpr: number },\n) {\n const frame = model.referenceStripFrame\n if (frame) {\n drawReferenceStrip(ctx, model.referenceStripBlocks, frame, {\n width: model.paneWidth,\n lit,\n darkMode: model.darkMode,\n dpr,\n })\n }\n}\n\n// Each reference segment at its bp in the linear view, over a drawing that\n// has no bp axis of its own. Repainted by an autorun, so a pan in the linear\n// view moves the strip in the same frame as its other tracks.\nconst ReferenceStripOverlay = observer(function ReferenceStripOverlay({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const ref = useRef<HTMLCanvasElement>(null)\n const { referenceStripShown, paneWidth, canvasHeight } = model\n useEffect(\n () =>\n autorun(() => {\n const canvas = ref.current\n const ctx = canvas?.getContext('2d')\n if (canvas && ctx && model.referenceStripShown) {\n const dpr = getDpr()\n const width = model.paneWidth\n const height = model.canvasHeight\n canvas.width = Math.round(width * dpr)\n canvas.height = Math.round(height * dpr)\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0)\n ctx.clearRect(0, 0, width, height)\n paintReferenceStrip(ctx, model, {\n lit: model.referenceStripLit,\n dpr,\n })\n }\n }),\n [model],\n )\n return (\n <canvas\n ref={ref}\n data-testid={referenceStripShown ? 'graph-reference-strip' : undefined}\n style={{\n ...canvasStyle,\n width: paneWidth,\n height: canvasHeight,\n display: referenceStripShown ? 'block' : 'none',\n }}\n />\n )\n})\n\nexport default ReferenceStripOverlay\n\nconst SWATCH_PX = 18\n\nconst RAMP_SWATCH =\n 'linear-gradient(to right, hsl(0, 70%, 50%) 0 33%, hsl(120, 70%, 50%) 33% 61%, hsl(240, 70%, 50%) 61%)'\n\n// A scheme other than the ramp shows a few of the strip's own blocks in bp\n// order, as the strip draws them, rather than a rainbow it does not\nconst SAMPLED_BLOCKS = 6\n\nfunction sampledSwatch(colors: string[]) {\n const distinct = colors.filter((c, i) => c !== colors[i - 1])\n const n = Math.min(SAMPLED_BLOCKS, distinct.length)\n const picked = Array.from(\n { length: n },\n (_, i) =>\n distinct[n > 1 ? Math.round((i * (distinct.length - 1)) / (n - 1)) : 0]!,\n )\n return picked.length > 1\n ? `linear-gradient(to right, ${picked.join(', ')})`\n : (picked[0] ?? LIFT_BACKDROP_CSS)\n}\n\n// the strip's own colours: a row per lifted walk in its lane's, else the\n// node scheme's\nfunction StripSwatch({\n rows,\n}: {\n rows: { key: string; background: string }[]\n}) {\n return (\n <div style={{ width: SWATCH_PX, flex: 'none' }}>\n {rows.map(({ key, background }) => (\n <div\n key={key}\n style={{ height: rows.length > 1 ? 3 : 4, background }}\n />\n ))}\n </div>\n )\n}\n\nfunction stripRows(model: GraphPaneModel) {\n return (\n model.walkLift?.walks.map(w => ({\n key: w.name,\n background: encodingSwatchCss(w.encoding),\n })) ?? [\n {\n key: 'scheme',\n background:\n model.effectiveColorScheme === 'reference-position'\n ? RAMP_SWATCH\n : sampledSwatch(model.referenceStripBlocks.map(b => b.colors[0]!)),\n },\n ]\n )\n}\n\nfunction OverhangSwatch() {\n return (\n <svg width={SWATCH_PX} height={10} style={{ flex: 'none' }}>\n <path d=\"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z\" fill=\"#18181c\" />\n </svg>\n )\n}\n\n// Hovering a node boxes its span on the strip and draws a leader to it\nexport const ReferenceStripLegend = observer(function ReferenceStripLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const rowPerWalk = (model.walkLift?.walks.length ?? 0) > 1\n return model.referenceStripShown ? (\n <div style={legendBoxStyle} data-testid=\"graph-reference-strip-legend\">\n <div style={legendRowStyle}>\n <StripSwatch rows={stripRows(model)} />\n <span>\n top strip: reference segments at their bp\n {rowPerWalk ? ', a row per walk' : ''}\n </span>\n </div>\n {model.referenceStripFaded ? (\n <div style={legendRowStyle}>\n <StripSwatch\n rows={[{ key: 'pale', background: LIFT_BACKDROP_CSS }]}\n />\n <span>\n reference not on{' '}\n {rowPerWalk ? \"that row's walk\" : model.liftedWalksLabel}\n </span>\n </div>\n ) : null}\n {model.referenceStripOverhangs ? (\n <div style={legendRowStyle}>\n <OverhangSwatch />\n <span>the graph draws reference past this edge</span>\n </div>\n ) : null}\n </div>\n ) : null\n})\n", "import { useEffect, useRef } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { formatBp } from '@jbrowse/bandage-core/graphLabels'\nimport { getDpr } from '@jbrowse/bandage-core/renderer/canvas'\nimport { drawTubeMapRuler, rulerInk } from '@jbrowse/bandage-core/tubeMap/axis'\nimport { drawTubeMapConnectors } from '@jbrowse/bandage-core/tubeMap/connectors'\nimport {\n deviationInk,\n drawDeviationMarks,\n} from '@jbrowse/bandage-core/tubeMap/deviations'\nimport { drawTubeMap } from '@jbrowse/bandage-core/tubeMap/draw'\nimport { drawTubeMapGenes } from '@jbrowse/bandage-core/tubeMap/genes'\nimport {\n FORWARD_READ_COLORS,\n REVERSE_READ_COLORS,\n} from '@jbrowse/bandage-core/tubeMap/reads'\nimport { autorun } from 'mobx'\nimport { observer } from 'mobx-react'\n\nimport { legendBoxStyle, legendRowStyle } from './legendStyles'\n\nimport type { GraphPaneModel } from '../model'\n\nconst canvasStyle = {\n position: 'absolute' as const,\n left: 0,\n top: 0,\n pointerEvents: 'none' as const,\n zIndex: 1,\n}\n\n// The tubes, their connectors, genes and ruler, onto a canvas sized to the\n// pane or onto the linear view's SVG export\nexport function paintTubeMap(\n ctx: CanvasRenderingContext2D,\n model: GraphPaneModel,\n { highlightNode }: { highlightNode: string | null },\n) {\n const picture = model.tubeMapPicture\n const frame = model.tubeMapFrame\n if (!picture || !frame) {\n return\n }\n const width = model.paneWidth\n const tubeFrame = {\n ...frame,\n width,\n highlightNode,\n darkMode: model.darkMode,\n tubeColors: model.tubeMapTubeColors,\n nodeColors: model.tubeMapNodeColors,\n }\n drawTubeMap(ctx, picture, tubeFrame)\n drawDeviationMarks(ctx, model.tubeMapDeviations, tubeFrame)\n drawTubeMapConnectors(\n ctx,\n model.tubeMapConnectors,\n model.connectorZoneBottom,\n tubeFrame,\n )\n const { bounds } = picture\n drawTubeMapGenes(ctx, model.tubeMapGenes, tubeFrame, frame.y(bounds.minY) - 2)\n const boxes = model.tubeMapRulerBoxes\n if (boxes) {\n drawTubeMapRuler(\n ctx,\n boxes,\n tubeFrame,\n frame.y(bounds.maxY) + 4,\n model.layoutResult?.referenceAxis,\n )\n }\n}\n\n// The tube map's ink, over the canvas, which draws nothing under a tube map\n// layout. Above the tubes go the session's genes in a view of its own, or in\n// a linear view the bands tying each reference box to its bp there; under\n// them a reference ruler, unless the linear view's is already the axis.\n// Repainted by an autorun on every change of transform, so a pan in the linear\n// view above moves the tubes in the same frame as its other tracks.\nconst TubeMapOverlay = observer(function TubeMapOverlay({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const ref = useRef<HTMLCanvasElement>(null)\n const { tubeMapPicture, paneWidth, canvasHeight } = model\n useEffect(\n () =>\n autorun(() => {\n const canvas = ref.current\n const ctx = canvas?.getContext('2d')\n if (canvas && ctx && model.tubeMapPicture && model.tubeMapFrame) {\n const dpr = getDpr()\n const width = model.paneWidth\n const height = model.canvasHeight\n canvas.width = Math.round(width * dpr)\n canvas.height = Math.round(height * dpr)\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0)\n ctx.clearRect(0, 0, width, height)\n paintTubeMap(ctx, model, {\n highlightNode: model.litNode ?? model.selectedNode,\n })\n }\n }),\n [model],\n )\n // Mounted whether or not there is a tube map, so the autorun above has its\n // canvas the moment a layout brings one.\n return (\n <canvas\n ref={ref}\n data-testid={tubeMapPicture ? 'graph-tube-map' : undefined}\n style={{\n ...canvasStyle,\n width: paneWidth,\n height: canvasHeight,\n display: tubeMapPicture ? 'block' : 'none',\n }}\n />\n )\n})\n\nexport default TubeMapOverlay\n\nconst SWATCH_PX = 18\n\n// Two boxes' brackets, as the ruler draws them under every box\nfunction BracketSwatch() {\n const brackets = [\n [0.5, 5.5],\n [8.5, SWATCH_PX - 0.5],\n ]\n return (\n <svg width={SWATCH_PX} height={7} style={{ flex: 'none' }}>\n <path\n d={brackets.map(([x0, x1]) => `M${x0},6 V1.5 H${x1} V6`).join(' ')}\n fill=\"none\"\n stroke={rulerInk()}\n strokeWidth={1}\n />\n </svg>\n )\n}\n\nconst barSwatchStyle = { width: SWATCH_PX, height: 7, flex: 'none' }\n\nconst tubeSwatchStyle = {\n ...barSwatchStyle,\n display: 'flex',\n justifyContent: 'center',\n backgroundColor: '#b8b8c0',\n}\n\nfunction TickSwatch() {\n return (\n <div style={tubeSwatchStyle}>\n <div style={{ width: 2, backgroundColor: deviationInk() }} />\n </div>\n )\n}\n\n// A read takes one shade of its strand's palette, varied so neighbours differ\nfunction ReadSwatch({ colors }: { colors: readonly string[] }) {\n const step = 100 / colors.length\n const stops = colors.map((c, i) => `${c} ${i * step}% ${(i + 1) * step}%`)\n return (\n <div\n style={{\n ...barSwatchStyle,\n background: `linear-gradient(to right, ${stops.join(', ')})`,\n }}\n />\n )\n}\n\nconst glyphSwatchStyle = {\n width: SWATCH_PX,\n flex: 'none',\n textAlign: 'center' as const,\n fontFamily: 'monospace',\n fontSize: 12,\n}\n\nfunction DeletionSwatch() {\n return <div style={{ ...barSwatchStyle, backgroundColor: 'grey' }} />\n}\n\nfunction LegendRow({\n swatch,\n children,\n}: {\n swatch: ReactNode\n children: ReactNode\n}) {\n return (\n <div style={legendRowStyle}>\n {swatch}\n <span>{children}</span>\n </div>\n )\n}\n\n// What a tube map draws that nothing else on screen explains, each listed\n// only while it applies\nexport const TubeMapLegend = observer(function TubeMapLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { logWidths, foldBp, forwardReads, reverseReads, mismatches } =\n model.tubeMapKeys\n const reads = model.readsShown\n const sampled = reads && reads.shown < reads.total ? reads : undefined\n const rows = [\n forwardReads && (\n <LegendRow key=\"fwd\" swatch={<ReadSwatch colors={FORWARD_READ_COLORS} />}>\n read on the forward strand\n </LegendRow>\n ),\n reverseReads && (\n <LegendRow key=\"rev\" swatch={<ReadSwatch colors={REVERSE_READ_COLORS} />}>\n read on the reverse strand\n </LegendRow>\n ),\n sampled && (\n <LegendRow key=\"sampled\" swatch={<span style={glyphSwatchStyle} />}>\n {sampled.shown.toLocaleString('en-US')} of{' '}\n {sampled.total.toLocaleString('en-US')} reads shown\n </LegendRow>\n ),\n mismatches.has('substitution') && (\n <LegendRow key=\"sub\" swatch={<span style={glyphSwatchStyle}>A</span>}>\n a read's base unlike the node's\n </LegendRow>\n ),\n mismatches.has('insertion') && (\n <LegendRow key=\"ins\" swatch={<span style={glyphSwatchStyle}>*</span>}>\n bases a read inserts\n </LegendRow>\n ),\n mismatches.has('deletion') && (\n <LegendRow key=\"del\" swatch={<DeletionSwatch />}>\n bases a read skips\n </LegendRow>\n ),\n foldBp !== undefined && (\n <LegendRow key=\"fold\" swatch={<TickSwatch />}>\n a haplotype's variant under {formatBp(foldBp)}\n </LegendRow>\n ),\n logWidths && (\n <LegendRow key=\"log\" swatch={<BracketSwatch />}>\n width grows with log of length\n </LegendRow>\n ),\n ].filter(Boolean)\n return rows.length > 0 ? (\n <div style={legendBoxStyle} data-testid=\"graph-tube-map-legend\">\n {rows}\n </div>\n ) : null\n})\n", "import { useId } from 'react'\n\nimport {\n BAR_PX,\n CALL_TICK,\n DISAGREES,\n GAP_PX,\n GENE_INK,\n UNBACKED_TICK,\n walkRowsKey,\n walkRowsTree,\n} from '@jbrowse/bandage-core/layout/walkRowDraw'\nimport { RAMP_GRADIENT_CSS } from '@jbrowse/bandage-core/referenceRampCss'\nimport { observer } from 'mobx-react'\n\nimport ElTree from './ElTree'\nimport { legendBoxStyle, legendRowStyle } from './legendStyles'\nimport { CALL_TOLERANCE } from '../repeats/walkCalls'\nimport { SECTION_HEADER_PX } from '../walkRowGroups'\n\nimport type { GraphPaneModel } from '../model'\nimport type { WalkRowSection } from '../walkRowGroups'\nimport type { El } from '@jbrowse/bandage-core/el'\nimport type {\n KeySwatch,\n WalkRowsFrame,\n WalkRowsWithCalls,\n} from '@jbrowse/bandage-core/layout/walkRowDraw'\n\n// The walk-rows layout's bars: one per haplotype walk under the reference\n// row, each on its own bp axis from the window's left edge, drawn from core's\n// walkRowsTree: runs coloured by whether they are on the reference walk's\n// path, unit separators, each row's genes from its own assembly's\n// annotation, the allele a repeat genotype called and a readout. Under the\n// reference-position ramp an aligned run takes the hue of the reference it is\n// threaded through. In a tandem array that is the aligner's pick among\n// near-identical copies, so the hue says which reference copy the graph used,\n// not which one a copy resembles.\n//\n// The walk rows pair a repeat record's allele with each walk \u2014 see\n// repeats/walkCalls.ts, which also holds the threshold a red readout is read\n// off. Colouring each copy by its unit is jbrowse-plugin-tandem-repeat's.\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: 3,\n}\n\nconst swatchStyle = { width: 18, height: BAR_PX - 4, borderRadius: 2 }\nconst tickSwatchStyle = {\n ...swatchStyle,\n display: 'flex',\n justifyContent: 'center',\n}\n\nfunction TickSwatch({ color }: { color: string }) {\n return (\n <div style={tickSwatchStyle}>\n <div style={{ width: 2, backgroundColor: color }} />\n </div>\n )\n}\n\nexport function Swatch({ swatch }: { swatch: KeySwatch }) {\n return swatch.kind === 'gene' ? (\n <div\n style={{\n ...swatchStyle,\n boxSizing: 'border-box',\n border: `1.5px solid ${GENE_INK}`,\n borderRadius: 0,\n }}\n />\n ) : (\n <div\n style={{\n ...swatchStyle,\n height: swatch.kind === 'gap' ? GAP_PX : swatchStyle.height,\n background: swatch.fill,\n }}\n />\n )\n}\n\n// What the bar colours, genes and ticks mean, in the legend stack with the\n// other keys. Each tick row appears once the rows hold one, so a catalogue\n// with no genotypes keeps the plain key.\nexport const WalkRowsLegend = observer(function WalkRowsLegend({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const bars = model.walkRowBars\n if (!bars) {\n return null\n }\n const calls = [bars.reference, ...bars.rows].flatMap(row => row.call ?? [])\n const key = walkRowsKey(bars, {\n ramp: model.referenceRampDomain,\n rampCss: RAMP_GRADIENT_CSS,\n genes: model.walkRowGeneKey,\n })\n return (\n <div style={legendBoxStyle} data-testid=\"graph-walk-rows-legend\">\n {key.map(entry =>\n entry.note ? (\n <div key={entry.label} style={{ color: '#666', fontStyle: 'italic' }}>\n {entry.label}\n </div>\n ) : (\n <div key={entry.label} style={legendRowStyle}>\n <Swatch swatch={entry.swatch} />\n <span>{entry.label}</span>\n </div>\n ),\n )}\n {calls.some(call => call.spanningReads !== 0) ? (\n <div style={legendRowStyle}>\n <TickSwatch color={CALL_TICK} />\n <span>allele length called for this walk</span>\n </div>\n ) : null}\n {calls.some(call => call.spanningReads === 0) ? (\n <div style={legendRowStyle}>\n <TickSwatch color={UNBACKED_TICK} />\n <span>called with no read spanning it</span>\n </div>\n ) : null}\n {calls.some(call => call.agrees === false) ? (\n <div style={legendRowStyle}>\n <TickSwatch color={DISAGREES} />\n <span>\n walk and call over {Math.round(CALL_TOLERANCE * 100)}% apart\n </span>\n </div>\n ) : null}\n </div>\n )\n})\n\n// The rows' trees, a section at a time while grouped. walkRowsTree puts its\n// i-th row at i * rowPx below its reference row and draws that row too, so\n// each section is drawn shifted down to its place with its reference row\n// dropped.\nexport function walkRowTrees(\n bars: WalkRowsWithCalls,\n sections: WalkRowSection[],\n rowY: (i: number) => number,\n frame: WalkRowsFrame & { rowPx: number },\n o: Parameters<typeof walkRowsTree>[2] & { idPrefix: string },\n): El[] {\n if (sections.length === 0) {\n return [walkRowsTree(bars, frame, o)]\n }\n return [\n walkRowsTree({ ...bars, rows: [] }, frame, o),\n ...sections.flatMap((section, k) => {\n const tree = walkRowsTree(\n {\n ...bars,\n rows: bars.rows.slice(\n section.first - 1,\n section.first - 1 + section.count,\n ),\n },\n {\n ...frame,\n translateY:\n frame.translateY +\n (rowY(section.first) - frame.rowPx) * frame.scaleY,\n },\n { ...o, idPrefix: `${o.idPrefix}-s${k}` },\n )\n return tree.children.filter(\n (c): c is El =>\n typeof c !== 'string' &&\n c.attrs['data-testid'] !== 'graph-walk-reference',\n )\n }),\n ]\n}\n\nconst WalkRowsOverlay = observer(function WalkRowsOverlay({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const idPrefix = useId().replace(/[^\\w-]/g, '')\n const bars = model.walkRowBars\n const place = model.walkRowPlacement\n const pitch = model.walkRowPitch\n if (!bars || !place || !pitch) {\n return null\n }\n const { paneWidth: width, canvasHeight } = model\n const Y = (y: number) => y * model.scaleY + model.translateY\n const hovered = model.hoveredWalkRowText\n ? [bars.reference, ...bars.rows].findIndex(\n r => r.name === model.hoveredWalkRow,\n )\n : -1\n const row =\n hovered >= 0 ? [bars.reference, ...bars.rows][hovered]! : undefined\n const frame = {\n scaleX: model.scaleX,\n scaleY: model.scaleY,\n translateX: model.translateX,\n translateY: model.translateY,\n width,\n height: canvasHeight,\n ...pitch,\n }\n return (\n <svg\n style={svgStyle}\n width={width}\n height={canvasHeight}\n data-testid=\"graph-walk-rows\"\n >\n {walkRowTrees(\n bars,\n model.walkRowGroups?.sections ?? [],\n place.rowY,\n frame,\n {\n ramp: model.referenceRampDomain,\n rowGenes: model.walkRowGenes,\n idPrefix,\n },\n ).map((tree, i) => (\n <ElTree key={i} el={tree} />\n ))}\n {place.headers.map(header => (\n <text\n key={header.key}\n x={10}\n y={Y(header.top) + SECTION_HEADER_PX - 4}\n fontFamily=\"sans-serif\"\n fontSize={11}\n fontWeight=\"bold\"\n fill=\"#333\"\n data-testid=\"graph-walk-section\"\n >\n {header.title}\n </text>\n ))}\n {row ? (\n <rect\n data-testid=\"graph-walk-row-hovered\"\n x={bars.origin * model.scaleX + model.translateX - 2}\n y={Y(place.rowY(hovered)) - pitch.rowPx / 2 - 1}\n width={row.bp * model.scaleX + 4}\n height={pitch.rowPx + 2}\n fill=\"none\"\n stroke=\"#111\"\n strokeWidth={1}\n />\n ) : null}\n </svg>\n )\n})\n\nexport default WalkRowsOverlay\n"],
|
|
5
|
+
"mappings": "kkBACO,IAAMA,EAAiB,CAC5B,WAAY,yBACZ,QAAS,UACT,aAAc,EACd,SAAU,GACV,WAAY,OACZ,WAAY,QACd,EAEaC,EAAiB,CAAE,QAAS,OAAQ,WAAY,SAAU,IAAK,CAAE,ECJ9E,IAAAC,EAAyB,SAwDb,IAAAC,EAAA,SA5CNC,GAAW,CACf,SAAU,WACV,KAAM,EACN,IAAK,EACL,cAAe,OACf,SAAU,SACV,OAAQ,CACV,EAEMC,MAAc,YAAS,SAAqB,CAChD,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,YAAAC,EAAa,SAAAC,EAAU,cAAAC,CAAc,EAAIH,EACjD,GAAIC,EAAY,SAAW,EACzB,OAAO,KAET,GAAM,CACJ,OAAAG,EACA,OAAAC,EACA,WAAAC,EACA,WAAAC,EACA,UAAWC,EACX,aAAAC,CACF,EAAIT,EACEU,EAAOV,EAAM,gBAAkBW,GAE/BC,EAAgBC,GACpBX,IAAa,QAAa,CAACW,EAAE,QAAQ,KAAKC,GAAMZ,EAAS,QAAQ,IAAIY,CAAE,CAAC,EAE1E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AAM,WAC5C+B,EAAU/B,EAAM,mBAClB,CAACC,EAAK,UAAW,GAAGA,EAAK,IAAI,EAAE,UAC7B+B,GAAKA,EAAE,OAAShC,EAAM,cACxB,EACA,GACEG,EACJ4B,GAAW,EAAI,CAAC9B,EAAK,UAAW,GAAGA,EAAK,IAAI,EAAE8B,CAAO,EAAK,OACtDd,EAAQ,CACZ,OAAQjB,EAAM,OACd,OAAQA,EAAM,OACd,WAAYA,EAAM,WAClB,WAAYA,EAAM,WAClB,MAAA2B,EACA,OAAQC,EACR,GAAGF,CACL,EACA,SACE,QAAC,OACC,MAAOrC,GACP,MAAOsC,EACP,OAAQC,EACR,cAAY,kBAEX,UAAAd,GACCb,EACAD,EAAM,eAAe,UAAY,CAAC,EAClCyB,EAAM,KACNR,EACA,CACE,KAAMjB,EAAM,oBACZ,SAAUA,EAAM,aAChB,SAAAwB,CACF,CACF,EAAE,IAAI,CAACS,EAAMC,OACX,OAACC,EAAA,CAAe,GAAIF,GAAPC,CAAa,CAC3B,EACAT,EAAM,QAAQ,IAAIW,MACjB,OAAC,QAEC,EAAG,GACH,EAAGP,EAAEO,EAAO,GAAG,EAAIC,GAAoB,EACvC,WAAW,aACX,SAAU,GACV,WAAW,OACX,KAAK,OACL,cAAY,qBAEX,SAAAD,EAAO,OATHA,EAAO,GAUd,CACD,EACAjC,KACC,OAAC,QACC,cAAY,yBACZ,EAAGF,EAAK,OAASD,EAAM,OAASA,EAAM,WAAa,EACnD,EAAG6B,EAAEJ,EAAM,KAAKM,CAAO,CAAC,EAAIL,EAAM,MAAQ,EAAI,EAC9C,MAAOvB,EAAI,GAAKH,EAAM,OAAS,EAC/B,OAAQ0B,EAAM,MAAQ,EACtB,KAAK,OACL,OAAO,OACP,YAAa,EACf,EACE,MACN,CAEJ,CAAC,EAEMY,GAAQf",
|
|
6
|
+
"names": ["legendBoxStyle", "legendRowStyle", "import_mobx_react", "import_jsx_runtime", "svgStyle", "BubbleHalos", "model", "bubbleHalos", "walkLift", "hoveredBubble", "scaleX", "scaleY", "translateX", "translateY", "width", "canvasHeight", "halo", "HALO_FACTOR", "dimmedBubble", "h", "id", "BUBBLE_KIND_COLORS", "sameBubble", "BubbleHalos_default", "HaloSwatch", "color", "HaloLegend", "kindsByColor", "kinds", "BUBBLE_KIND_NAMES", "legendBoxStyle", "legendRowStyle", "import_react", "propName", "name", "_", "c", "toReact", "node", "key", "props", "value", "ElTree", "el", "import_react", "import_mobx_react", "import_jsx_runtime", "svgStyle", "GenePins", "model", "id", "genePins", "walkLift", "nodeInk", "scaleX", "scaleY", "translateX", "translateY", "paneWidth", "canvasHeight", "tree", "exonOutlineTree", "exonStretches", "ElTree", "GenePins_default", "import_mobx_state_tree", "import_mobx_react", "import_jsx_runtime", "LabelChip", "x", "y", "w", "text", "note", "color", "edge", "italic", "small", "dimmed", "title", "testId", "onClick", "onHover", "LABEL_PX", "LABEL_PAD", "import_jsx_runtime", "svgStyle", "GENE_INK", "LabelLayer", "model", "bubbles", "genes", "routes", "walkLift", "scaleY", "translateY", "contigThickness", "dimmedBubble", "h", "id", "dimmedRoute", "r", "w", "pin", "x", "y", "text", "gene", "note", "geneCoverageNote", "LABEL_PX", "LabelChip", "EXON_COLOR", "route", "BUBBLE_KIND_COLORS", "hovered", "LabelLayer_default", "import_react", "import_mobx", "import_mobx_react", "import_jsx_runtime", "canvasStyle", "paintReferenceStrip", "ctx", "model", "lit", "dpr", "frame", "drawReferenceStrip", "ReferenceStripOverlay", "ref", "referenceStripShown", "paneWidth", "canvasHeight", "canvas", "getDpr", "width", "height", "ReferenceStripOverlay_default", "SWATCH_PX", "RAMP_SWATCH", "SAMPLED_BLOCKS", "sampledSwatch", "colors", "distinct", "c", "i", "n", "picked", "_", "LIFT_BACKDROP_CSS", "StripSwatch", "rows", "key", "background", "stripRows", "w", "encodingSwatchCss", "b", "OverhangSwatch", "ReferenceStripLegend", "rowPerWalk", "legendBoxStyle", "legendRowStyle", "import_react", "import_mobx", "import_mobx_react", "import_jsx_runtime", "canvasStyle", "paintTubeMap", "ctx", "model", "highlightNode", "picture", "frame", "width", "tubeFrame", "drawTubeMap", "drawDeviationMarks", "drawTubeMapConnectors", "bounds", "drawTubeMapGenes", "boxes", "drawTubeMapRuler", "TubeMapOverlay", "ref", "tubeMapPicture", "paneWidth", "canvasHeight", "canvas", "dpr", "getDpr", "height", "TubeMapOverlay_default", "SWATCH_PX", "BracketSwatch", "brackets", "x0", "x1", "rulerInk", "barSwatchStyle", "tubeSwatchStyle", "TickSwatch", "deviationInk", "ReadSwatch", "colors", "step", "stops", "c", "i", "glyphSwatchStyle", "DeletionSwatch", "LegendRow", "swatch", "children", "legendRowStyle", "TubeMapLegend", "logWidths", "foldBp", "forwardReads", "reverseReads", "mismatches", "reads", "sampled", "rows", "FORWARD_READ_COLORS", "REVERSE_READ_COLORS", "formatBp", "legendBoxStyle", "import_react", "import_mobx_react", "import_jsx_runtime", "svgStyle", "swatchStyle", "BAR_PX", "tickSwatchStyle", "TickSwatch", "color", "Swatch", "swatch", "GENE_INK", "GAP_PX", "WalkRowsLegend", "model", "bars", "calls", "row", "key", "walkRowsKey", "RAMP_GRADIENT_CSS", "legendBoxStyle", "entry", "legendRowStyle", "call", "CALL_TICK", "UNBACKED_TICK", "DISAGREES", "walkRowTrees", "sections", "rowY", "frame", "o", "walkRowsTree", "section", "k", "c", "WalkRowsOverlay", "idPrefix", "place", "pitch", "width", "canvasHeight", "Y", "y", "hovered", "r", "tree", "i", "ElTree", "header", "SECTION_HEADER_PX", "WalkRowsOverlay_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ke}from"./chunk-X4DGSMS6.js";import{a as K,b as R,c as Ye,d as $e,e as ne,f as Ze,g as Ue,i as qe,j as Je,l as Qe,m as et,n as tt,o as nt,p as ot}from"./chunk-7KFSWOWX.js";import{A as fe,C as Ve,D as je,a as w,h as Le,q as Be,r as Fe,s as De,t as _e,u as Xe,z as te}from"./chunk-GXQ7NYB3.js";import{a as Pe,j as Y}from"./chunk-GMSOU6VO.js";import{$ as ue,F as We,K as ze,Q as Ne,S as Q,T as Ae,X as Oe,Z as de,a as mn,ba as ee,h as Ie,i as Ge,z as J}from"./chunk-GB7CF6Z2.js";import{g as Ee,i as He,t as Te}from"./chunk-WTOQRUK2.js";import{z as Ce}from"./chunk-B7GF3TC3.js";import{a as pe}from"./chunk-FCWXYIFC.js";import{a as j}from"./chunk-J6KYLXRD.js";import{a as ce,b as _}from"./chunk-NXZT63HN.js";import{a as f,b as S}from"./chunk-64LZZURD.js";import{a as fn,b as a}from"./chunk-FY3BTKY4.js";var st=fn((ko,at)=>{at.exports=JBrowseExports["@jbrowse/render-core/useRenderingBackend"]});var ie=a(j(),1);function rt(t){return`${t.refName}:${(t.start+1).toLocaleString()}-${t.end.toLocaleString()}`}function me(t,e,n=r=>r){return e?{deletion:{bp:`${e.bp.toLocaleString()} bp`,where:rt(e)}}:{ends:`${n(t.from)}${t.fromStrand??""} \u2192 ${n(t.to)}${t.toStrand??""}`}}var X=a(ce(),1),Me=a(pe(),1),an=a(st(),1);var it=a(f(),1),lt=(0,w.createSvgIcon)((0,it.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 C=a(S(),1);var re=a(j(),1);var ae=a(mn(),1),ge=a(S(),1);var H=a(f(),1),A={width:18,height:8,borderRadius:2,flex:"none"},hn={marginBottom:2},gn={...A,width:48};function U({walk:t,label:e,reference:n,hint:r,at:i}){let s=Oe(t,n);return(0,H.jsxs)("div",{style:hn,title:[s.hover,r].filter(Boolean).join(" \xB7 ")||void 0,children:[(0,H.jsxs)("div",{style:R,children:[(0,H.jsx)("div",{style:{...s.shades?gn:A,background:Te(t.encoding)}}),(0,H.jsxs)("span",{children:[(0,H.jsx)("strong",{children:e}),s.delta,s.outside,s.reversed]})]}),i?(0,H.jsx)("div",{"data-testid":"graph-walk-at",children:i}):s.scale?(0,H.jsx)("div",{children:s.scale}):null]})}var I=a(j(),1);var vn=1.1,yn=100,bn=40,wn=800,kn=10,pt=2;function he(t){let e=t.deltaY*(t.deltaMode===1?bn:t.deltaMode===2?wn:1),n=(t.ctrlKey?kn:1)*e/yn;return vn**-Math.max(-pt,Math.min(pt,n))}var ct=a(pe(),1);function oe(t,e){(0,I.useEffect)(()=>{if(!t)return;let n=t;function r(i){if(e.hostPlacesX)return;e.host&&i.stopPropagation(),i.preventDefault();let s=n.getBoundingClientRect();e.zoom(he(i),i.clientX-s.left,i.clientY-s.top)}return n.addEventListener("wheel",r,{passive:!1}),()=>{n.removeEventListener("wheel",r)}},[t,e])}function dt(t){let e=(0,I.useRef)({x:0,y:0}),n=(0,I.useRef)(!1),r=(0,I.useRef)({frame:0,pan:null,hover:null});(0,I.useEffect)(()=>()=>{cancelAnimationFrame(r.current.frame)},[]);let[i,s]=(0,I.useState)(void 0),[c,l]=(0,I.useState)(void 0);function d(p,g){return{x:(p-t.translateX)/t.scaleX,y:(g-t.translateY)/t.scaleY}}function h(p){let g=p.currentTarget.getBoundingClientRect();return d(p.clientX-g.left,p.clientY-g.top)}function u(p,g){let{nodePositions:b}=t,v=p*t.scaleX+t.translateX,M=g*t.scaleY+t.translateY;if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(v,M);let Re=t.referenceStripNodeAt(v,M);return Re||(b?de(b,p,g,t.axisScale,t.positionsVersion,t.nodeInk):null)}function m(p){if(p.button===0){if(n.current=!1,t.hostPlacesX)return;t.host&&p.stopPropagation();let{x:g,y:b}=h(p),v=t.layoutResult?.tubeMap||p.nativeEvent.offsetY<t.referenceStripZonePx?null:u(g,b);v?t.setDraggingNode(v):t.setPanning(!0),e.current={x:p.clientX,y:p.clientY}}}function L(){let p=r.current;p.frame=0,p.pan&&(t.setTransform(t.scale,t.translateX+p.pan.dx,t.translateY+p.pan.dy),p.pan=null);let g=t.walkRowBars;if(p.hover&&g){let b=t.walkRowAt(p.hover.x,p.hover.y);t.setHoveredWalkRow(b===void 0?null:[g.reference,...g.rows][b].name)}if(p.hover&&t.nodePositions&&t.graph){let{x:b,y:v}=d(p.hover.x,p.hover.y);p.hover=null;let M=u(b,v);t.setHoveredNode(M),t.setHoveredEdge(M||t.layoutResult?.tubeMap?null:ue(t.nodePositions,t.graph,b,v,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded))}}function P(){r.current.frame||(r.current.frame=requestAnimationFrame(L))}function le(){let p=r.current;cancelAnimationFrame(p.frame),p.frame=0,p.pan=null,p.hover=null}function V(p){let g=p.clientX-e.current.x,b=p.clientY-e.current.y;e.current={x:p.clientX,y:p.clientY},(Math.abs(g)>1||Math.abs(b)>1)&&(n.current=!0);let v=r.current;if(t.draggingNode)t.moveNode(t.draggingNode,g/t.scaleX,b/t.scaleY);else if(t.isPanning)v.pan={dx:(v.pan?.dx??0)+g,dy:(v.pan?.dy??0)+b},P();else{let M=p.currentTarget.getBoundingClientRect();v.hover={x:p.clientX-M.left,y:p.clientY-M.top},P()}}function pn(){t.stopDragging()}function cn(){le(),(0,ct.isAlive)(t)&&(t.stopDragging(),t.setHoveredNode(null),t.setHoveredEdge(null),t.setHoveredWalkRow(null))}function dn(p){let{x:g,y:b}=h(p),v=u(g,b);if(v){p.preventDefault(),s({nodeId:v,top:p.clientY,left:p.clientX});return}let M=t.walkRowAt(g*t.scaleX+t.translateX,b*t.scaleY+t.translateY);M!==void 0&&(p.preventDefault(),l({row:M,top:p.clientY,left:p.clientX}))}function un(p){if(!n.current){let{x:g,y:b}=h(p),v=u(g,b);t.setSelectedNode(v),v&&t.showNodeDetails(v)}}return{handlers:{onMouseDown:m,onMouseMove:V,onMouseUp:pn,onMouseLeave:cn,onClick:un,onContextMenu:dn},contextNode:i,contextRow:c,closeContextMenu:()=>{s(void 0),l(void 0)}}}var W=a(f(),1),Sn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:Ie,lineHeight:"normal"},xn={height:Ge,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},Mn=(0,ge.observer)(function({model:e,lift:n,width:r,height:i,cell:s,handlers:c}){let[l,d]=(0,re.useState)(null),h=n.walks[0];oe(l,e),(0,re.useEffect)(()=>{if(!l)return;let m=new Q(l);m.resize(r,i);let L=(0,ae.computed)(()=>e.buildDrawing(n,!1)),P,le=(0,ae.autorun)(()=>{let V=L.get();V&&(V!==P&&(m.uploadGeometry(V.batch),P=V),e.applyHighlights(m),e.paint(m))});return()=>{le(),m.dispose()}},[l,e,n,r,i]);let u=e.walkLabel(h.name);return(0,W.jsxs)("div",{style:s,children:[(0,W.jsx)("button",{type:"button",style:xn,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([h.name]),e.setFacet("")},children:(0,W.jsx)(U,{walk:h,label:u,reference:e.walkReference,hint:`click to lift ${u} alone`,at:e.hoveredOn(h)})}),(0,W.jsx)("canvas",{ref:d,"data-testid":"graph-facet-canvas",style:{width:r,height:i,display:"block",cursor:e.isPanning||e.draggingNode?"grabbing":"grab"},...c})]})}),Rn=(0,ge.observer)(function({model:e,handlers:n}){let r=e.facetPanels,i=e.facetGrid,s=e.facetPlacement;if(!r||!i||!s)return null;let{columns:c,width:l,height:d}=i;return(0,W.jsx)("div",{"data-testid":"graph-facet-panels",style:{...Sn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${c}, ${l}px)`,background:e.darkMode?"#1f1f1f":"white"},children:r.map((h,u)=>(0,W.jsx)(Mn,{model:e,lift:h,width:l,height:d,cell:{gridRow:Math.floor(s.cells[u]/c)+1,gridColumn:s.cells[u]%c+1},handlers:n},h.walks[0].name))})}),ut=Rn;var ft=a(f(),1),mt=(0,w.createSvgIcon)((0,ft.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 ve=a(f(),1),ht=(0,w.createSvgIcon)([(0,ve.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,ve.jsx)("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var gt=a(f(),1),vt=(0,w.createSvgIcon)((0,gt.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 E=a(_(),1),ke=a(S(),1),At=a(Y(),1);var z=a(_(),1),yt=a(S(),1),bt=a(Y(),1),$=a(f(),1),Cn=(0,bt.makeStyles)()({formControl:{minWidth:100}}),Ln=(0,yt.observer)(function({model:e}){let{classes:n}=Cn(),r=e.colorSchemeLock;return(0,$.jsxs)(z.FormControl,{size:"small",className:n.formControl,disabled:r!==void 0,title:r?.why,children:[(0,$.jsx)(z.InputLabel,{children:"Color"}),(0,$.jsx)(z.Select,{value:e.chosenColorScheme,label:"Color",renderValue:r?()=>r.value:void 0,onChange:i=>{e.setColorScheme(i.target.value)},children:Pe.map(({value:i,label:s})=>(0,$.jsx)(z.MenuItem,{value:i,children:s},i))})]})}),wt=Ln;var be=a(_(),1),we=a(S(),1),kt=a(Y(),1),Z=a(f(),1),St=(0,kt.makeStyles)()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function ye(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var Pn=(0,we.observer)(function({model:e}){let{classes:n}=St(),{lastFetchMs:r,lastLayoutMs:i,lastGeometryMs:s}=e,c=r!==void 0||i!==void 0||s!==void 0;return e.showPerf&&c?(0,Z.jsxs)(be.Typography,{variant:"caption",className:n.perf,"data-testid":"graph-perf-stats",children:["fetch ",ye(r)," \xB7 layout ",ye(i)," \xB7 geom"," ",ye(s)]}):null}),In=(0,we.observer)(function({model:e}){let{classes:n}=St();return(0,Z.jsxs)("div",{className:n.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,Z.jsxs)(be.Typography,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",(0,Z.jsx)(Pn,{model:e})]})}),xt=In;var G=a(_(),1),Mt=a(S(),1),Rt=a(Y(),1),N=a(f(),1),Gn=(0,Rt.makeStyles)()({formControl:{minWidth:150}}),En=(0,Mt.observer)(function({model:e}){let{classes:n}=Gn(),{graph:r}=e;return(0,N.jsxs)(G.FormControl,{size:"small",className:n.formControl,children:[(0,N.jsx)(G.InputLabel,{children:"Layout"}),(0,N.jsx)(G.Select,{value:e.chosenLayoutMode,label:"Layout","data-testid":"graph-layout-select",onChange:i=>{e.switchLayout(i.target.value)},children:Le.map(({value:i,label:s,description:c,available:l})=>(0,N.jsx)(G.MenuItem,{value:i,disabled:r?!l(r):!1,children:(0,N.jsx)(G.Tooltip,{title:c,placement:"right",children:(0,N.jsx)("span",{children:s})})},i))})]})}),Ct=En;var T=a(_(),1),Lt=a(S(),1),Pt=a(Y(),1),B=a(f(),1),Hn=(0,Pt.makeStyles)()({formControl:{minWidth:130,maxWidth:240}}),Tn=(0,Lt.observer)(function({model:e}){let{classes:n}=Hn(),{repeatChoices:r}=e;if(e.chosenLayoutMode!=="walkrows"||r.length===0)return null;let i=new Set(r.map(s=>s.key));return(0,B.jsxs)(T.FormControl,{size:"small",className:n.formControl,children:[(0,B.jsx)(T.InputLabel,{children:"Repeat"}),(0,B.jsxs)(T.Select,{value:i.has(e.repeatKey)?e.repeatKey:"",label:"Repeat","data-testid":"graph-repeat-select",onChange:s=>{e.setRepeatKey(s.target.value)},children:[(0,B.jsx)(T.MenuItem,{value:"",children:(0,B.jsx)("em",{children:"Whole window"})}),r.map(({key:s,name:c,unit:l})=>(0,B.jsxs)(T.MenuItem,{value:s,children:[c," \xB7 ",l.toLocaleString()," bp unit"]},s))]})]})}),It=Tn;var Wt=a(j(),1),zt=a(ce(),1);var Gt=a(f(),1),Et=(0,w.createSvgIcon)((0,Gt.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 Ht=a(f(),1),Tt=(0,w.createSvgIcon)((0,Ht.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 Nt=a(S(),1);var F=a(f(),1),Wn=(0,Nt.observer)(function({model:e}){let[n,r]=(0,Wt.useState)(!1);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(zt.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.toggleDeletionEdges()}},{type:"checkbox",label:"Show timings",checked:e.showPerf,onClick:()=>{e.setShowPerf(!e.showPerf)}},{type:"divider"},{label:"Settings",icon:je,onClick:()=>{r(!0)}},{type:"divider"},{label:"Return to import form",icon:Et,onClick:()=>{e.clearGraph()}}],children:(0,F.jsx)(Tt,{})}),(0,F.jsx)(Ke,{model:e,open:n,onClose:()=>{r(!1)}})]})}),Bt=Wn;var x=a(_(),1),Ft=a(S(),1),Dt=a(Y(),1),D=a(f(),1),zn=(0,Dt.makeStyles)()({formControl:{minWidth:130,maxWidth:260}}),Nn=(0,Ft.observer)(function({model:e}){let{classes:n}=zn(),{walkChoices:r}=e;if(r.length===0||!e.liftsWalks)return null;let i=new Set(r.map(l=>l.name)),s=new Map(r.map(l=>[l.name,l.label])),c=e.walkLayers.map(l=>l.walk).filter(l=>i.has(l));return(0,D.jsxs)(x.FormControl,{size:"small",className:n.formControl,children:[(0,D.jsx)(x.InputLabel,{children:"Walks"}),(0,D.jsx)(x.Select,{multiple:!0,value:c,label:"Walks","data-testid":"graph-walk-select",renderValue:l=>l.map(d=>s.get(d)).join(", "),onChange:l=>{let{value:d}=l.target;e.liftWalks(typeof d=="string"?d.split(","):d)},children:r.map(({name:l,label:d})=>(0,D.jsxs)(x.MenuItem,{value:l,dense:!0,children:[(0,D.jsx)(x.Checkbox,{size:"small",checked:c.includes(l)}),(0,D.jsx)(x.ListItemText,{primary:d})]},l))})]})}),_t=Nn;var y=a(f(),1),Bn=(0,At.makeStyles)()({toolbar:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),Fn=(0,ke.observer)(function({model:e}){return(0,y.jsx)(E.Typography,{variant:"body2",children:e.zoomPercent})}),Dn=(0,ke.observer)(function({model:e}){let{classes:n}=Bn();return(0,y.jsxs)("div",{className:n.toolbar,children:[(0,y.jsx)(Ct,{model:e}),(0,y.jsx)(wt,{model:e}),(0,y.jsx)(_t,{model:e}),(0,y.jsx)(It,{model:e}),(0,y.jsx)(E.Tooltip,{title:"Zoom in",children:(0,y.jsx)(E.IconButton,{size:"small",onClick:()=>{e.zoom(1.5,e.viewBox.width/2,e.viewBox.height/2)},children:(0,y.jsx)(ht,{})})}),(0,y.jsx)(E.Tooltip,{title:"Zoom out",children:(0,y.jsx)(E.IconButton,{size:"small",onClick:()=>{e.zoom(1/1.5,e.viewBox.width/2,e.viewBox.height/2)},children:(0,y.jsx)(vt,{})})}),(0,y.jsx)(E.Tooltip,{title:"Zoom to fit",children:(0,y.jsx)(E.IconButton,{size:"small",onClick:()=>{e.zoomToFit()},children:(0,y.jsx)(mt,{})})}),(0,y.jsx)(Fn,{model:e}),(0,y.jsx)(xt,{model:e}),(0,y.jsx)(Bt,{model:e})]})}),Ot=Dn;var Xt=a(_(),1),Vt=a(S(),1),$t=a(f(),1),_n={position:"absolute",left:8,zIndex:5,background:"rgba(255,255,255,0.9)",textTransform:"none"},An=(0,Vt.observer)(function({model:e}){let{poppedFrom:n}=e;return n?(0,$t.jsxs)(Xt.Button,{size:"small",variant:"outlined",style:{..._n,...e.facetPanels?{bottom:8}:{top:8}},"data-testid":"graph-unpop-bubble",onClick:()=>{e.unpopBubble()},children:["\u25C0 Back to ",n.label]}):null}),Yt=An;var qt=a(ce(),1);var Zt=a(f(),1),jt=(0,w.createSvgIcon)((0,Zt.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var Kt=a(f(),1),Ut=(0,w.createSvgIcon)((0,Kt.jsx)("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 Jt=a(S(),1);var Qt=a(f(),1),se=(0,Jt.observer)(function({model:e,row:n,bars:r,top:i,left:s,onClose:c}){let l=r??e.walkRowBars,d=e.walkRowLaunchTarget(n,l),h=d?.assembly,u=n>0?l?.rows[n-1]?.sample:void 0,m=!r&&e.walkRowBars,L=e.walkRowSamples;return(0,Qt.jsx)(qt.Menu,{open:!0,anchorReference:"anchorPosition",anchorPosition:{top:i,left:s},onClose:()=>{c()},onMenuItemClick:P=>{P()},menuItems:[d&&h?{label:`Linear genome view \u2014 ${h} ${te(d.location)}`,icon:fe,onClick:()=>{e.showInLinearView({location:d.location,assembly:h})}}:{label:"Linear genome view",icon:fe,disabled:!0,disabledHelpText:d?`No assembly in this session is ${d.location.haplotype??d.label}`:"This walk states no contig coordinates",onClick:()=>{}},...m&&u&&!(L?.length===1&&L[0]===u)?[{label:`Show only ${u}`,icon:jt,onClick:()=>{e.setWalkRowSamples([u])}}]:[],...m&&L?[{label:"Show every sample",icon:Ut,onClick:()=>{e.setWalkRowSamples(void 0)}}]:[]]})});var O=a(j(),1);var en=a(pe(),1),Se=a(S(),1);var k=a(f(),1),On={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},Xn={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},Vn=(0,Se.observer)(function({bars:e,frame:n,ramp:r,rowGenes:i}){let s=(0,O.useId)().replace(/[^\w-]/g,""),c=(0,O.useMemo)(()=>Ne(e,n,{ramp:r,rowGenes:i,idPrefix:s}),[e,n,r,i,s]);return(0,k.jsx)(ne,{el:c})}),Yn=(0,Se.observer)(function({model:e}){let n=e.walkStripRows,r=e.walkStripFrame,[i,s]=(0,O.useState)(void 0),[c,l]=(0,O.useState)(void 0);if(!n||!r)return null;let d=u=>{let m=u.currentTarget.getBoundingClientRect(),L=u.clientX-m.left,P=u.clientY-m.top;return{...Be(n,r,L,P),x:L,y:P}},h=ze(n,{ramp:e.referenceRampDomain,rampCss:J,genes:_e(r,e.walkRowGenes,e.walkRowGeneGaps)});return(0,k.jsxs)("div",{"data-testid":"graph-walk-strip",style:{position:"relative",borderTop:"1px solid #ddd"},onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{(0,en.isAlive)(e)&&(e.setPointerInPane(!1),e.setStripHover(null)),l(void 0)},children:[(0,k.jsxs)("svg",{width:r.width,height:r.height,style:{display:"block",cursor:"pointer"},onMouseMove:u=>{let m=d(u);m.row?(e.setStripHover({row:m.row.name,offset:m.offset}),l(r.labelled?void 0:{text:`${m.row.label} \xB7 ${We(m.row,m.index===0?void 0:n.reference)}`,x:m.x,y:m.y})):(e.setStripHover(null),l(void 0))},onClick:u=>{let m=d(u);m.row&&m.index>0&&e.toggleWalk(m.row.name)},onContextMenu:u=>{let m=d(u);m.row&&(u.preventDefault(),s({row:m.index,top:u.clientY,left:u.clientX}))},children:[(0,k.jsx)(Vn,{bars:n,frame:r,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),(0,k.jsx)(ne,{el:Fe(n,r,e.walkStripMarks)}),(0,k.jsx)(ne,{el:De(n,r,new Set(e.walkLayers.map(u=>u.walk)))})]}),c?(0,k.jsx)("div",{style:{...Xn,left:c.x+12,top:c.y-18},children:c.text}):null,(0,k.jsxs)("div",{style:On,"data-testid":"graph-walk-strip-key",children:[h.map(u=>(0,k.jsxs)("div",{style:R,children:[(0,k.jsx)(tt,{swatch:u.swatch}),(0,k.jsx)("span",{children:u.label})]},u.label)),(0,k.jsx)("div",{style:R,children:(0,k.jsx)("span",{children:"\u25AE ticks: where each walk passes the node under the pointer \xB7 click a bar to lift its walk"})})]}),i?(0,k.jsx)(se,{model:e,row:i.row,bars:n,top:i.top,left:i.left,onClose:()=>{s(void 0)}}):null]})}),tn=Yn;var nn=a(S(),1),q=a(f(),1),$n={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:4},Zn=(0,nn.observer)(function({model:e}){let n=e.walkStripLocator;return n?(0,q.jsxs)("svg",{style:$n,width:e.paneWidth,height:e.canvasHeight,"data-testid":"graph-walk-strip-locator",children:[(0,q.jsx)("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"white",strokeWidth:4}),(0,q.jsx)("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"#111",strokeWidth:1.75})]}):null}),on=Zn;function rn(t){return Promise.resolve(new Q(t))}var o=a(f(),1),xe={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},jn={position:"relative"},Kn={position:"relative",lineHeight:0,isolation:"isolate"},Un={position:"absolute",left:0,right:0,bottom:0,zIndex:0},qn={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},Jn={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},Qn=(0,C.observer)(function({model:e}){let n=e.drawnRowLabels;return(0,o.jsx)(o.Fragment,{children:n.map(({label:r,y:i})=>{let s=i*e.scaleY+e.translateY;return s>=0&&s<=e.canvasHeight?(0,o.jsx)("div",{"data-testid":"graph-row-label",style:{...Jn,top:s},children:r},i):null})})}),eo={position:"absolute",top:ee,right:ee,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none",zIndex:4},to={width:18,height:3,borderRadius:2},no=(0,C.observer)(function({model:e}){let{pathLegend:n}=e;return n.length>0?(0,o.jsx)("div",{style:K,"data-testid":"graph-path-legend",children:n.map(({name:r,label:i,color:s})=>(0,o.jsxs)("div",{style:R,children:[(0,o.jsx)("div",{style:{...to,backgroundColor:s}}),(0,o.jsx)("span",{children:i})]},r))}):null}),oo=(0,C.observer)(function({model:e}){let n=e.walkLift;return n?(0,o.jsxs)("div",{style:K,"data-testid":"graph-walk-readout",children:[n.walks.map(r=>(0,o.jsx)(U,{walk:r,label:e.walkLabel(r.name),reference:e.walkReference,at:e.hoveredOn(r)},r.name)),e.liftPaintsOffReference?(0,o.jsx)(sn,{}):null,(0,o.jsxs)("div",{style:R,children:[(0,o.jsx)("div",{style:{...A,background:Ee}}),(0,o.jsxs)("span",{children:["not on ",e.liftedWalksLabel]})]})]}):null}),ro={minWidth:90,height:8,borderRadius:2,background:J},ao={display:"flex",justifyContent:"space-between",gap:8},so=(0,C.observer)(function({model:e}){let n=e.walkLift?void 0:e.referenceRampDomain,{offReference:r,unplaced:i}=e.referenceRampOffKeys,s=Math.round(n?.start??0),c=Math.round(n?.end??0);return n?(0,o.jsxs)("div",{style:K,"data-testid":"graph-ramp-legend",children:[(0,o.jsx)("div",{style:ro}),(0,o.jsxs)("div",{style:ao,children:[(0,o.jsx)("span",{children:s.toLocaleString()}),(0,o.jsxs)("span",{children:["(",Ce(c-s),")"]}),(0,o.jsx)("span",{children:c.toLocaleString()})]}),r?(0,o.jsx)(sn,{}):null,i?(0,o.jsxs)("div",{style:R,children:[(0,o.jsx)("div",{style:{...A,background:io}}),(0,o.jsx)("span",{children:"no reference position"})]}):null]}):null}),io="rgb(160, 160, 160)";function sn(){return(0,o.jsxs)("div",{style:R,children:[(0,o.jsx)("div",{style:{...A,background:He}}),(0,o.jsx)("span",{children:"off the reference"})]})}var lo={...A,border:`2px solid ${Ae}`,borderRadius:5,boxSizing:"border-box"},po=(0,C.observer)(function({model:e}){return e.genePins.some(n=>n.exonsByNode.length>0)?(0,o.jsx)("div",{style:K,"data-testid":"graph-gene-legend",children:(0,o.jsxs)("div",{style:R,children:[(0,o.jsx)("div",{style:lo}),(0,o.jsx)("span",{children:"exon"})]})}):null}),ln={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},co={...ln,color:"#18181c",fontWeight:600},uo={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible",zIndex:2},fo=(0,C.observer)(function({model:e}){let n=(0,ie.useRef)(null);return(0,ie.useEffect)(()=>{let r=n.current;if(!r)return;let i=new ResizeObserver(()=>{(0,Me.isAlive)(e)&&e.hoveredNode===null&&e.setLegendSize({width:r.offsetWidth,height:r.offsetHeight})});return i.observe(r),()=>{i.disconnect()}},[e]),(0,o.jsxs)("div",{ref:n,style:{...eo,top:ee+e.referenceStripZonePx},children:[(0,o.jsx)(so,{model:e}),(0,o.jsx)(Je,{model:e}),(0,o.jsx)($e,{model:e}),(0,o.jsx)(po,{model:e}),(0,o.jsx)(no,{model:e}),(0,o.jsx)(et,{model:e}),(0,o.jsx)(nt,{model:e}),(0,o.jsx)(oo,{model:e})]})}),mo=(0,C.observer)(function({model:e}){let n=e.overlayLabels.sizes,r=n.flatMap(({key:i,leader:s})=>s?[{key:i,...s}]:[]);return(0,o.jsxs)(o.Fragment,{children:[r.length>0?(0,o.jsx)("svg",{style:uo,width:e.paneWidth,height:e.canvasHeight,children:r.map(({key:i,arcX:s,arcY:c,labelX:l,labelY:d})=>(0,o.jsx)("line",{"data-testid":"graph-label-leader",x1:s,y1:c,x2:l,y2:d,stroke:"#18181c",strokeWidth:1},i))}):null,n.map(({key:i,text:s,x:c,y:l,kind:d})=>(0,o.jsx)("div",{"data-testid":"graph-size-label",style:{...d==="deletion"?co:ln,left:c,top:l},children:s},i))]})}),ho=(0,C.observer)(function({model:e}){let n=e.hoveredNode?e.nodeById?.get(e.hoveredNode):null,r=e.hoveredEdge!==null&&e.graph?e.graph.edges[e.hoveredEdge]:null,i=n?Xe(n):void 0,s=r?me(r,e.deletions.find(l=>l.edgeIndex===e.hoveredEdge),l=>e.nodeById?.get(l)?.name??l):void 0,c=e.hoveredWalkRowText;return(0,o.jsxs)(o.Fragment,{children:[c&&!n?(0,o.jsxs)("div",{style:xe,"data-testid":"graph-walk-row-tooltip",children:[(0,o.jsx)("strong",{children:c.label})," \u2014 ",c.readout]}):null,n?(0,o.jsxs)("div",{style:xe,children:[(0,o.jsx)("strong",{children:n.name})," \u2014"," ",n.length.toLocaleString()," bp, depth"," ",n.depth.toFixed(1),i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("br",{}),i.sample," ",te(i)," (rank"," ",n.stable?.rank,")"]}):null]}):null,s?(0,o.jsx)("div",{style:xe,children:s.deletion?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("strong",{children:"Deletion"})," ",s.deletion.bp,(0,o.jsx)("br",{}),s.deletion.where]}):(0,o.jsxs)(o.Fragment,{children:["Edge: ",s.ends]})}):null]})}),go=(0,C.observer)(function({model:e,nodeId:n,top:r,left:i,onClose:s}){let{own:c,reference:l,highlight:d}=e.nodeLaunchTargets(n);return(0,o.jsx)(X.Menu,{open:!0,anchorReference:"anchorPosition",anchorPosition:{top:r,left:i},onClose:()=>{s()},onMenuItemClick:h=>{h()},menuItems:[{label:"Node details",icon:lt,onClick:()=>{e.showNodeDetails(n)}},...Ve({own:c,reference:l,highlight:d,onShowLinear:h=>{e.showInLinearView(h)},onHighlight:e.canHighlightInLinearView?h=>{e.highlightInLinearView(h)}:void 0})]})}),vo=(0,C.observer)(function({model:e,ownChrome:n=!0}){let{canvasRef:r,canvas:i,error:s,retry:c}=(0,an.useRenderingBackend)(rn,e),{handlers:l,contextNode:d,contextRow:h,closeContextMenu:u}=dt(e);oe(i,e);let m=e.facetPanels!==void 0;return(0,o.jsxs)("div",{style:jn,children:[n?(0,o.jsx)(Ot,{model:e}):null,(0,o.jsxs)("div",{style:Kn,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{(0,Me.isAlive)(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?(0,o.jsx)("div",{style:{...Un,top:e.referenceStripZonePx,background:e.paperCss}}):null,(0,o.jsx)("canvas",{ref:r,"data-testid":"graph-genome-canvas",style:{width:e.paneWidth,height:e.canvasHeight,cursor:e.isPanning||e.draggingNode?"grabbing":"grab",display:"block",position:"relative",zIndex:1},...l}),m?(0,o.jsx)(ut,{model:e,handlers:l}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Qe,{model:e}),(0,o.jsx)(qe,{model:e}),(0,o.jsx)(Qn,{model:e}),(0,o.jsx)(mo,{model:e}),(0,o.jsx)(Ye,{model:e}),(0,o.jsx)(Ze,{model:e}),(0,o.jsx)(Ue,{model:e}),(0,o.jsx)(ot,{model:e}),(0,o.jsx)(on,{model:e}),(0,o.jsx)(fo,{model:e})]}),(0,o.jsx)(Yt,{model:e}),n?(0,o.jsx)("div",{style:qn,children:(0,o.jsx)(X.LoadingOverlay,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null]}),e.walkStripShown?(0,o.jsx)(tn,{model:e}):null,(0,o.jsx)(ho,{model:e}),d?(0,o.jsx)(go,{model:e,nodeId:d.nodeId,top:d.top,left:d.left,onClose:u}):null,h?(0,o.jsx)(se,{model:e,row:h.row,top:h.top,left:h.left,onClose:u}):null,s?(0,o.jsx)(X.ErrorBanner,{error:s,onReset:c}):null,n&&e.error?(0,o.jsx)(X.ErrorBanner,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),ba=vo;export{ba as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AMD4KXQV.js.map
|