jbrowse-plugin-graphgenomeviewer 10.4.2 → 10.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddTrackWorkflow-P5APNL32.js → AddTrackWorkflow-D4QSDNWI.js} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js → GbzBaseSyntenyAdapter-RM4CXLLF.js} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-46A4LMVD.js.map → GbzBaseSyntenyAdapter-RM4CXLLF.js.map} +1 -1
- package/dist/chunks/{GraphGenomeView-MXRAP7QB.js → GraphGenomeView-QQFYOKM5.js} +2 -2
- package/dist/chunks/GraphSettingsDialog-D6WOU4CU.js +2 -0
- package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js → HighlightColorDialog-NNQM2AER.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-OFZQJHYG.js +2 -0
- package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js → MinigraphBubbleAdapter-JBYQHQRT.js} +2 -2
- package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js → RgfaTabixAdapter-6FJWPEHW.js} +2 -2
- package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js → WalkFormsAdapter-IRGWL2G4.js} +2 -2
- package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js → WalkTabixSyntenyAdapter-7RQNFBIG.js} +2 -2
- package/dist/chunks/{chunk-SMZZWPRX.js → chunk-5RK2OJEU.js} +2 -2
- package/dist/chunks/{chunk-SMZZWPRX.js.map → chunk-5RK2OJEU.js.map} +3 -3
- package/dist/chunks/{chunk-43EUXRKZ.js → chunk-5VZ5HRTH.js} +2 -2
- package/dist/chunks/{chunk-43EUXRKZ.js.map → chunk-5VZ5HRTH.js.map} +1 -1
- package/dist/chunks/chunk-6GJELLIC.js +2 -0
- package/dist/chunks/chunk-6GJELLIC.js.map +7 -0
- package/dist/chunks/{chunk-TM22QR6V.js → chunk-6T2VBP7Z.js} +2 -2
- package/dist/chunks/{chunk-TM22QR6V.js.map → chunk-6T2VBP7Z.js.map} +1 -1
- package/dist/chunks/{chunk-5N4B6FEH.js → chunk-7YC64WD6.js} +2 -2
- package/dist/chunks/{chunk-52BUFQHJ.js → chunk-AYJ6SUB5.js} +6 -6
- package/dist/chunks/{chunk-52BUFQHJ.js.map → chunk-AYJ6SUB5.js.map} +2 -2
- package/dist/chunks/{chunk-RUKWE5MB.js → chunk-BPCYXZWU.js} +2 -2
- package/dist/chunks/{chunk-RDTLCMD2.js → chunk-E55FR7S6.js} +1 -1
- package/dist/chunks/{chunk-RDTLCMD2.js.map → chunk-E55FR7S6.js.map} +1 -1
- package/dist/chunks/{chunk-DZXYOIGJ.js → chunk-ESUDWLHY.js} +2 -2
- package/dist/chunks/{chunk-E3GNTGWW.js → chunk-FSBDVHNR.js} +1 -1
- package/dist/chunks/{chunk-E3GNTGWW.js.map → chunk-FSBDVHNR.js.map} +1 -1
- package/dist/chunks/{chunk-4QYWBDUL.js → chunk-G7MXYOW5.js} +2 -2
- package/dist/chunks/{chunk-4QYWBDUL.js.map → chunk-G7MXYOW5.js.map} +1 -1
- package/dist/chunks/{chunk-WBDZVWK4.js → chunk-GZROPRBI.js} +2 -2
- package/dist/chunks/{chunk-WBDZVWK4.js.map → chunk-GZROPRBI.js.map} +1 -1
- package/dist/chunks/{chunk-E5ERNAYL.js → chunk-HHK5MBID.js} +1 -1
- package/dist/chunks/{chunk-E5ERNAYL.js.map → chunk-HHK5MBID.js.map} +1 -1
- package/dist/chunks/{chunk-2TMZO3P5.js → chunk-JFNEV3BY.js} +2 -2
- package/dist/chunks/{chunk-N2TMTGYP.js → chunk-JXMFPTPM.js} +2 -2
- package/dist/chunks/{chunk-VY7G4FSX.js → chunk-LOT3BKM3.js} +2 -2
- package/dist/chunks/{chunk-VY7G4FSX.js.map → chunk-LOT3BKM3.js.map} +2 -2
- package/dist/chunks/{chunk-L7ZSEA4T.js → chunk-MX7R2F3F.js} +2 -2
- package/dist/chunks/{chunk-L7ZSEA4T.js.map → chunk-MX7R2F3F.js.map} +1 -1
- package/dist/chunks/{chunk-YIGESHTA.js → chunk-NSWRDOLS.js} +2 -2
- package/dist/chunks/{chunk-YIGESHTA.js.map → chunk-NSWRDOLS.js.map} +1 -1
- package/dist/chunks/{chunk-AC5KEN36.js → chunk-NZ7YFVK4.js} +2 -2
- package/dist/chunks/{chunk-AC5KEN36.js.map → chunk-NZ7YFVK4.js.map} +1 -1
- package/dist/chunks/chunk-PZGI7L73.js +5 -0
- package/dist/chunks/chunk-PZGI7L73.js.map +7 -0
- package/dist/chunks/{chunk-YLB6GKFG.js → chunk-S4BXLNAH.js} +2 -2
- package/dist/chunks/{chunk-YLB6GKFG.js.map → chunk-S4BXLNAH.js.map} +1 -1
- package/dist/chunks/{chunk-QOMV5OG7.js → chunk-SRA6CKRA.js} +2 -2
- package/dist/chunks/{renderSvg-4AG3PPI5.js → renderSvg-5YYSAMUL.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -1
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
- package/dist/chunks/GraphSettingsDialog-HIOYWTO7.js +0 -2
- package/dist/chunks/LinearGraphDisplay-KPWFPVFK.js +0 -2
- package/dist/chunks/chunk-BLE63OIT.js +0 -2
- package/dist/chunks/chunk-BLE63OIT.js.map +0 -7
- package/dist/chunks/chunk-M5XKM6D2.js +0 -5
- package/dist/chunks/chunk-M5XKM6D2.js.map +0 -7
- /package/dist/chunks/{AddTrackWorkflow-P5APNL32.js.map → AddTrackWorkflow-D4QSDNWI.js.map} +0 -0
- /package/dist/chunks/{GraphGenomeView-MXRAP7QB.js.map → GraphGenomeView-QQFYOKM5.js.map} +0 -0
- /package/dist/chunks/{GraphSettingsDialog-HIOYWTO7.js.map → GraphSettingsDialog-D6WOU4CU.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-UKFUS5S4.js.map → HighlightColorDialog-NNQM2AER.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-KPWFPVFK.js.map → LinearGraphDisplay-OFZQJHYG.js.map} +0 -0
- /package/dist/chunks/{MinigraphBubbleAdapter-QSPPG4LG.js.map → MinigraphBubbleAdapter-JBYQHQRT.js.map} +0 -0
- /package/dist/chunks/{RgfaTabixAdapter-UPCOXYVG.js.map → RgfaTabixAdapter-6FJWPEHW.js.map} +0 -0
- /package/dist/chunks/{WalkFormsAdapter-LHKGRYC6.js.map → WalkFormsAdapter-IRGWL2G4.js.map} +0 -0
- /package/dist/chunks/{WalkTabixSyntenyAdapter-ELTYD73I.js.map → WalkTabixSyntenyAdapter-7RQNFBIG.js.map} +0 -0
- /package/dist/chunks/{chunk-5N4B6FEH.js.map → chunk-7YC64WD6.js.map} +0 -0
- /package/dist/chunks/{chunk-RUKWE5MB.js.map → chunk-BPCYXZWU.js.map} +0 -0
- /package/dist/chunks/{chunk-DZXYOIGJ.js.map → chunk-ESUDWLHY.js.map} +0 -0
- /package/dist/chunks/{chunk-2TMZO3P5.js.map → chunk-JFNEV3BY.js.map} +0 -0
- /package/dist/chunks/{chunk-N2TMTGYP.js.map → chunk-JXMFPTPM.js.map} +0 -0
- /package/dist/chunks/{chunk-QOMV5OG7.js.map → chunk-SRA6CKRA.js.map} +0 -0
- /package/dist/chunks/{renderSvg-4AG3PPI5.js.map → renderSvg-5YYSAMUL.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as Y,j as X,m as q,q as S}from"./chunk-
|
|
1
|
+
import{f as Y,j as X,m as q,q as S}from"./chunk-NZ7YFVK4.js";import{g as K}from"./chunk-NSWRDOLS.js";import{la as w,o as $,ra as L}from"./chunk-6GJELLIC.js";import{c as U,d as Q,e as z}from"./chunk-D3QZGLZ3.js";import{f as M,h as I,i as C}from"./chunk-J2PN6CG3.js";import{A as _,E as B,F as W,G as T,I as y,d as H,n as P,o as G,q as D,r as E,t as A,u as F,x as O,z as R}from"./chunk-H42TSPVA.js";import{b as o,c as i,d as p}from"./chunk-DUU6T2I5.js";var x=[{value:0,label:"Fastest"},{value:1,label:"Fast"},{value:2,label:"Default"},{value:3,label:"Fine"},{value:4,label:"Best"}];var v=p(function({label:a,value:e,options:n,testId:r,size:t,sx:d,disabled:f,title:h,shown:b,onChange:g}){let u=M();return i(A,{size:t,sx:d,disabled:f,title:h,children:[o(O,{id:u,shrink:!0,children:a}),o(B,{labelId:u,value:e,label:a,notched:!0,displayEmpty:!0,"data-testid":r,renderValue:s=>b??n.find(oe=>oe.value===s)?.label??s,onChange:s=>{g(s.target.value)},children:n.map(s=>o(_,{value:s.value,disabled:s.disabled,title:s.disabled?void 0:s.description,children:o(R,{primary:s.label,secondary:s.disabled?s.description:void 0})},s.value))})]})});var ae=S()({section:{marginBottom:24}}),ne=[{value:"0",label:"None"},{value:"1",label:"1 hop"},{value:"2",label:"2 hops"}],re=p(function({model:a}){let{classes:e}=ae(),n=a.sourceAdapter;return n?.type==="RgfaTabixAdapter"&&!U(n)?i("div",{className:e.section,children:[o(v,{label:"Graph context",sx:{minWidth:200},value:String(a.subgraphContext),options:ne,testId:"graph-context-select",onChange:r=>{a.setSubgraphContext(Number(r))}}),o(y,{variant:"caption",component:"div",color:"text.secondary",children:"How far the cut follows links out of the region. At none, a detour that leaves the window draws as two stubs. No effect on gfa-to-tabix's default anchored index."})]}):null}),V=re;var le=S()({section:{marginBottom:24}}),j=(l,a)=>l.join(`
|
|
2
2
|
`)===a.join(`
|
|
3
3
|
`);function J(l,a){let e=l.cutHaplotypes??[],[n,r]=C(e);return j(e,n)||(r(e),a()),t=>{j(t,e)||(r(t),l.setSubgraphHaplotypes(t))}}var se=p(function({model:a}){let[e,n]=C(a.cutHaplotypes?.join(", ")??""),r=J(a,()=>{n(a.cutHaplotypes?.join(", ")??"")}),t=()=>{r(Q(e))};return o(T,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:e,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:d=>{n(d.target.value)},onBlur:()=>{t()},onKeyDown:d=>{d.key==="Enter"&&t()}})}),ie=p(function({model:a,names:e}){let[n,r]=C(a.cutHaplotypes??[]),t=I(n),d=I(""),[f,h]=C(!1),b=J(a,()=>{t.current=a.cutHaplotypes??[],r(t.current)});return o(P,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:e,value:n,open:f,onOpen:()=>{h(!0)},onInputChange:(g,u)=>{d.current=u},onClose:(g,u)=>{h(!1);let s=d.current.trim();u==="blur"&&s&&!t.current.includes(s)&&(t.current=[...t.current,s],r(t.current)),b(t.current)},onChange:(g,u)=>{t.current=u,r(u),f||b(u)},renderInput:g=>o(T,{...g,label:"Haplotypes",placeholder:n.length===0?"every haplotype":void 0,slotProps:{...g.slotProps,htmlInput:{...g.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),pe=p(function({model:a}){let{classes:e}=le(),n=a.haplotypeNames,r=a.sourceAdapter;return r&&z(r)?i("div",{className:e.section,children:[n?o(ie,{model:a,names:n}):o(se,{model:a}),i(y,{variant:"caption",component:"div",color:"text.secondary",children:[n?`Which of the graph's ${n.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`:"Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas."," ","Empty is every haplotype."]})]}):null}),Z=pe;var k=S()({section:{marginBottom:24},group:{marginBottom:16},heading:{marginBottom:8}}),c=p(function({warn:a=!1,children:e}){return o(y,{variant:"caption",component:"div",color:a?"warning.main":"text.secondary",children:e})}),N=p(function({title:a,children:e}){let{classes:n}=k();return i("section",{className:n.group,children:[o(y,{variant:"subtitle1",className:n.heading,children:a}),e]})}),ee=p(function({label:a,checked:e,onChange:n,children:r}){let{classes:t}=k();return i("div",{className:t.section,children:[o(F,{control:o(W,{checked:e,onChange:d=>{n(d.target.checked)}}),label:a}),r]})}),m=p(function({children:a,...e}){let{classes:n}=k();return i("div",{className:n.section,children:[o(v,{sx:{minWidth:200},...e}),a]})}),ce=[5e3,2e4,5e4,1e5];function de(l){return[...new Set([...ce,l])].sort((a,e)=>a-e).map(a=>({value:String(a),label:a.toLocaleString()}))}var te=p(function({label:a,choices:e,stored:n,auto:r,testId:t,onChange:d,children:f}){return e.length>0?o(m,{label:a,value:e.some(h=>h.trackId===n)?n:"",options:[{value:"",label:`Automatic (${r?.name??"none"})`},...e.map(({trackId:h,name:b})=>({value:h,label:b}))],testId:t,onChange:d,children:f}):null}),ue=p(function(a){let{model:e,onClose:n}=a,{classes:r}=k();return i(H,{open:!0,onClose:n,title:"Graph settings",children:[i(E,{children:[i(N,{title:"Subgraph",children:[o(V,{model:e}),o(Z,{model:e}),o(m,{label:"Node limit",value:String(e.maxGraphNodes),options:de(e.maxGraphNodes),testId:"graph-node-limit-select",onChange:t=>{e.setMaxGraphNodes(Number(t))},children:o(c,{children:"The most nodes a layout draws; past it the graph is declined. Walk rows take no limit."})})]}),i(N,{title:"Drawing",children:[e.anchorPaths.length>1?o(m,{label:"Reference path",value:e.activeReferencePath??"",options:e.anchorPaths.map(({name:t})=>({value:t,label:t})),testId:"graph-reference-path-select",onChange:t=>{e.setReferencePath(t)},children:o(c,{children:"The path the anchored layouts place x along"})}):null,o(m,{label:"Node width",value:e.nodeWidth,options:$,testId:"graph-node-width-select",onChange:t=>{e.setNodeWidth(t)},children:o(c,{children:"Depth as width. In a cut with walks, depth is how many haplotypes carry the node."})}),o(m,{label:"Link width",value:e.linkWidth,options:L,testId:"graph-link-width-select",onChange:t=>{e.setLinkWidth(t)},children:o(c,{children:"Walks as width, so a common route reads heavy and a private one thin."})}),i(ee,{label:"Draw paths",checked:e.drawPaths,onChange:t=>{e.setLayer("paths",t)},children:[o(c,{children:"Color each node by the paths through it, one lane per path"}),e.drawPaths&&!e.effectiveDrawPaths?o(c,{warn:!0,children:e.pathCount>w?`Off: ${e.pathCount.toLocaleString()} paths is past the ${w} this can tell apart`:"Off: this graph states no paths"}):null]}),o(te,{label:"Gene track",choices:e.geneTrackChoices,stored:e.geneTrackId,auto:q(e.geneTrackChoices,""),testId:"graph-gene-track-select",onChange:t=>{e.setGeneTrackId(t)},children:o(c,{children:"Where genes on the backbone come from"})}),o(te,{label:"Repeat track",choices:e.repeatTrackChoices,stored:e.repeatTrackId,auto:X(e.repeatTrackChoices,""),testId:"graph-repeat-track-select",onChange:t=>{e.setRepeatTrackId(t)},children:o(c,{children:"The tandem repeat annotation walk rows measure and tile by"})})]}),i(N,{title:"Force-directed layout",children:[e.hasGraph&&!e.usesLayoutEngine?o("div",{className:r.section,children:o(c,{warn:!0,children:"No effect on the current layout until Layout is Force-directed"})}):null,o(m,{label:"Engine",value:e.chosenLayoutEngine,options:Y,testId:"graph-layout-engine-select",onChange:t=>{e.setLayoutEngine(t)},children:o(c,{children:"Stress keeps the reference straight, so a zoom keeps the picture; FMMM lets the whole graph settle."})}),o(m,{label:"Layout quality",value:String(e.layoutQuality),options:x.map(t=>({value:String(t.value),label:t.label})),testId:"graph-layout-quality-select",onChange:t=>{e.setLayoutQuality(Number(t))},children:o(c,{children:"The engine's iteration budget; higher is slower"})}),o(m,{label:"Bubble spread",value:e.bubbleSpread,options:K,testId:"graph-bubble-spread-select",onChange:t=>{e.setBubbleSpread(t)},children:o(c,{children:"How far the layout opens a bubble"})}),e.chosenLayoutEngine==="stress"?null:o(ee,{label:"Linear layout",checked:e.linearLayout,onChange:t=>{e.setLinearLayout(t)},children:o(c,{children:"Keeps a chain of nodes on one line where it can"})})]})]}),o(D,{children:o(G,{variant:"contained",color:"primary",onClick:n,children:"Close"})})]})}),et=ue;export{v as a,et as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-S4BXLNAH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@14.3.
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@14.3.3/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-K5SIJGAE.js", "../../src/GraphGenomeView/components/LabelledSelect.tsx", "../../src/GraphGenomeView/components/SubgraphContextSelect.tsx", "../../src/GraphGenomeView/components/SubgraphHaplotypesField.tsx", "../../src/GraphGenomeView/components/GraphSettingsDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["// src/layoutQualities.ts\nvar LAYOUT_QUALITIES = [\n { value: 0, label: \"Fastest\" },\n { value: 1, label: \"Fast\" },\n { value: 2, label: \"Default\" },\n { value: 3, label: \"Fine\" },\n { value: 4, label: \"Best\" }\n];\n\nexport {\n LAYOUT_QUALITIES\n};\n", "import { useId } from 'react'\n\nimport {\n FormControl,\n InputLabel,\n ListItemText,\n MenuItem,\n Select,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { SxProps } from '@mui/material'\n\ninterface SelectOption<T extends string> {\n value: T\n label: string\n // an option's tooltip, and the reason under a disabled one, whose tooltip\n // cannot open\n description?: string\n disabled?: boolean\n}\n\n// One dropdown with its label tied to it, so a screen reader names the combobox\nexport default observer(function LabelledSelect<T extends string>({\n label,\n value,\n options,\n testId,\n size,\n sx,\n disabled,\n title,\n shown,\n onChange,\n}: {\n label: string\n value: T\n options: readonly SelectOption<T>[]\n testId?: string\n size?: 'small' | 'medium'\n sx?: SxProps\n disabled?: boolean\n title?: string\n // what the closed select reads, when not the picked option's label\n shown?: string\n onChange: (value: T) => void\n}) {\n const labelId = useId()\n return (\n <FormControl size={size} sx={sx} disabled={disabled} title={title}>\n <InputLabel id={labelId} shrink>\n {label}\n </InputLabel>\n <Select\n labelId={labelId}\n value={value}\n label={label}\n notched\n displayEmpty\n data-testid={testId}\n renderValue={picked =>\n shown ?? options.find(o => o.value === picked)?.label ?? picked\n }\n onChange={e => {\n onChange(e.target.value as T)\n }}\n >\n {options.map(o => (\n <MenuItem\n key={o.value}\n value={o.value}\n disabled={o.disabled}\n title={o.disabled ? undefined : o.description}\n >\n <ListItemText\n primary={o.label}\n secondary={o.disabled ? o.description : undefined}\n />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )\n})\n", "import { Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from './LabelledSelect'\nimport { walkIndexed } from '../../graphTrackConfig'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\n// Only an rGFA cut from segment rows reads hops: a GBZ cut widens by its\n// adapter's bp `context`, and a walk-indexed cut follows its walks.\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: Pick<\n GraphPaneModel,\n 'sourceAdapter' | 'subgraphContext' | 'setSubgraphContext'\n >\n}) {\n const { classes } = useStyles()\n const adapter = model.sourceAdapter\n return adapter?.type === 'RgfaTabixAdapter' && !walkIndexed(adapter) ? (\n <div className={classes.section}>\n <LabelledSelect\n label=\"Graph context\"\n sx={{ minWidth: 200 }}\n value={String(model.subgraphContext)}\n options={SUBGRAPH_CONTEXTS}\n testId=\"graph-context-select\"\n onChange={hops => {\n model.setSubgraphContext(Number(hops))\n }}\n />\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n How far the cut follows links out of the region. At none, a detour that\n leaves the window draws as two stubs. No effect on gfa-to-tabix's\n default anchored index.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphContextSelect\n", "import { useRef, useState } from 'react'\n\nimport { Autocomplete, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { cutsByHaplotype, parseHaplotypes } from '../../graphTrackConfig'\n\nimport type { GraphPaneModel } from '../model'\n\ntype CutHaplotypes = Pick<\n GraphPaneModel,\n 'sourceAdapter' | 'cutHaplotypes' | 'haplotypeNames' | 'setSubgraphHaplotypes'\n>\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\nconst sameList = (a: readonly string[], b: readonly string[]) =>\n a.join('\\n') === b.join('\\n')\n\n// The cut's set, and the last one this field saw: an outside change (a\n// restored session, a launch) resets the draft, while the field's own apply\n// records what it set first, so it keeps its focus and draft\nfunction useCutHaplotypes(model: CutHaplotypes, reset: () => void) {\n const current = model.cutHaplotypes ?? []\n const [seen, setSeen] = useState(current)\n if (!sameList(current, seen)) {\n setSeen(current)\n reset()\n }\n return (haplotypes: string[]) => {\n if (!sameList(haplotypes, current)) {\n setSeen(haplotypes)\n model.setSubgraphHaplotypes(haplotypes)\n }\n }\n}\n\nconst HaplotypeListField = observer(function HaplotypeListField({\n model,\n}: {\n model: CutHaplotypes\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes?.join(', ') ?? '')\n const setCut = useCutHaplotypes(model, () => {\n setDraft(model.cutHaplotypes?.join(', ') ?? '')\n })\n const apply = () => {\n setCut(parseHaplotypes(draft))\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// The haplotypes a walk-indexed graph's header names, searched as typed. A\n// typed prefix the list lacks (HG002 for both haplotypes) is kept too, on\n// Enter or when the field loses focus. The set applies when the list closes\n// or, with the list closed, as it changes. Not MUI's `autoSelect`: in a\n// multiple select its blur toggles the highlighted option, so a pick made by\n// keyboard was dropped again on Tab.\nconst HaplotypePickField = observer(function HaplotypePickField({\n model,\n names,\n}: {\n model: CutHaplotypes\n names: string[]\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes ?? [])\n const draftRef = useRef(draft)\n const typed = useRef('')\n const [open, setOpen] = useState(false)\n const apply = useCutHaplotypes(model, () => {\n draftRef.current = model.cutHaplotypes ?? []\n setDraft(draftRef.current)\n })\n return (\n <Autocomplete\n multiple\n freeSolo\n disableCloseOnSelect\n options={names}\n value={draft}\n open={open}\n onOpen={() => {\n setOpen(true)\n }}\n onInputChange={(_, text) => {\n typed.current = text\n }}\n onClose={(_, reason) => {\n setOpen(false)\n const text = typed.current.trim()\n if (reason === 'blur' && text && !draftRef.current.includes(text)) {\n draftRef.current = [...draftRef.current, text]\n setDraft(draftRef.current)\n }\n apply(draftRef.current)\n }}\n onChange={(_, value) => {\n draftRef.current = value\n setDraft(value)\n if (!open) {\n apply(value)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n label=\"Haplotypes\"\n placeholder={draft.length === 0 ? 'every haplotype' : undefined}\n slotProps={{\n ...params.slotProps,\n htmlInput: {\n ...params.slotProps.htmlInput,\n 'data-testid': 'graph-haplotypes-field',\n },\n }}\n />\n )}\n />\n )\n})\n\n// Only a GBZ cut and a walk-indexed rGFA cut read the set\nconst SubgraphHaplotypesField = observer(function SubgraphHaplotypesField({\n model,\n}: {\n model: CutHaplotypes\n}) {\n const { classes } = useStyles()\n const names = model.haplotypeNames\n const adapter = model.sourceAdapter\n return adapter && cutsByHaplotype(adapter) ? (\n <div className={classes.section}>\n {names ? (\n <HaplotypePickField model={model} names={names} />\n ) : (\n <HaplotypeListField model={model} />\n )}\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n {names\n ? `Which of the graph's ${names.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`\n : 'Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas.'}{' '}\n Empty is every haplotype.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphHaplotypesField\n", "import type { ReactNode } from 'react'\n\nimport { BUBBLE_SPREADS } from '@jbrowse/bandage-core/bubbleSpreads'\nimport { EDGE_WIDTHS } from '@jbrowse/bandage-core/edgeWidths'\nimport { LAYOUT_ENGINES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_QUALITIES } from '@jbrowse/bandage-core/layoutQualities'\nimport { NODE_WIDTHS } from '@jbrowse/bandage-core/nodeWidths'\nimport { MAX_PATH_COLORS } from '@jbrowse/bandage-core/pathColors'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n FormControlLabel,\n Switch,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from './LabelledSelect'\nimport SubgraphContextSelect from './SubgraphContextSelect'\nimport SubgraphHaplotypesField from './SubgraphHaplotypesField'\nimport { pickGeneTrack } from '../genes/geneFeatures'\nimport { pickRepeatTrack } from '../repeats/repeatFeatures'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n group: {\n marginBottom: 16,\n },\n heading: {\n marginBottom: 8,\n },\n})\n\nconst Caption = observer(function Caption({\n warn = false,\n children,\n}: {\n warn?: boolean\n children: ReactNode\n}) {\n return (\n <Typography\n variant=\"caption\"\n component=\"div\"\n color={warn ? 'warning.main' : 'text.secondary'}\n >\n {children}\n </Typography>\n )\n})\n\nconst Group = observer(function Group({\n title,\n children,\n}: {\n title: string\n children: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <section className={classes.group}>\n <Typography variant=\"subtitle1\" className={classes.heading}>\n {title}\n </Typography>\n {children}\n </section>\n )\n})\n\nconst SettingSwitch = observer(function SettingSwitch({\n label,\n checked,\n onChange,\n children,\n}: {\n label: string\n checked: boolean\n onChange: (checked: boolean) => void\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <FormControlLabel\n control={\n <Switch\n checked={checked}\n onChange={e => {\n onChange(e.target.checked)\n }}\n />\n }\n label={label}\n />\n {children}\n </div>\n )\n})\n\n// one dropdown setting, at the dialog's width, and its caption\nconst SettingSelect = observer(function SettingSelect<T extends string>({\n children,\n ...props\n}: Omit<Parameters<typeof LabelledSelect<T>>[0], 'size' | 'sx'> & {\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <LabelledSelect sx={{ minWidth: 200 }} {...props} />\n {children}\n </div>\n )\n})\n\nconst NODE_LIMITS = [5000, 20_000, 50_000, 100_000]\n\n// the presets, with a limit a session states among them\nfunction nodeLimitOptions(current: number) {\n return [...new Set([...NODE_LIMITS, current])]\n .sort((a, b) => a - b)\n .map(limit => ({ value: String(limit), label: limit.toLocaleString() }))\n}\n\ninterface NamedTrack {\n trackId: string\n name: string\n}\n\n// '' leaves the pick to the heuristic, so a session can go back to it\nconst TrackPickSetting = observer(function TrackPickSetting({\n label,\n choices,\n stored,\n auto,\n testId,\n onChange,\n children,\n}: {\n label: string\n choices: NamedTrack[]\n stored: string\n auto: NamedTrack | undefined\n testId: string\n onChange: (trackId: string) => void\n children: ReactNode\n}) {\n return choices.length > 0 ? (\n <SettingSelect\n label={label}\n value={choices.some(t => t.trackId === stored) ? stored : ''}\n options={[\n { value: '', label: `Automatic (${auto?.name ?? 'none'})` },\n ...choices.map(({ trackId, name }) => ({\n value: trackId,\n label: name,\n })),\n ]}\n testId={testId}\n onChange={onChange}\n >\n {children}\n </SettingSelect>\n ) : null\n})\n\n// Toggles the menus already offer (halos, genes, color) stay out of here.\nconst GraphSettingsDialog = observer(function GraphSettingsDialog(props: {\n model: GraphPaneModel\n onClose: () => void\n}) {\n const { model, onClose } = props\n const { classes } = useStyles()\n\n return (\n <Dialog open onClose={onClose} title=\"Graph settings\">\n <DialogContent>\n <Group title=\"Subgraph\">\n <SubgraphContextSelect model={model} />\n <SubgraphHaplotypesField model={model} />\n <SettingSelect\n label=\"Node limit\"\n value={String(model.maxGraphNodes)}\n options={nodeLimitOptions(model.maxGraphNodes)}\n testId=\"graph-node-limit-select\"\n onChange={limit => {\n model.setMaxGraphNodes(Number(limit))\n }}\n >\n <Caption>\n The most nodes a layout draws; past it the graph is declined. Walk\n rows take no limit.\n </Caption>\n </SettingSelect>\n </Group>\n\n <Group title=\"Drawing\">\n {model.anchorPaths.length > 1 ? (\n <SettingSelect\n label=\"Reference path\"\n value={model.activeReferencePath ?? ''}\n options={model.anchorPaths.map(({ name }) => ({\n value: name,\n label: name,\n }))}\n testId=\"graph-reference-path-select\"\n onChange={name => {\n model.setReferencePath(name)\n }}\n >\n <Caption>The path the anchored layouts place x along</Caption>\n </SettingSelect>\n ) : null}\n\n <SettingSelect\n label=\"Node width\"\n value={model.nodeWidth}\n options={NODE_WIDTHS}\n testId=\"graph-node-width-select\"\n onChange={width => {\n model.setNodeWidth(width)\n }}\n >\n <Caption>\n Depth as width. In a cut with walks, depth is how many haplotypes\n carry the node.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Link width\"\n value={model.linkWidth}\n options={EDGE_WIDTHS}\n testId=\"graph-link-width-select\"\n onChange={links => {\n model.setLinkWidth(links)\n }}\n >\n <Caption>\n Walks as width, so a common route reads heavy and a private one\n thin.\n </Caption>\n </SettingSelect>\n\n <SettingSwitch\n label=\"Draw paths\"\n checked={model.drawPaths}\n onChange={draw => {\n model.setLayer('paths', draw)\n }}\n >\n <Caption>\n Color each node by the paths through it, one lane per path\n </Caption>\n {model.drawPaths && !model.effectiveDrawPaths ? (\n <Caption warn>\n {model.pathCount > MAX_PATH_COLORS\n ? `Off: ${model.pathCount.toLocaleString()} paths is past the ${MAX_PATH_COLORS} this can tell apart`\n : 'Off: this graph states no paths'}\n </Caption>\n ) : null}\n </SettingSwitch>\n\n <TrackPickSetting\n label=\"Gene track\"\n choices={model.geneTrackChoices}\n stored={model.geneTrackId}\n auto={pickGeneTrack(model.geneTrackChoices, '')}\n testId=\"graph-gene-track-select\"\n onChange={trackId => {\n model.setGeneTrackId(trackId)\n }}\n >\n <Caption>Where genes on the backbone come from</Caption>\n </TrackPickSetting>\n\n <TrackPickSetting\n label=\"Repeat track\"\n choices={model.repeatTrackChoices}\n stored={model.repeatTrackId}\n auto={pickRepeatTrack(model.repeatTrackChoices, '')}\n testId=\"graph-repeat-track-select\"\n onChange={trackId => {\n model.setRepeatTrackId(trackId)\n }}\n >\n <Caption>\n The tandem repeat annotation walk rows measure and tile by\n </Caption>\n </TrackPickSetting>\n </Group>\n\n <Group title=\"Force-directed layout\">\n {model.hasGraph && !model.usesLayoutEngine ? (\n <div className={classes.section}>\n <Caption warn>\n No effect on the current layout until Layout is Force-directed\n </Caption>\n </div>\n ) : null}\n\n <SettingSelect\n label=\"Engine\"\n value={model.chosenLayoutEngine}\n options={LAYOUT_ENGINES}\n testId=\"graph-layout-engine-select\"\n onChange={engine => {\n model.setLayoutEngine(engine)\n }}\n >\n <Caption>\n Stress keeps the reference straight, so a zoom keeps the picture;\n FMMM lets the whole graph settle.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Layout quality\"\n value={String(model.layoutQuality)}\n options={LAYOUT_QUALITIES.map(q => ({\n value: String(q.value),\n label: q.label,\n }))}\n testId=\"graph-layout-quality-select\"\n onChange={quality => {\n model.setLayoutQuality(Number(quality))\n }}\n >\n <Caption>\n The engine's iteration budget; higher is slower\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Bubble spread\"\n value={model.bubbleSpread}\n options={BUBBLE_SPREADS}\n testId=\"graph-bubble-spread-select\"\n onChange={spread => {\n model.setBubbleSpread(spread)\n }}\n >\n <Caption>How far the layout opens a bubble</Caption>\n </SettingSelect>\n\n {model.chosenLayoutEngine === 'stress' ? null : (\n <SettingSwitch\n label=\"Linear layout\"\n checked={model.linearLayout}\n onChange={linear => {\n model.setLinearLayout(linear)\n }}\n >\n <Caption>Keeps a chain of nodes on one line where it can</Caption>\n </SettingSwitch>\n )}\n </Group>\n </DialogContent>\n\n <DialogActions>\n <Button variant=\"contained\" color=\"primary\" onClick={onClose}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default GraphSettingsDialog\n"],
|
|
5
5
|
"mappings": "kcACA,IAAIA,EAAmB,CACrB,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,MAAO,CAC5B,ECgBA,IAAOC,EAAQC,EAAS,SAA0C,CAChE,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,EACA,GAAAC,EACA,SAAAC,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,CACF,EAYG,CACD,IAAMC,EAAUC,EAAM,EACtB,OACEC,EAACC,EAAA,CAAY,KAAMT,EAAM,GAAIC,EAAI,SAAUC,EAAU,MAAOC,EAC1D,UAAAO,EAACC,EAAA,CAAW,GAAIL,EAAS,OAAM,GAC5B,SAAAV,EACH,EACAc,EAACE,EAAA,CACC,QAASN,EACT,MAAOT,EACP,MAAOD,EACP,QAAO,GACP,aAAY,GACZ,cAAaG,EACb,YAAac,GACXT,GAASN,EAAQ,KAAKgB,IAAKA,GAAE,QAAUD,CAAM,GAAG,OAASA,EAE3D,SAAUE,GAAK,CACbV,EAASU,EAAE,OAAO,KAAU,CAC9B,EAEC,SAAAjB,EAAQ,IAAIgB,GACXJ,EAACM,EAAA,CAEC,MAAOF,EAAE,MACT,SAAUA,EAAE,SACZ,MAAOA,EAAE,SAAW,OAAYA,EAAE,YAElC,SAAAJ,EAACO,EAAA,CACC,QA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QUALITIES", "LabelledSelect_default", "observer", "label", "value", "options", "testId", "size", "sx", "disabled", "title", "shown", "onChange", "labelId", "useId", "jsxs", "FormControl", "jsx", "InputLabel", "Select", "picked", "o", "e", "MenuItem", "ListItemText", "useStyles", "makeStyles", "SUBGRAPH_CONTEXTS", "SubgraphContextSelect", "observer", "model", "classes", "adapter", "walkIndexed", "jsxs", "jsx", "LabelledSelect_default", "hops", "Typography", "SubgraphContextSelect_default", "useStyles", "makeStyles", "sameList", "a", "b", "useCutHaplotypes", "model", "reset", "current", "seen", "setSeen", "useState", "haplotypes", "HaplotypeListField", "observer", "draft", "setDraft", "setCut", "apply", "parseHaplotypes", "jsx", "TextField", "e", "HaplotypePickField", "names", "draftRef", "useRef", "typed", "open", "setOpen", "Autocomplete", "_", "text", "reason", "value", "params", "SubgraphHaplotypesField", "classes", "adapter", "cutsByHaplotype", "jsxs", "Typography", "SubgraphHaplotypesField_default", "useStyles", "makeStyles", "Caption", "observer", "warn", "children", "jsx", "Typography", "Group", "title", "classes", "jsxs", "SettingSwitch", "label", "checked", "onChange", "FormControlLabel", "Switch", "e", "SettingSelect", "props", "LabelledSelect_default", "NODE_LIMITS", "nodeLimitOptions", "current", "b", "limit", "TrackPickSetting", "choices", "stored", "auto", "testId", "t", "trackId", "name", "GraphSettingsDialog", "model", "onClose", "Dialog", "DialogContent", "SubgraphContextSelect_default", "SubgraphHaplotypesField_default", "NODE_WIDTHS", "width", "EDGE_WIDTHS", "links", "draw", "MAX_PATH_COLORS", "pickGeneTrack", "pickRepeatTrack", "LAYOUT_ENGINES", "engine", "LAYOUT_QUALITIES", "q", "quality", "BUBBLE_SPREADS", "spread", "linear", "DialogActions", "Button", "GraphSettingsDialog_default"]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{U as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{U as a}from"./chunk-LOT3BKM3.js";import{d as m}from"./chunk-ESUDWLHY.js";import{a as n,c as p}from"./chunk-E55FR7S6.js";function c(i,l){let t=new Map,o=new Map;for(let{name:s,color:e,assembly:r}of i)e&&a(e)&&(t.set(s,e),r&&!o.has(r)&&o.set(r,e));return s=>{let e=p(s)??s;return t.get(e)??t.get(n(e))??o.get(m(l,e))}}export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SRA6CKRA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{B as Z,F as q,G as C,d as W,e as j,i as z,j as F,l as O,m as _,n as X,o as I,p as $,r as J,s as K,u as N,v as Y,x as V,z as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=renderSvg-
|
|
1
|
+
import{B as Z,F as q,G as C,d as W,e as j,i as z,j as F,l as O,m as _,n as X,o as I,p as $,r as J,s as K,u as N,v as Y,x as V,z as U}from"./chunk-6T2VBP7Z.js";import{Hb as D,Sb as S,Tb as R,_b as E,ac as H}from"./chunk-PZGI7L73.js";import"./chunk-LOT3BKM3.js";import"./chunk-NSWRDOLS.js";import{H as b}from"./chunk-6GJELLIC.js";import"./chunk-FSBDVHNR.js";import"./chunk-GZROPRBI.js";import"./chunk-MX7R2F3F.js";import"./chunk-HHK5MBID.js";import"./chunk-5VZ5HRTH.js";import"./chunk-WKD7ALOU.js";import"./chunk-YBLNN5FU.js";import"./chunk-EGZZ3ADM.js";import"./chunk-E55FR7S6.js";import"./chunk-J2PN6CG3.js";import{a as k,b as e,c as u}from"./chunk-DUU6T2I5.js";var m=JBrowseExports["@jbrowse/display-kit/renderDisplaySvg"],it=t=>m!=null&&t in Object(m)?m[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/display-kit/renderDisplaySvg' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Q=it("renderDisplaySvg");var ft=m&&m.__esModule?m.default:m;var w=JBrowseExports["@jbrowse/core/util/paintLayer"],ot=t=>w!=null&&t in Object(w)?w[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/core/util/paintLayer' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t}),L=ot("PaintLayer"),wt=w&&w.__esModule?w.default:w;var M={fontFamily:"sans-serif",fontSize:11},tt=16,st=2,T=t=>t;function et({model:t,lift:i,drawPaths:a,width:n,height:r,rasterize:s}){let p=t.buildDrawing(i,a,t.liveBuildView);if(!p)return null;let l=s?st:1,c=s?void 0:E(n,r),d=c?.canvas??document.createElement("canvas");c||(d.width=Math.round(n*l),d.height=Math.round(r*l));let{scaleX:y,scaleY:v,translateX:h,translateY:g}=t.screenTransform,o=new H(d);return o.uploadGeometry(p.batch),o.updateTransform({scaleX:y*l,scaleY:v*l,translateX:h*l,translateY:g*l,dpr:l}),o.render([0,0,0,0]),c?e("svg",{width:n,height:r,overflow:"hidden",children:e("g",{dangerouslySetInnerHTML:{__html:c.markup()}})}):e("image",{width:n,height:r,href:d.toDataURL("image/png")})}function lt(t,i,a,n){let r=n?0:C,s=t.toUpperCase();return{key:i,width:s.length*b,height:a+r,draw:p=>e("text",{fontFamily:"sans-serif",fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",x:p,y:r,fill:q,children:s},i)}}function B(t,i,a=tt,n){if(!t.swatch)return{key:t.key,width:t.label.length*b,height:a,draw:d=>e("text",{...M,x:d,y:0,fill:"#666",children:t.label},t.key)};let r=t.swatch,s=n??_(r),p=n===void 0?0:n+5,l=(t.strong??"")+t.label,c=t.sizer===void 0?"":` ${$(t.sizer)}`;return{key:t.key,width:Math.max(s+5+(l.length+c.length)*b,p+(t.under?.length??0)*b),height:t.under?a*2:a,draw:d=>u("g",{...M,children:[t.count&&t.title?e("title",{children:t.title}):null,e(Y,{swatch:r,x:d+(s-_(r))/2,id:i}),u("text",{x:d+s+5,y:0,children:[t.strong?e("tspan",{fontWeight:"bold",children:t.strong}):null,t.label,t.count?e("tspan",{children:` ${$(t.count)}`}):null]}),t.under?e("text",{x:d+p,y:a,children:t.under}):null]},t.key)}}function pt({model:t,idPrefix:i}){let a=N(t);if(a.length===0)return null;let n=a.flatMap(o=>o.rows),r=I(n),s=X(n),p=a.flatMap(({testid:o,rows:f,heading:x,spaced:P},G)=>[...x?[lt(x,`${o}-heading`,r,G===0)]:[],...P?[{key:`${o}-gap`,width:0,height:C,draw:()=>null}]:[],...f.map((rt,at)=>B(rt,`${i}-${o}-${at}`,r,s))]),l=6,c=p.reduce((o,f)=>Math.max(o,f.width),-1/0)+l*2,d=p.reduce((o,f)=>o+f.height,0)+l,y=t.paneWidth-D-c+l,v=D+t.referenceStripZonePx,h=[],g=v+l/2+r/2+4;for(let o of p)h.push({row:o,y:g}),g+=o.height;return u("g",{"data-testid":"graph-svg-keys",children:[e("rect",{x:y-l,y:v,width:c,height:d,rx:3,fill:"#fff"}),h.map(({row:o,y:f})=>e("g",{transform:`translate(0 ${f})`,children:o.draw(y)},o.key))]})}function nt({x:t,y:i,text:a,fontSize:n,anchor:r}){let s=a.length*n*.56+6,p=r==="middle"?t-s/2:t-3;return u(k,{children:[e("rect",{x:p,y:i-n*.65,width:s,height:n*1.3,rx:3,fill:"#fff",fillOpacity:.8}),e("text",{x:t,y:i+n*.35,textAnchor:r,fontSize:n,fill:"#18181c",children:a})]})}function dt({model:t}){return e("g",{fontFamily:M.fontFamily,children:t.overlayLabels.sizes.map(({key:i,node:a,text:n,x:r,y:s})=>e("g",{opacity:t.nodeFaded(a)?F:void 0,children:e(nt,{x:r,y:s,text:n,fontSize:10,anchor:"middle"})},i))})}function ct({model:t}){return e("g",{fontFamily:M.fontFamily,children:t.visibleRowLabels.map(({label:i,y:a,top:n})=>e(nt,{x:10,y:n,text:i,fontSize:11,anchor:"start"},a))})}function gt({model:t,rasterize:i,idPrefix:a}){let n=t.facetPanels,r=t.facetGrid,s=t.facetPlacement;if(!n||!r||!s)return null;let{columns:p,width:l,height:c}=r,d=r.total+S+14,y=K(t).map((h,g)=>B(h,`${a}-facet-key-${g}`)),v=y.map((h,g)=>y.slice(0,g).reduce((o,f)=>o+f.width+14,6));return u(k,{children:[e("g",{transform:`translate(0 ${d})`,children:y.map((h,g)=>h.draw(v[g]))}),n.map((h,g)=>{let o=s.cells[g],f=o%p*(l+S),x=Math.floor(o/p)*(R+c+S),P=h.walks[0],G=B(J(t,P),`${a}-facet-${g}`);return u("g",{transform:`translate(${f} ${x})`,children:[e("g",{transform:`translate(0 ${tt-2})`,children:G.draw(6)}),e("g",{transform:`translate(0 ${R})`,children:e(et,{model:t,lift:h,drawPaths:!1,width:l,height:c,rasterize:i})})]},P.name)})]})}function A({model:t,rasterize:i=!1,idPrefix:a}){let n=t.paneWidth,r=t.canvasHeight,s=!!t.layoutResult?.tubeMap,p={rasterizeLayers:i},l=`${a}-drawing-clip`,c=t.drawingClip!==void 0;return u("g",{"data-testid":"graph-pane-svg",children:[c?e("defs",{children:e("clipPath",{id:l,children:e("rect",{width:t.drawingWidth,height:r})})}):null,u("g",{clipPath:c?`url(#${l})`:void 0,children:[t.facetPanels?e(gt,{model:t,rasterize:i,idPrefix:a}):s?e(L,{width:n,height:r,opts:p,paint:d=>{U(T(d),t,{highlightNode:null})}}):e(et,{model:t,lift:t.drawnHighlight,drawPaths:t.effectiveDrawPaths,width:n,height:r,rasterize:i}),t.facetPanels?null:u(k,{children:[e(W,{model:t}),e(z,{model:t}),e(dt,{model:t}),e(O,{model:t}),e(Z,{model:t,vector:!0}),e(ct,{model:t})]})]}),t.referenceStripShown?e(L,{width:n,height:r,opts:p,paint:d=>{V(T(d),t,{lit:void 0,dpr:1})}}):null,t.runsPastEdge?e(L,{width:n,height:r,opts:p,paint:d=>{j(T(d),t)}}):null,t.facetPanels?null:e(pt,{model:t,idPrefix:a})]})}function ht({model:t,opts:i}){return e(A,{model:t,rasterize:!!i?.rasterizeLayers,idPrefix:`graph-${t.id}`})}function Ft(t,i){return Q(t,i,ht)}export{Ft as renderGraphTrackSvg};
|
|
2
|
+
//# sourceMappingURL=renderSvg-5YYSAMUL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ae,b as Ve,c as H,d as Xe,e as Ze,f as Qe}from"./chunks/chunk-52BUFQHJ.js";import"./chunks/chunk-IK5G3JHR.js";import{L as Ke,M as Ye,d as E,h as Oe,i as Je,q as m,s as Ue,v as Z,y as $e}from"./chunks/chunk-SMZZWPRX.js";import"./chunks/chunk-QOMV5OG7.js";import{b as d,g as N,h as We,q as qe}from"./chunks/chunk-AC5KEN36.js";import{$a as q,Ca as j,Da as _e,Ea as M,ab as v,g as Ie,i as L,ib as De,j as V,k as Ce,l as Pe,m as Be,n as Re,p as Ne}from"./chunks/chunk-M5XKM6D2.js";import"./chunks/chunk-VY7G4FSX.js";import"./chunks/chunk-YIGESHTA.js";import"./chunks/chunk-BLE63OIT.js";import"./chunks/chunk-E3GNTGWW.js";import{a as Q,d as z}from"./chunks/chunk-ZQOMV674.js";import{a as x,b as B,c as Me,d as ee,e as eo,f as W,g as oo}from"./chunks/chunk-ZVMXECJA.js";import"./chunks/chunk-JM4W4PKP.js";import"./chunks/chunk-DZXYOIGJ.js";import"./chunks/chunk-WBDZVWK4.js";import"./chunks/chunk-YBLNN5FU.js";import"./chunks/chunk-L7ZSEA4T.js";import"./chunks/chunk-E5ERNAYL.js";import"./chunks/chunk-43EUXRKZ.js";import{b as Ee,g as je}from"./chunks/chunk-YROUE32O.js";import{a as ve,c as ze,h as He}from"./chunks/chunk-D3QZGLZ3.js";import{d as $,e as n}from"./chunks/chunk-WKD7ALOU.js";import{a as Fe}from"./chunks/chunk-TMM73K4C.js";import"./chunks/chunk-D6TY2QEG.js";import"./chunks/chunk-YBLNN5FU.js";import{b as K,c as T,d as Ge,g as P,h as Y,i as Le}from"./chunks/chunk-EGZZ3ADM.js";import"./chunks/chunk-RDTLCMD2.js";import{f as we,g as ke,j as g,k as Te,m as xe}from"./chunks/chunk-5L276I7O.js";import{c as S}from"./chunks/chunk-J2PN6CG3.js";import{J as R}from"./chunks/chunk-H42TSPVA.js";import{a as Se,b as k,d as X}from"./chunks/chunk-DUU6T2I5.js";var _=JBrowseExports["@jbrowse/core/Plugin"];var to=_&&_.__esModule?_.default:_;var D=JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"];var u=D&&D.__esModule?D.default:D;var p=e=>({type:"fileLocation",defaultValue:{uri:e,locationType:"UriLocation"}}),l=(e,o="")=>d(e,{indexType:{model:n.enumeration("IndexType",["TBI","CSI"]),type:"stringEnum",defaultValue:"TBI"},location:p(o)});function A(e,o,t){return{indexType:t?"CSI":"TBI",location:{uri:`${e}.${t?"csi":"tbi"}`,baseUri:o}}}function G(e){let{walksUri:o,baseUri:t}=e;if(typeof o!="string")return e;let r=`${o}${T}`;return{...e,walksLocation:{uri:r,baseUri:t},walksIndex:{uri:`${r}.idx`,baseUri:t}}}var Co=d("GbzBaseSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},gbzDbLocation:p("/path/to/graph.gbz.db"),haplotypeIndexLocation:p(""),readsLocation:p(""),readsIndex:l("GbzBaseReadsIndex"),samplesTsvLocation:p(""),subgraphSnarls:{type:"stringEnum",model:n.enumeration("SnarlOutput",["none","contained","overlapping"]),defaultValue:B.snarls},referenceSample:{type:"string",defaultValue:""},assemblyNameToPanSN:{type:"frozen",defaultValue:{}},context:{type:"number",defaultValue:B.context,advanced:!0},nodeLimit:{type:"number",defaultValue:B.limit,advanced:!0}},{explicitlyTyped:!0,preProcessSnapshot:e=>{let{uri:o,baseUri:t,reads:r}=e;return{...e,...o?{gbzDbLocation:{uri:o,baseUri:t}}:{},...typeof r=="string"?{readsLocation:{uri:r,baseUri:t},...Po(r,t)}:{}}}});function Po(e,o){let{name:t,query:r}=P(e);return t.endsWith(".gz")?{readsIndex:{location:{uri:`${t}.tbi${r}`,baseUri:o}}}:{}}var ro=Co;function oe(e){e.addAdapterType(()=>new u({name:"GbzBaseSyntenyAdapter",displayName:"gbz-base pangenome adapter",configSchema:ro,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/GbzBaseSyntenyAdapter-46A4LMVD.js").then(o=>o.default)}))}var F=class extends V{constructor(){super(...arguments);this.name="GetGraphHaplotypes"}async execute(t){let{adapter:r}=await Re(this.pluginManager,t,"getHaplotypeNames");return r?.getHaplotypeNames({signal:t.signal})}};var Bo=S(()=>import("./chunks/AddTrackWorkflow-P5APNL32.js"));function te(e){e.addAddTrackWorkflowType(()=>new Ie({name:"Pangenome graph track",displayName:"Add pangenome graph track",ReactComponent:Bo,stateModel:n.model({})}))}var I=class extends V{constructor(){super(...arguments);this.name="GraphComputeLayout"}async execute(t){let{graph:r,options:a,signal:s,statusCallback:i}=t;return await new Promise(c=>setTimeout(c,0)),s?.throwIfAborted(),i?.("Computing layout"),We({graph:r,options:a})}};var O=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"];var ao=O&&O.__esModule?O.default:O;var f=JBrowseExports["@jbrowse/core/util/withLaunchInput"],Ro=e=>f!=null&&e in Object(f)?f[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/util/withLaunchInput' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),no=Ro("defineLaunchKeys");var Nt=f&&f.__esModule?f.default:f;var y=JBrowseExports["@jbrowse/core/pluggableElementTypes/models"],Vo=e=>y!=null&&e in Object(y)?y[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/pluggableElementTypes/models' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var io=Vo("BaseViewModel");var jt=y&&y.__esModule?y.default:y;function re(){return n.compose("GraphGenomeView",io,Xe,n.model({type:n.literal("GraphGenomeView"),gfaLocation:n.maybe(n.frozen()),loadedRegion:n.maybe(n.frozen()),loadedTrackId:n.optional(n.string,""),layoutMode:j(E),layoutEngine:_e(N,"fmmm"),color:n.maybe(n.frozen()),size:n.maybe(n.frozen()),layers:n.maybe(n.frozen()),facet:n.maybe(n.frozen()),rows:n.maybe(n.frozen()),hover:j(H),links:j(z),walks:n.maybe(n.frozen())})).views(e=>({get grammar(){return{layoutMode:e.layoutMode,layoutEngine:e.layoutEngine,encoding:{color:e.color},size:e.size,layers:e.layers,facet:e.facet,rows:e.rows,hover:e.hover,links:e.links,walks:e.walks}}})).actions(e=>({writeGrammar({encoding:o,...t}){Object.assign(e,o?{...t,color:o.color}:t)}})).volatile(()=>({widthMeasured:!1})).actions(e=>{let o=e.setWidth;return{setWidth(t){o(t),e.widthMeasured=!0}}}).views(e=>({get rpcSessionId(){return e.id},get paneWidth(){return e.width},get paneMeasured(){return e.widthMeasured},get sourceTrack(){return e.loadedTrackId?e.sessionTrack(e.loadedTrackId):void 0},get graphTracks(){return Qe(g(e).tracks)},get canRetryLoad(){return e.gfaLocation!==void 0||e.loadedTrackId!==""&&e.loadedRegion!==void 0}})).views(e=>({get hasPendingSource(){return e.canRetryLoad&&!e.graph&&!e.loadCanceled},menuItems(){return[...e.exportMenuItems(),...e.launchMenuItems()]}})).actions(e=>{let o=e.clearGraph;function t(r){if(e.gfaLocation)return e.displayName||e.setDisplayName(v(e.gfaLocation)),e.loadGFAFromLocation(e.gfaLocation,r);if(!e.loadedTrackId||!r)return;let a=e.sourceAdapter,s=r.end-r.start,i=e.offReference(r);if(!a)e.setError(new Error(`The track this graph was cut from, "${e.loadedTrackId}", is not in this session`));else if(i)e.setError(new Error(i));else if(s>e.maxRegionBp)e.setError(new Error(`Region too large (${q(s)}) \u2014 zoom in to view graph (max ${q(e.maxRegionBp)})`));else return e.markCut(),e.cutSubgraph(a,r,e.cutOptions)}return{clearGraph(){o(),e.gfaLocation&&e.displayName===v(e.gfaLocation)&&(e.displayName=void 0),e.gfaLocation=void 0,e.loadedRegion=void 0,e.loadedTrackId=""},load(){let r=e.loadedRegion,a=g(e),{assemblyManager:s}=a,i=r&&s.has(r.assemblyName)?s.get(r.assemblyName):void 0;return r&&i?.initialized===!1?s.waitForAssembly(r.assemblyName).catch(()=>{}).then(()=>$(e)&&e.loadedRegion===r?t(Z(a,r)):void 0):t(r&&Z(a,r))}}}).actions(e=>({retryLoad(){e.load()},setGfaLocation(o){e.gfaLocation=o},relayoutFrom(o){return e.loadedTrackId&&e.cutStale?e.load():e.recomputeLayout()},async openGfaLocation(o){await e.loadGFAFromLocation(o),$(e)&&e.hasGraph&&(this.setGfaLocation(o),e.displayName||e.setDisplayName(v(o)))},showTrackInLinearView(o,t,r){let a=g(e);$e({session:a,trackId:o,assembly:t,loc:r}),xe(a)&&a.removeView(e)},afterAttach(){e.graph||e.load()}}))}var No=no()({});function ae(e){e.addViewType(()=>new ao({name:"GraphGenomeView",displayName:"Graph genome view",stateModel:re(),launchKeys:No,ReactComponent:S(()=>import("./chunks/GraphGenomeView-MXRAP7QB.js"))}))}var ne=["MultiWaySyntenyDisplay","LinearSyntenyDisplay","DotplotDisplay","ChordSyntenyDisplay"];function Eo(e){let o=e.getElementTypesInGroup("display"),t=a=>o.find(s=>s.name===a),r=(a,s)=>s&&Object.assign(Object.create(s),{adapterCapabilities:[a]});return[t("LinearGraphDisplay"),r("referenceSegments",t("LinearBasicDisplay")),...ne.map(a=>r("headerLanes",t(a)))].filter(a=>a!==void 0)}function ie(e){e.addTrackType(()=>{let o=d("GraphTrack",{},{baseConfiguration:Pe(e),explicitIdentifier:"trackId"}),t=new Ce({name:"GraphTrack",displayName:"Pangenome graph track",configSchema:o,stateModel:Be(e,"GraphTrack",o)});for(let r of Eo(e))t.addDisplayType(r);return t})}function se(e){e.addToExtensionPoint("LaunchView-GraphGenomeView",o=>{let{session:t,...r}=o;return t.addView("GraphGenomeView",r),o})}var J=JBrowseExports["@jbrowse/core/pluggableElementTypes/DisplayType"];var so=J&&J.__esModule?J.default:J;var h=JBrowseExports["@jbrowse/display-kit/heightModeConfigSchemaFields"],jo=e=>h!=null&&e in Object(h)?h[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/heightModeConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),po=jo("heightModeConfigSchemaFields"),sr=h&&h.__esModule?h.default:h;var b=JBrowseExports["@jbrowse/display-kit/trackHeightConfigSchemaFields"],vo=e=>b!=null&&e in Object(b)?b[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/trackHeightConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),co=vo("trackHeightConfigSchemaFields"),dr=b&&b.__esModule?b.default:b;var w=JBrowseExports["@jbrowse/display-kit/facetConfigSchema"],zo=e=>w!=null&&e in Object(w)?w[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/facetConfigSchema' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),mo=zo("facetConfigSchema");var mr=w&&w.__esModule?w.default:w;var lo=d("GraphFacet",{columns:{type:"maybeNumber",description:"panels per row of a node layout's grid; unset fits them"}},{baseConfiguration:mo});function uo(){return d("LinearGraphDisplay",{layoutMode:{type:"stringEnum",model:M(E,"force"),defaultValue:"force"},layoutEngine:{type:"stringEnum",model:M(N,"fmmm"),defaultValue:"fmmm"},encoding:{type:"frozen",defaultValue:{},plot:!0},size:{type:"frozen",defaultValue:{field:"depth",value:6},plot:!0},layers:{type:"frozen",defaultValue:{},plot:!0},facet:lo,rows:{type:"frozen",defaultValue:{},plot:!0},walks:{type:"frozen",defaultValue:[],plot:!0},hover:{type:"stringEnum",model:M(H,"nodes"),defaultValue:"nodes"},links:{type:"stringEnum",model:M(z,Q),defaultValue:Q},...co({defaultHeight:300,height:"the height of the track the graph is drawn in"}),...po({heightMode:"how a force drawing the view's window places meets the track's height: `fit` shrinks the whole cut to the track's height; `fixed` draws it at the window's scale, so a zoom magnifies it, lowered only as far as keeps the reference the window shows inside the track, which it holds whole, and marks where what hangs off that reference runs past the top or bottom; `grow` does the same in a track grown to hold the cut, up to `growMaxHeight`",growMaxHeight:"the tallest `grow` makes the track, in px",defaultHeightMode:De})},{explicitlyTyped:!0,explicitIdentifier:"displayId",misnamed:{walkLayers:"walks"}})}function pe(e){e.addDisplayType(()=>{let o=uo();return Object.assign(new so({name:"LinearGraphDisplay",displayName:"Graph",configSchema:o,stateModel:Ze(o),trackType:"GraphTrack",viewType:"LinearGenomeView",ReactComponent:S(()=>import("./chunks/LinearGraphDisplay-KPWFPVFK.js"))}),{adapterCapabilities:["getSubgraph"]})})}function Ho(e){let{uri:o,baseUri:t,csi:r}=e;return typeof o=="string"?{...e,bubblesLocation:{uri:o,baseUri:t},index:A(o,t,r)}:e}var Wo=d("MinigraphBubbleAdapter",{bubblesLocation:p("/path/to/graph.bb.bed.gz"),index:l("MinigraphBubbleIndex","/path/to/graph.bb.bed.gz.tbi"),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:Ho}),go=Wo;function de(e){e.addAdapterType(()=>new u({name:"MinigraphBubbleAdapter",displayName:"Minigraph bubble BED adapter",configSchema:go,adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/MinigraphBubbleAdapter-QSPPG4LG.js").then(o=>o.default)}))}function fo(e){let{uri:o,baseUri:t,csi:r,format:a}=e;return typeof o!="string"?e:a===2?{...e,graphLocation:{uri:`${o}${K}`,baseUri:t},graphIndex:A(`${o}${K}`,t,r)}:{...e,segmentsLocation:{uri:`${o}.segs.bed.gz`,baseUri:t},segmentsIndex:A(`${o}.segs.bed.gz`,t,r),linksLocation:{uri:`${o}.links.bed.gz`,baseUri:t},linksIndex:A(`${o}.links.bed.gz`,t,r)}}function _o(e){let{coarse:o,baseUri:t,csi:r}=e;return G(fo(typeof o=="object"&&o!==null?{...e,coarse:fo({baseUri:t,csi:r,...o})}:e))}var Do=d("RgfaTabixCoarseTier",{uri:{type:"maybeString"},format:{type:"maybeNumber"},aboveBpPerPx:{type:"maybeNumber"},foldBelowBp:{type:"maybeNumber"},segmentsLocation:p("/path/to/graph.tier.segs.bed.gz"),segmentsIndex:l("RgfaCoarseSegmentsIndex","/path/to/graph.tier.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.tier.links.bed.gz"),linksIndex:l("RgfaCoarseLinksIndex","/path/to/graph.tier.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaCoarseGraphIndex")}),Oo=d("RgfaTabixAdapter",{segmentsLocation:p("/path/to/graph.segs.bed.gz"),segmentsIndex:l("RgfaSegmentsIndex","/path/to/graph.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.links.bed.gz"),linksIndex:l("RgfaLinksIndex","/path/to/graph.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaGraphIndex"),walksLocation:p(""),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:x.stepBudget},walkByteBudget:{type:"integer",defaultValue:x.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}},coarse:Do},{explicitlyTyped:!0,preProcessSnapshot:_o}),yo=Oo;function ce(e){e.addAdapterType(()=>new u({name:"RgfaTabixAdapter",displayName:"Indexed rGFA adapter",configSchema:yo,adapterCapabilities:["getSubgraph","referenceSegments"],adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/RgfaTabixAdapter-UPCOXYVG.js").then(o=>o.default)}))}function ho(e){return e.viewType==="LinearGenomeView"&&[e.trackType].flat().includes("VariantTrack")}var Jo=[{label:"Auto",value:"auto"},{label:"50 bp",value:50},{label:"1 kb",value:1e3},{label:"10 kb",value:1e4}];function Uo(e,o){return e?`Pinned to ${W(e)}${o===void 0?"":` \xB7 ${o} form${o===1?"":"s"}`}`:"Not pinned"}function $o(e,o){let t=g(e),r=o.flatMap(a=>a?[oo(a)]:[]);for(let{message:a}of[...t.snackbarMessages??[]])r.some(s=>a.startsWith(s))&&t.removeSnackbarMessage?.(a)}function Ko(e){return e.props({formsPinned:n.maybe(n.frozen()),formsFloorBp:n.maybe(n.frozen())}).views(o=>({get configuredAdapter(){return He(o.parentTrack.configuration)},get walkForms(){return this.configuredAdapter.type==="WalkFormsAdapter"}})).views(o=>({get pinnedAliases(){let t=ee(o.formsPinned??o.configuredAdapter.pinned),[r]=Fe(o.parentTrack.configuration),a=t&&r?g(o).assemblyManager.get(r):void 0;return t&&a?a.getAliasesForRefName(t.refName):[]}})).views(o=>({get adapterConfig(){let t=o.configuredAdapter;return o.walkForms?{...t,...o.formsPinned?{pinned:o.formsPinned}:{},...o.pinnedAliases.length>0?{pinnedAliases:o.pinnedAliases}:{},...o.formsFloorBp===void 0?{}:{floorBp:o.formsFloorBp}}:t},get formsWindow(){return ee(this.adapterConfig.pinned)},get formsFloor(){return eo(this.adapterConfig.floorBp)},get formsCount(){return o.sourcesBase?.reduce((t,r)=>t+(Number(r.forms)||1),0)},get visibleWindow(){let t=ke(o),r=Oe(t)?Je(t):void 0;return r&&r.end>r.start?{refName:r.refName,start:Math.max(0,Math.floor(r.start)),end:Math.ceil(r.end)}:void 0}})).volatile(()=>({warnedWindow:void 0})).actions(o=>{let{setSources:t}=o,r=()=>{$o(o,[o.warnedWindow,o.formsWindow])};return{setFormsPinned(a){r(),o.formsPinned=a},setFormsFloorBp(a){r(),o.formsFloorBp=a},setSources(a,s){o.walkForms&&(r(),o.warnedWindow=o.formsWindow),t?.(a,s)}}}).views(o=>{let{trackMenuItems:t}=o;return{formsMenuItems(){let r=o.formsWindow,a=o.visibleWindow;return[{label:Uo(r,o.formsCount),disabled:!0,onClick:()=>{}},{label:"Re-pin to visible region",helpText:"Cut the forms from the region the view shows. Panning and zooming leave the forms alone",disabled:!a||r!==void 0&&W(a)===W(r),onClick:()=>{a&&o.setFormsPinned(a)}},{label:"Hide changes under",subMenu:Jo.map(({label:s,value:i})=>({label:s,type:"radio",checked:o.formsFloor===i,onClick:()=>{o.setFormsFloorBp(i)}}))}]},trackMenuItems(){return o.walkForms?[...t(),...this.formsMenuItems()]:t()}}})}function me(e){e.addToExtensionPoint("Core-extendPluggableElement",o=>(o instanceof L&&ho(o)&&o.extendStateModel(Ko),o))}function bo(e){e.getElementTypesInGroup("display").some(t=>t instanceof L&&ho(t))||console.warn("jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu")}var Yo=d("WalkFormsAdapter",{walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),pinned:{type:"frozen",defaultValue:{}},pinnedAliases:{type:"stringArray",defaultValue:[]},floorBp:{type:"frozen",defaultValue:"auto"},exclude:{type:"stringArray",defaultValue:[]},maxForms:{type:"integer",defaultValue:Me},walkByteBudget:{type:"integer",defaultValue:15e5}},{explicitlyTyped:!0,preProcessSnapshot:G}),wo=Yo;function le(e){e.addAdapterType(()=>new u({name:"WalkFormsAdapter",displayName:"Walk-file structural forms adapter",configSchema:wo,adapterMetadata:{category:"Variant adapters"},getAdapterClass:()=>import("./chunks/WalkFormsAdapter-LHKGRYC6.js").then(o=>o.default)}))}var Xo=d("WalkTabixSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:x.stepBudget},walkByteBudget:{type:"integer",defaultValue:x.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:G}),ko=Xo;function ue(e){e.addAdapterType(()=>new u({name:"WalkTabixSyntenyAdapter",displayName:"Walk-indexed graph adapter",configSchema:ko,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/WalkTabixSyntenyAdapter-ELTYD73I.js").then(o=>o.default)}))}var qo=".bubbles.bed.gz";function Zo(e){return Y(e).toLowerCase().endsWith(".gbz.db")}function Qo(e,o,t){let r=Y(e),a=i=>!t||t===i,s=o!==void 0||Le(e);return Zo(e)?a("GbzBaseSyntenyAdapter")?"GbzBaseSyntenyAdapter":void 0:Ee(e)?a("RgfaTabixAdapter")?"RgfaTabixAdapter":void 0:s?r.endsWith(T)?t==="RgfaTabixAdapter"?"RgfaTabixWalks":a("WalkTabixSyntenyAdapter")?"WalkTabixSyntenyAdapter":void 0:a("MinigraphBubbleAdapter")&&(r.endsWith(qo)||t!==void 0)?"MinigraphBubbleAdapter":void 0:void 0}function To(e,o,t){let r=Qo(e,o,t);return r?je({choice:r,loc:e,indexLoc:o,assembly:"",sample:""}):void 0}function et(e){let o=e.adapter;return o?.type!==void 0&&Ke.has(o.type)&&!o.assemblyNames?.length&&Array.isArray(e.assemblyNames)&&e.assemblyNames.length>0?{...e,adapter:{...o,assemblyNames:e.assemblyNames}}:e}function ot({walksUri:e,walksLocation:o}){let{uri:t,localPath:r,name:a}=m(o)?o:{};return typeof e=="string"&&e!==""?`${e}${T}`:typeof t=="string"?P(t).name:typeof r=="string"?r:typeof a=="string"?a:void 0}function tt(e){let o=m(e.adapter)?e.adapter:void 0,[t]=Array.isArray(e.assemblyNames)?e.assemblyNames:[],r=o&&ze(o)?ot(o):void 0,a=r?Ge(r):void 0;return o&&t&&a&&a!==t&&o.assemblyNameToPanSN===void 0?{...e,adapter:{...o,assemblyNameToPanSN:{[t]:a}}}:e}function ge(e){e.addToExtensionPoint("Core-preProcessTrackConfig",et),e.addToExtensionPoint("Core-preProcessTrackConfig",tt),e.addToExtensionPoint("Core-guessAdapterForLocation",o=>(t,r,a)=>To(t,r,a)??o(t,r,a)),e.addToExtensionPoint("Core-guessTrackTypeForLocation",o=>(t,r)=>ve.has(t)?"GraphTrack":t==="MinigraphBubbleAdapter"?"FeatureTrack":o(t,r))}function fe(e){let o;if(m(e)){let{refName:t,start:r,end:a,assemblyName:s}=e;typeof t=="string"&&typeof r=="number"&&typeof a=="number"&&(o={refName:t,start:r,end:a,assemblyName:typeof s=="string"?s:void 0})}return o}function rt(e,o,t){let r=e.connectedViewId;return r===void 0||r===o||!t.has(r)}function xo(e,o){return e.assemblyName===void 0||o===void 0||o.includes(e.assemblyName)}function So(e){return(Array.isArray(e.tracks)?e.tracks:[]).flatMap(t=>m(t)&&Array.isArray(t.displays)?t.displays.filter(r=>m(r)&&r.type==="LinearGraphDisplay"):[])}function Ao(e,o,t){let r=[],a=Ue(e),s=new Set(a.map(i=>m(i)?i.id:void 0));for(let i of a){if(m(i)&&i.id===o)for(let c of So(i)){let C=fe(c.hoverHighlight);C&&xo(C,t)&&r.push({key:typeof c.id=="string"?c.id:"graph-track",region:C})}for(let c of m(i)?[...So(i),...i.type==="GraphGenomeView"?[i]:[]]:[])(Array.isArray(c.assemblyHoverHighlights)?c.assemblyHoverHighlights:[]).forEach((Fo,Io)=>{let U=fe(Fo);U?.assemblyName!==void 0&&t?.includes(U.assemblyName)&&r.push({key:`${typeof c.id=="string"?c.id:"graph"}-${Io}`,region:U})});if(m(i)&&i.type==="GraphGenomeView"&&rt(i,o,s)){let c=fe(i.hoverHighlight);c&&xo(c,t)&&r.push({key:typeof i.id=="string"?i.id:"graph",region:c})}}return r}var at=qe()(e=>({highlight:{height:"100%",position:"absolute",background:R(e.palette.primary.main,.08),borderLeft:`1px solid ${R(e.palette.primary.main,.4)}`,borderRight:`1px solid ${R(e.palette.primary.main,.4)}`,pointerEvents:"none",zIndex:10}})),nt=X(function({model:o,region:t}){let{classes:r}=at(),a=o.getHighlightCoords(t);return a?k("div",{"data-testid":"graph-node-highlight",className:r.highlight,style:{left:a.left,width:a.width}}):null}),it=X(function({model:o}){let{views:t}=g(o);return k(Se,{children:Ao([...t],o.id,o.assemblyNames).map(({key:r,region:a})=>k(nt,{model:o,region:a},`graph-hover-${r}`))})}),Go=it;var st="LinearGenomeView-TracksContainerComponent";function ye(e){e.contributeToExtensionPoint(st,({model:o})=>k(Go,{model:o},"graphgenomeview-hover-highlight"))}function pt(e){return e.views(o=>({get adapterConfig(){return Ye(o,we(o).configuration)}}))}function he(e){e.addToExtensionPoint("Core-extendPluggableElement",o=>(o instanceof L&&ne.includes(o.name)&&o.extendStateModel(pt),o))}var Lo="GraphGenomeView";var Mo="10.4.2";var be=class extends to{constructor(){super(...arguments);this.name=Lo;this.version=Mo}install(t){ae(t),pe(t),ie(t),se(t),ye(t),ce(t),de(t),oe(t),ue(t),le(t),me(t),te(t),ge(t),he(t),t.addRpcMethod(()=>new I(t)),t.addRpcMethod(()=>new Ne(t)),t.addRpcMethod(()=>new Ve(t)),t.addRpcMethod(()=>new F(t))}configure(t){bo(t);try{Te(t.rootModel)&&t.rootModel.appendToSubMenu(["Add"],{label:"Graph genome view",icon:Ae,onClick:r=>{r.addView("GraphGenomeView",{})}})}catch(r){console.warn("[GraphGenomeView] could not add the Add menu entry",r)}}};export{be as default};
|
|
1
|
+
import{a as Ae,b as Ve,c as H,d as Xe,e as Ze,f as Qe}from"./chunks/chunk-AYJ6SUB5.js";import"./chunks/chunk-IK5G3JHR.js";import{L as Ke,M as Ye,d as E,h as Oe,i as Je,q as m,s as Ue,v as Z,y as $e}from"./chunks/chunk-5RK2OJEU.js";import"./chunks/chunk-SRA6CKRA.js";import{b as d,g as N,h as We,q as qe}from"./chunks/chunk-NZ7YFVK4.js";import{$a as q,Ca as j,Da as _e,Ea as M,ab as v,g as Ie,i as L,ib as De,j as V,k as Ce,l as Pe,m as Be,n as Re,p as Ne}from"./chunks/chunk-PZGI7L73.js";import"./chunks/chunk-LOT3BKM3.js";import"./chunks/chunk-NSWRDOLS.js";import"./chunks/chunk-6GJELLIC.js";import"./chunks/chunk-FSBDVHNR.js";import{a as Q,d as z}from"./chunks/chunk-ZQOMV674.js";import{a as x,b as B,c as Me,d as ee,e as eo,f as W,g as oo}from"./chunks/chunk-ZVMXECJA.js";import"./chunks/chunk-JM4W4PKP.js";import"./chunks/chunk-ESUDWLHY.js";import"./chunks/chunk-GZROPRBI.js";import"./chunks/chunk-YBLNN5FU.js";import"./chunks/chunk-MX7R2F3F.js";import"./chunks/chunk-HHK5MBID.js";import"./chunks/chunk-5VZ5HRTH.js";import{b as Ee,g as je}from"./chunks/chunk-YROUE32O.js";import{a as ve,c as ze,h as He}from"./chunks/chunk-D3QZGLZ3.js";import{d as $,e as n}from"./chunks/chunk-WKD7ALOU.js";import{a as Fe}from"./chunks/chunk-TMM73K4C.js";import"./chunks/chunk-D6TY2QEG.js";import"./chunks/chunk-YBLNN5FU.js";import{b as K,c as T,d as Ge,g as P,h as Y,i as Le}from"./chunks/chunk-EGZZ3ADM.js";import"./chunks/chunk-E55FR7S6.js";import{f as we,g as ke,j as g,k as Te,m as xe}from"./chunks/chunk-5L276I7O.js";import{c as S}from"./chunks/chunk-J2PN6CG3.js";import{J as R}from"./chunks/chunk-H42TSPVA.js";import{a as Se,b as k,d as X}from"./chunks/chunk-DUU6T2I5.js";var _=JBrowseExports["@jbrowse/core/Plugin"];var to=_&&_.__esModule?_.default:_;var D=JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"];var u=D&&D.__esModule?D.default:D;var p=e=>({type:"fileLocation",defaultValue:{uri:e,locationType:"UriLocation"}}),l=(e,o="")=>d(e,{indexType:{model:n.enumeration("IndexType",["TBI","CSI"]),type:"stringEnum",defaultValue:"TBI"},location:p(o)});function A(e,o,t){return{indexType:t?"CSI":"TBI",location:{uri:`${e}.${t?"csi":"tbi"}`,baseUri:o}}}function G(e){let{walksUri:o,baseUri:t}=e;if(typeof o!="string")return e;let r=`${o}${T}`;return{...e,walksLocation:{uri:r,baseUri:t},walksIndex:{uri:`${r}.idx`,baseUri:t}}}var Co=d("GbzBaseSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},gbzDbLocation:p("/path/to/graph.gbz.db"),haplotypeIndexLocation:p(""),readsLocation:p(""),readsIndex:l("GbzBaseReadsIndex"),samplesTsvLocation:p(""),subgraphSnarls:{type:"stringEnum",model:n.enumeration("SnarlOutput",["none","contained","overlapping"]),defaultValue:B.snarls},referenceSample:{type:"string",defaultValue:""},assemblyNameToPanSN:{type:"frozen",defaultValue:{}},context:{type:"number",defaultValue:B.context,advanced:!0},nodeLimit:{type:"number",defaultValue:B.limit,advanced:!0}},{explicitlyTyped:!0,preProcessSnapshot:e=>{let{uri:o,baseUri:t,reads:r}=e;return{...e,...o?{gbzDbLocation:{uri:o,baseUri:t}}:{},...typeof r=="string"?{readsLocation:{uri:r,baseUri:t},...Po(r,t)}:{}}}});function Po(e,o){let{name:t,query:r}=P(e);return t.endsWith(".gz")?{readsIndex:{location:{uri:`${t}.tbi${r}`,baseUri:o}}}:{}}var ro=Co;function oe(e){e.addAdapterType(()=>new u({name:"GbzBaseSyntenyAdapter",displayName:"gbz-base pangenome adapter",configSchema:ro,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/GbzBaseSyntenyAdapter-RM4CXLLF.js").then(o=>o.default)}))}var F=class extends V{constructor(){super(...arguments);this.name="GetGraphHaplotypes"}async execute(t){let{adapter:r}=await Re(this.pluginManager,t,"getHaplotypeNames");return r?.getHaplotypeNames({signal:t.signal})}};var Bo=S(()=>import("./chunks/AddTrackWorkflow-D4QSDNWI.js"));function te(e){e.addAddTrackWorkflowType(()=>new Ie({name:"Pangenome graph track",displayName:"Add pangenome graph track",ReactComponent:Bo,stateModel:n.model({})}))}var I=class extends V{constructor(){super(...arguments);this.name="GraphComputeLayout"}async execute(t){let{graph:r,options:a,signal:s,statusCallback:i}=t;return await new Promise(c=>setTimeout(c,0)),s?.throwIfAborted(),i?.("Computing layout"),We({graph:r,options:a})}};var O=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"];var ao=O&&O.__esModule?O.default:O;var f=JBrowseExports["@jbrowse/core/util/withLaunchInput"],Ro=e=>f!=null&&e in Object(f)?f[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/util/withLaunchInput' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),no=Ro("defineLaunchKeys");var Nt=f&&f.__esModule?f.default:f;var y=JBrowseExports["@jbrowse/core/pluggableElementTypes/models"],Vo=e=>y!=null&&e in Object(y)?y[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/pluggableElementTypes/models' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var io=Vo("BaseViewModel");var jt=y&&y.__esModule?y.default:y;function re(){return n.compose("GraphGenomeView",io,Xe,n.model({type:n.literal("GraphGenomeView"),gfaLocation:n.maybe(n.frozen()),loadedRegion:n.maybe(n.frozen()),loadedTrackId:n.optional(n.string,""),layoutMode:j(E),layoutEngine:_e(N,"fmmm"),color:n.maybe(n.frozen()),size:n.maybe(n.frozen()),layers:n.maybe(n.frozen()),facet:n.maybe(n.frozen()),rows:n.maybe(n.frozen()),hover:j(H),links:j(z),walks:n.maybe(n.frozen())})).views(e=>({get grammar(){return{layoutMode:e.layoutMode,layoutEngine:e.layoutEngine,encoding:{color:e.color},size:e.size,layers:e.layers,facet:e.facet,rows:e.rows,hover:e.hover,links:e.links,walks:e.walks}}})).actions(e=>({writeGrammar({encoding:o,...t}){Object.assign(e,o?{...t,color:o.color}:t)}})).volatile(()=>({widthMeasured:!1})).actions(e=>{let o=e.setWidth;return{setWidth(t){o(t),e.widthMeasured=!0}}}).views(e=>({get rpcSessionId(){return e.id},get paneWidth(){return e.width},get paneMeasured(){return e.widthMeasured},get sourceTrack(){return e.loadedTrackId?e.sessionTrack(e.loadedTrackId):void 0},get graphTracks(){return Qe(g(e).tracks)},get canRetryLoad(){return e.gfaLocation!==void 0||e.loadedTrackId!==""&&e.loadedRegion!==void 0}})).views(e=>({get hasPendingSource(){return e.canRetryLoad&&!e.graph&&!e.loadCanceled},menuItems(){return[...e.exportMenuItems(),...e.launchMenuItems()]}})).actions(e=>{let o=e.clearGraph;function t(r){if(e.gfaLocation)return e.displayName||e.setDisplayName(v(e.gfaLocation)),e.loadGFAFromLocation(e.gfaLocation,r);if(!e.loadedTrackId||!r)return;let a=e.sourceAdapter,s=r.end-r.start,i=e.offReference(r);if(!a)e.setError(new Error(`The track this graph was cut from, "${e.loadedTrackId}", is not in this session`));else if(i)e.setError(new Error(i));else if(s>e.maxRegionBp)e.setError(new Error(`Region too large (${q(s)}) \u2014 zoom in to view graph (max ${q(e.maxRegionBp)})`));else return e.markCut(),e.cutSubgraph(a,r,e.cutOptions)}return{clearGraph(){o(),e.gfaLocation&&e.displayName===v(e.gfaLocation)&&(e.displayName=void 0),e.gfaLocation=void 0,e.loadedRegion=void 0,e.loadedTrackId=""},load(){let r=e.loadedRegion,a=g(e),{assemblyManager:s}=a,i=r&&s.has(r.assemblyName)?s.get(r.assemblyName):void 0;return r&&i?.initialized===!1?s.waitForAssembly(r.assemblyName).catch(()=>{}).then(()=>$(e)&&e.loadedRegion===r?t(Z(a,r)):void 0):t(r&&Z(a,r))}}}).actions(e=>({retryLoad(){e.load()},setGfaLocation(o){e.gfaLocation=o},relayoutFrom(o){return e.loadedTrackId&&e.cutStale?e.load():e.recomputeLayout()},async openGfaLocation(o){await e.loadGFAFromLocation(o),$(e)&&e.hasGraph&&(this.setGfaLocation(o),e.displayName||e.setDisplayName(v(o)))},showTrackInLinearView(o,t,r){let a=g(e);$e({session:a,trackId:o,assembly:t,loc:r}),xe(a)&&a.removeView(e)},afterAttach(){e.graph||e.load()}}))}var No=no()({});function ae(e){e.addViewType(()=>new ao({name:"GraphGenomeView",displayName:"Graph genome view",stateModel:re(),launchKeys:No,ReactComponent:S(()=>import("./chunks/GraphGenomeView-QQFYOKM5.js"))}))}var ne=["MultiWaySyntenyDisplay","LinearSyntenyDisplay","DotplotDisplay","ChordSyntenyDisplay"];function Eo(e){let o=e.getElementTypesInGroup("display"),t=a=>o.find(s=>s.name===a),r=(a,s)=>s&&Object.assign(Object.create(s),{adapterCapabilities:[a]});return[t("LinearGraphDisplay"),r("referenceSegments",t("LinearBasicDisplay")),...ne.map(a=>r("headerLanes",t(a)))].filter(a=>a!==void 0)}function ie(e){e.addTrackType(()=>{let o=d("GraphTrack",{},{baseConfiguration:Pe(e),explicitIdentifier:"trackId"}),t=new Ce({name:"GraphTrack",displayName:"Pangenome graph track",configSchema:o,stateModel:Be(e,"GraphTrack",o)});for(let r of Eo(e))t.addDisplayType(r);return t})}function se(e){e.addToExtensionPoint("LaunchView-GraphGenomeView",o=>{let{session:t,...r}=o;return t.addView("GraphGenomeView",r),o})}var J=JBrowseExports["@jbrowse/core/pluggableElementTypes/DisplayType"];var so=J&&J.__esModule?J.default:J;var h=JBrowseExports["@jbrowse/display-kit/heightModeConfigSchemaFields"],jo=e=>h!=null&&e in Object(h)?h[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/heightModeConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),po=jo("heightModeConfigSchemaFields"),sr=h&&h.__esModule?h.default:h;var b=JBrowseExports["@jbrowse/display-kit/trackHeightConfigSchemaFields"],vo=e=>b!=null&&e in Object(b)?b[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/trackHeightConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),co=vo("trackHeightConfigSchemaFields"),dr=b&&b.__esModule?b.default:b;var w=JBrowseExports["@jbrowse/display-kit/facetConfigSchema"],zo=e=>w!=null&&e in Object(w)?w[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/facetConfigSchema' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),mo=zo("facetConfigSchema");var mr=w&&w.__esModule?w.default:w;var lo=d("GraphFacet",{columns:{type:"maybeNumber",description:"panels per row of a node layout's grid; unset fits them"}},{baseConfiguration:mo});function uo(){return d("LinearGraphDisplay",{layoutMode:{type:"stringEnum",model:M(E,"force"),defaultValue:"force"},layoutEngine:{type:"stringEnum",model:M(N,"fmmm"),defaultValue:"fmmm"},encoding:{type:"frozen",defaultValue:{},plot:!0},size:{type:"frozen",defaultValue:{field:"depth",value:6},plot:!0},layers:{type:"frozen",defaultValue:{},plot:!0},facet:lo,rows:{type:"frozen",defaultValue:{},plot:!0},walks:{type:"frozen",defaultValue:[],plot:!0},hover:{type:"stringEnum",model:M(H,"nodes"),defaultValue:"nodes"},links:{type:"stringEnum",model:M(z,Q),defaultValue:Q},...co({defaultHeight:300,height:"the height of the track the graph is drawn in"}),...po({heightMode:"how a force drawing the view's window places meets the track's height: `fit` shrinks the whole cut to the track's height; `fixed` draws it at the window's scale, so a zoom magnifies it, lowered only as far as keeps the reference the window shows inside the track, which it holds whole, and marks where what hangs off that reference runs past the top or bottom; `grow` does the same in a track grown to hold the cut, up to `growMaxHeight`",growMaxHeight:"the tallest `grow` makes the track, in px",defaultHeightMode:De})},{explicitlyTyped:!0,explicitIdentifier:"displayId",misnamed:{walkLayers:"walks"}})}function pe(e){e.addDisplayType(()=>{let o=uo();return Object.assign(new so({name:"LinearGraphDisplay",displayName:"Graph",configSchema:o,stateModel:Ze(o),trackType:"GraphTrack",viewType:"LinearGenomeView",ReactComponent:S(()=>import("./chunks/LinearGraphDisplay-OFZQJHYG.js"))}),{adapterCapabilities:["getSubgraph"]})})}function Ho(e){let{uri:o,baseUri:t,csi:r}=e;return typeof o=="string"?{...e,bubblesLocation:{uri:o,baseUri:t},index:A(o,t,r)}:e}var Wo=d("MinigraphBubbleAdapter",{bubblesLocation:p("/path/to/graph.bb.bed.gz"),index:l("MinigraphBubbleIndex","/path/to/graph.bb.bed.gz.tbi"),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:Ho}),go=Wo;function de(e){e.addAdapterType(()=>new u({name:"MinigraphBubbleAdapter",displayName:"Minigraph bubble BED adapter",configSchema:go,adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/MinigraphBubbleAdapter-JBYQHQRT.js").then(o=>o.default)}))}function fo(e){let{uri:o,baseUri:t,csi:r,format:a}=e;return typeof o!="string"?e:a===2?{...e,graphLocation:{uri:`${o}${K}`,baseUri:t},graphIndex:A(`${o}${K}`,t,r)}:{...e,segmentsLocation:{uri:`${o}.segs.bed.gz`,baseUri:t},segmentsIndex:A(`${o}.segs.bed.gz`,t,r),linksLocation:{uri:`${o}.links.bed.gz`,baseUri:t},linksIndex:A(`${o}.links.bed.gz`,t,r)}}function _o(e){let{coarse:o,baseUri:t,csi:r}=e;return G(fo(typeof o=="object"&&o!==null?{...e,coarse:fo({baseUri:t,csi:r,...o})}:e))}var Do=d("RgfaTabixCoarseTier",{uri:{type:"maybeString"},format:{type:"maybeNumber"},aboveBpPerPx:{type:"maybeNumber"},foldBelowBp:{type:"maybeNumber"},segmentsLocation:p("/path/to/graph.tier.segs.bed.gz"),segmentsIndex:l("RgfaCoarseSegmentsIndex","/path/to/graph.tier.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.tier.links.bed.gz"),linksIndex:l("RgfaCoarseLinksIndex","/path/to/graph.tier.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaCoarseGraphIndex")}),Oo=d("RgfaTabixAdapter",{segmentsLocation:p("/path/to/graph.segs.bed.gz"),segmentsIndex:l("RgfaSegmentsIndex","/path/to/graph.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.links.bed.gz"),linksIndex:l("RgfaLinksIndex","/path/to/graph.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaGraphIndex"),walksLocation:p(""),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:x.stepBudget},walkByteBudget:{type:"integer",defaultValue:x.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}},coarse:Do},{explicitlyTyped:!0,preProcessSnapshot:_o}),yo=Oo;function ce(e){e.addAdapterType(()=>new u({name:"RgfaTabixAdapter",displayName:"Indexed rGFA adapter",configSchema:yo,adapterCapabilities:["getSubgraph","referenceSegments"],adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/RgfaTabixAdapter-6FJWPEHW.js").then(o=>o.default)}))}function ho(e){return e.viewType==="LinearGenomeView"&&[e.trackType].flat().includes("VariantTrack")}var Jo=[{label:"Auto",value:"auto"},{label:"50 bp",value:50},{label:"1 kb",value:1e3},{label:"10 kb",value:1e4}];function Uo(e,o){return e?`Pinned to ${W(e)}${o===void 0?"":` \xB7 ${o} form${o===1?"":"s"}`}`:"Not pinned"}function $o(e,o){let t=g(e),r=o.flatMap(a=>a?[oo(a)]:[]);for(let{message:a}of[...t.snackbarMessages??[]])r.some(s=>a.startsWith(s))&&t.removeSnackbarMessage?.(a)}function Ko(e){return e.props({formsPinned:n.maybe(n.frozen()),formsFloorBp:n.maybe(n.frozen())}).views(o=>({get configuredAdapter(){return He(o.parentTrack.configuration)},get walkForms(){return this.configuredAdapter.type==="WalkFormsAdapter"}})).views(o=>({get pinnedAliases(){let t=ee(o.formsPinned??o.configuredAdapter.pinned),[r]=Fe(o.parentTrack.configuration),a=t&&r?g(o).assemblyManager.get(r):void 0;return t&&a?a.getAliasesForRefName(t.refName):[]}})).views(o=>({get adapterConfig(){let t=o.configuredAdapter;return o.walkForms?{...t,...o.formsPinned?{pinned:o.formsPinned}:{},...o.pinnedAliases.length>0?{pinnedAliases:o.pinnedAliases}:{},...o.formsFloorBp===void 0?{}:{floorBp:o.formsFloorBp}}:t},get formsWindow(){return ee(this.adapterConfig.pinned)},get formsFloor(){return eo(this.adapterConfig.floorBp)},get formsCount(){return o.sourcesBase?.reduce((t,r)=>t+(Number(r.forms)||1),0)},get visibleWindow(){let t=ke(o),r=Oe(t)?Je(t):void 0;return r&&r.end>r.start?{refName:r.refName,start:Math.max(0,Math.floor(r.start)),end:Math.ceil(r.end)}:void 0}})).volatile(()=>({warnedWindow:void 0})).actions(o=>{let{setSources:t}=o,r=()=>{$o(o,[o.warnedWindow,o.formsWindow])};return{setFormsPinned(a){r(),o.formsPinned=a},setFormsFloorBp(a){r(),o.formsFloorBp=a},setSources(a,s){o.walkForms&&(r(),o.warnedWindow=o.formsWindow),t?.(a,s)}}}).views(o=>{let{trackMenuItems:t}=o;return{formsMenuItems(){let r=o.formsWindow,a=o.visibleWindow;return[{label:Uo(r,o.formsCount),disabled:!0,onClick:()=>{}},{label:"Re-pin to visible region",helpText:"Cut the forms from the region the view shows. Panning and zooming leave the forms alone",disabled:!a||r!==void 0&&W(a)===W(r),onClick:()=>{a&&o.setFormsPinned(a)}},{label:"Hide changes under",subMenu:Jo.map(({label:s,value:i})=>({label:s,type:"radio",checked:o.formsFloor===i,onClick:()=>{o.setFormsFloorBp(i)}}))}]},trackMenuItems(){return o.walkForms?[...t(),...this.formsMenuItems()]:t()}}})}function me(e){e.addToExtensionPoint("Core-extendPluggableElement",o=>(o instanceof L&&ho(o)&&o.extendStateModel(Ko),o))}function bo(e){e.getElementTypesInGroup("display").some(t=>t instanceof L&&ho(t))||console.warn("jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu")}var Yo=d("WalkFormsAdapter",{walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),pinned:{type:"frozen",defaultValue:{}},pinnedAliases:{type:"stringArray",defaultValue:[]},floorBp:{type:"frozen",defaultValue:"auto"},exclude:{type:"stringArray",defaultValue:[]},maxForms:{type:"integer",defaultValue:Me},walkByteBudget:{type:"integer",defaultValue:15e5}},{explicitlyTyped:!0,preProcessSnapshot:G}),wo=Yo;function le(e){e.addAdapterType(()=>new u({name:"WalkFormsAdapter",displayName:"Walk-file structural forms adapter",configSchema:wo,adapterMetadata:{category:"Variant adapters"},getAdapterClass:()=>import("./chunks/WalkFormsAdapter-IRGWL2G4.js").then(o=>o.default)}))}var Xo=d("WalkTabixSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:x.stepBudget},walkByteBudget:{type:"integer",defaultValue:x.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:G}),ko=Xo;function ue(e){e.addAdapterType(()=>new u({name:"WalkTabixSyntenyAdapter",displayName:"Walk-indexed graph adapter",configSchema:ko,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/WalkTabixSyntenyAdapter-7RQNFBIG.js").then(o=>o.default)}))}var qo=".bubbles.bed.gz";function Zo(e){return Y(e).toLowerCase().endsWith(".gbz.db")}function Qo(e,o,t){let r=Y(e),a=i=>!t||t===i,s=o!==void 0||Le(e);return Zo(e)?a("GbzBaseSyntenyAdapter")?"GbzBaseSyntenyAdapter":void 0:Ee(e)?a("RgfaTabixAdapter")?"RgfaTabixAdapter":void 0:s?r.endsWith(T)?t==="RgfaTabixAdapter"?"RgfaTabixWalks":a("WalkTabixSyntenyAdapter")?"WalkTabixSyntenyAdapter":void 0:a("MinigraphBubbleAdapter")&&(r.endsWith(qo)||t!==void 0)?"MinigraphBubbleAdapter":void 0:void 0}function To(e,o,t){let r=Qo(e,o,t);return r?je({choice:r,loc:e,indexLoc:o,assembly:"",sample:""}):void 0}function et(e){let o=e.adapter;return o?.type!==void 0&&Ke.has(o.type)&&!o.assemblyNames?.length&&Array.isArray(e.assemblyNames)&&e.assemblyNames.length>0?{...e,adapter:{...o,assemblyNames:e.assemblyNames}}:e}function ot({walksUri:e,walksLocation:o}){let{uri:t,localPath:r,name:a}=m(o)?o:{};return typeof e=="string"&&e!==""?`${e}${T}`:typeof t=="string"?P(t).name:typeof r=="string"?r:typeof a=="string"?a:void 0}function tt(e){let o=m(e.adapter)?e.adapter:void 0,[t]=Array.isArray(e.assemblyNames)?e.assemblyNames:[],r=o&&ze(o)?ot(o):void 0,a=r?Ge(r):void 0;return o&&t&&a&&a!==t&&o.assemblyNameToPanSN===void 0?{...e,adapter:{...o,assemblyNameToPanSN:{[t]:a}}}:e}function ge(e){e.addToExtensionPoint("Core-preProcessTrackConfig",et),e.addToExtensionPoint("Core-preProcessTrackConfig",tt),e.addToExtensionPoint("Core-guessAdapterForLocation",o=>(t,r,a)=>To(t,r,a)??o(t,r,a)),e.addToExtensionPoint("Core-guessTrackTypeForLocation",o=>(t,r)=>ve.has(t)?"GraphTrack":t==="MinigraphBubbleAdapter"?"FeatureTrack":o(t,r))}function fe(e){let o;if(m(e)){let{refName:t,start:r,end:a,assemblyName:s}=e;typeof t=="string"&&typeof r=="number"&&typeof a=="number"&&(o={refName:t,start:r,end:a,assemblyName:typeof s=="string"?s:void 0})}return o}function rt(e,o,t){let r=e.connectedViewId;return r===void 0||r===o||!t.has(r)}function xo(e,o){return e.assemblyName===void 0||o===void 0||o.includes(e.assemblyName)}function So(e){return(Array.isArray(e.tracks)?e.tracks:[]).flatMap(t=>m(t)&&Array.isArray(t.displays)?t.displays.filter(r=>m(r)&&r.type==="LinearGraphDisplay"):[])}function Ao(e,o,t){let r=[],a=Ue(e),s=new Set(a.map(i=>m(i)?i.id:void 0));for(let i of a){if(m(i)&&i.id===o)for(let c of So(i)){let C=fe(c.hoverHighlight);C&&xo(C,t)&&r.push({key:typeof c.id=="string"?c.id:"graph-track",region:C})}for(let c of m(i)?[...So(i),...i.type==="GraphGenomeView"?[i]:[]]:[])(Array.isArray(c.assemblyHoverHighlights)?c.assemblyHoverHighlights:[]).forEach((Fo,Io)=>{let U=fe(Fo);U?.assemblyName!==void 0&&t?.includes(U.assemblyName)&&r.push({key:`${typeof c.id=="string"?c.id:"graph"}-${Io}`,region:U})});if(m(i)&&i.type==="GraphGenomeView"&&rt(i,o,s)){let c=fe(i.hoverHighlight);c&&xo(c,t)&&r.push({key:typeof i.id=="string"?i.id:"graph",region:c})}}return r}var at=qe()(e=>({highlight:{height:"100%",position:"absolute",background:R(e.palette.primary.main,.08),borderLeft:`1px solid ${R(e.palette.primary.main,.4)}`,borderRight:`1px solid ${R(e.palette.primary.main,.4)}`,pointerEvents:"none",zIndex:10}})),nt=X(function({model:o,region:t}){let{classes:r}=at(),a=o.getHighlightCoords(t);return a?k("div",{"data-testid":"graph-node-highlight",className:r.highlight,style:{left:a.left,width:a.width}}):null}),it=X(function({model:o}){let{views:t}=g(o);return k(Se,{children:Ao([...t],o.id,o.assemblyNames).map(({key:r,region:a})=>k(nt,{model:o,region:a},`graph-hover-${r}`))})}),Go=it;var st="LinearGenomeView-TracksContainerComponent";function ye(e){e.contributeToExtensionPoint(st,({model:o})=>k(Go,{model:o},"graphgenomeview-hover-highlight"))}function pt(e){return e.views(o=>({get adapterConfig(){return Ye(o,we(o).configuration)}}))}function he(e){e.addToExtensionPoint("Core-extendPluggableElement",o=>(o instanceof L&&ne.includes(o.name)&&o.extendStateModel(pt),o))}var Lo="GraphGenomeView";var Mo="10.4.4";var be=class extends to{constructor(){super(...arguments);this.name=Lo;this.version=Mo}install(t){ae(t),pe(t),ie(t),se(t),ye(t),ce(t),de(t),oe(t),ue(t),le(t),me(t),te(t),ge(t),he(t),t.addRpcMethod(()=>new I(t)),t.addRpcMethod(()=>new Ne(t)),t.addRpcMethod(()=>new Ve(t)),t.addRpcMethod(()=>new F(t))}configure(t){bo(t);try{Te(t.rootModel)&&t.rootModel.appendToSubMenu(["Add"],{label:"Graph genome view",icon:Ae,onClick:r=>{r.addView("GraphGenomeView",{})}})}catch(r){console.warn("[GraphGenomeView] could not add the Add menu entry",r)}}};export{be as default};
|
|
2
2
|
//# sourceMappingURL=jbrowse-plugin-graphgenomeviewer.esm.js.map
|