jbrowse-plugin-graphgenomeviewer 8.3.2 → 8.3.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.
Files changed (78) hide show
  1. package/dist/chunks/GbzBaseSyntenyAdapter-GX3NGJHG.js +2 -0
  2. package/dist/chunks/GbzBaseSyntenyAdapter-GX3NGJHG.js.map +7 -0
  3. package/dist/chunks/{GraphGenomeView-NLPWMIBS.js → GraphGenomeView-JJNU2432.js} +2 -2
  4. package/dist/chunks/{GraphTrackSettingsDialog-7LHAOYX3.js → GraphTrackSettingsDialog-7NGUPDUJ.js} +2 -2
  5. package/dist/chunks/{HighlightColorDialog-YQEMRPZ6.js → HighlightColorDialog-KFXSZXTC.js} +2 -2
  6. package/dist/chunks/{LinearGraphDisplay-BEU7V4JU.js → LinearGraphDisplay-K3AT3S7J.js} +2 -2
  7. package/dist/chunks/{MinigraphBubbleAdapter-FZZLY3ZI.js → MinigraphBubbleAdapter-XYAUUM35.js} +2 -2
  8. package/dist/chunks/{RgfaTabixAdapter-DXBQEVFS.js → RgfaTabixAdapter-SBIUUIRI.js} +2 -2
  9. package/dist/chunks/{WalkFormsAdapter-ZKZ5PUYO.js → WalkFormsAdapter-ANELMZU4.js} +2 -2
  10. package/dist/chunks/{WalkTabixSyntenyAdapter-HEGPYGKB.js → WalkTabixSyntenyAdapter-I3MGWUQ5.js} +2 -2
  11. package/dist/chunks/{chunk-Y7VFVMQI.js → chunk-3HS6N7WB.js} +2 -2
  12. package/dist/chunks/{chunk-Y7VFVMQI.js.map → chunk-3HS6N7WB.js.map} +1 -1
  13. package/dist/chunks/{chunk-KM2INI7Q.js → chunk-3S33TTXF.js} +2 -2
  14. package/dist/chunks/{chunk-KM2INI7Q.js.map → chunk-3S33TTXF.js.map} +1 -1
  15. package/dist/chunks/{chunk-IQQOJGX3.js → chunk-4B3GQTHX.js} +2 -2
  16. package/dist/chunks/{chunk-IQQOJGX3.js.map → chunk-4B3GQTHX.js.map} +1 -1
  17. package/dist/chunks/chunk-C5YAQNOO.js +4 -0
  18. package/dist/chunks/chunk-C5YAQNOO.js.map +7 -0
  19. package/dist/chunks/chunk-CNFMSSE2.js +3 -0
  20. package/dist/chunks/chunk-CNFMSSE2.js.map +7 -0
  21. package/dist/chunks/chunk-DKQFTMWL.js +2 -0
  22. package/dist/chunks/chunk-DKQFTMWL.js.map +7 -0
  23. package/dist/chunks/{chunk-JTOW3TOE.js → chunk-EENENDGZ.js} +3 -3
  24. package/dist/chunks/{chunk-NB4X56M3.js → chunk-EVKN4Y3R.js} +2 -2
  25. package/dist/chunks/{chunk-NB4X56M3.js.map → chunk-EVKN4Y3R.js.map} +1 -1
  26. package/dist/chunks/{chunk-MNFL7BAC.js → chunk-HICKAMKK.js} +2 -2
  27. package/dist/chunks/{chunk-MNFL7BAC.js.map → chunk-HICKAMKK.js.map} +1 -1
  28. package/dist/chunks/{chunk-MFMAQO3W.js → chunk-HQ7FQACT.js} +2 -2
  29. package/dist/chunks/{chunk-MFMAQO3W.js.map → chunk-HQ7FQACT.js.map} +1 -1
  30. package/dist/chunks/{chunk-OMF5XFKR.js → chunk-L372SDUG.js} +1 -1
  31. package/dist/chunks/{chunk-OMF5XFKR.js.map → chunk-L372SDUG.js.map} +1 -1
  32. package/dist/chunks/{chunk-2FCFK2B5.js → chunk-LD6RX4AZ.js} +1 -1
  33. package/dist/chunks/{chunk-2FCFK2B5.js.map → chunk-LD6RX4AZ.js.map} +1 -1
  34. package/dist/chunks/chunk-NBS4FGQ6.js +4 -0
  35. package/dist/chunks/{chunk-D6NFDQQI.js.map → chunk-NBS4FGQ6.js.map} +3 -3
  36. package/dist/chunks/{chunk-HM7XSNBN.js → chunk-NFPLX56S.js} +1 -1
  37. package/dist/chunks/{chunk-HM7XSNBN.js.map → chunk-NFPLX56S.js.map} +1 -1
  38. package/dist/chunks/{chunk-5X3OZSDO.js → chunk-OHQ3WIPI.js} +2 -2
  39. package/dist/chunks/{chunk-VP6AGIRF.js → chunk-OXU7F4BR.js} +2 -2
  40. package/dist/chunks/{chunk-TNEXOJ5F.js → chunk-QB5JERW4.js} +1 -1
  41. package/dist/chunks/{chunk-TNEXOJ5F.js.map → chunk-QB5JERW4.js.map} +1 -1
  42. package/dist/chunks/chunk-SYKOZDP6.js +2 -0
  43. package/dist/chunks/{chunk-YMK7HFJV.js → chunk-WANYNRGU.js} +2 -2
  44. package/dist/chunks/{chunk-EKIQ3ATV.js → chunk-YS3R3J2I.js} +2 -2
  45. package/dist/chunks/{chunk-EKIQ3ATV.js.map → chunk-YS3R3J2I.js.map} +2 -2
  46. package/dist/chunks/{renderSvg-XIEGA5N5.js → renderSvg-2YULK24A.js} +2 -2
  47. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +2 -2
  48. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +2 -2
  49. package/package.json +9 -9
  50. package/src/GraphGenomeView/components/LabelLayer.tsx +9 -4
  51. package/src/RgfaTabixAdapter/configSchema.ts +1 -1
  52. package/src/WalkFormsAdapter/configSchema.ts +1 -1
  53. package/src/WalkTabixSyntenyAdapter/configSchema.ts +1 -1
  54. package/src/version.ts +1 -1
  55. package/dist/chunks/GbzBaseSyntenyAdapter-W5J3E5VT.js +0 -2
  56. package/dist/chunks/GbzBaseSyntenyAdapter-W5J3E5VT.js.map +0 -7
  57. package/dist/chunks/chunk-D6NFDQQI.js +0 -4
  58. package/dist/chunks/chunk-D7MOOK6H.js +0 -4
  59. package/dist/chunks/chunk-D7MOOK6H.js.map +0 -7
  60. package/dist/chunks/chunk-EINURNZ6.js +0 -2
  61. package/dist/chunks/chunk-XBZ4C4R3.js +0 -3
  62. package/dist/chunks/chunk-XBZ4C4R3.js.map +0 -7
  63. package/dist/chunks/chunk-ZWRAQSXC.js +0 -2
  64. package/dist/chunks/chunk-ZWRAQSXC.js.map +0 -7
  65. /package/dist/chunks/{GraphGenomeView-NLPWMIBS.js.map → GraphGenomeView-JJNU2432.js.map} +0 -0
  66. /package/dist/chunks/{GraphTrackSettingsDialog-7LHAOYX3.js.map → GraphTrackSettingsDialog-7NGUPDUJ.js.map} +0 -0
  67. /package/dist/chunks/{HighlightColorDialog-YQEMRPZ6.js.map → HighlightColorDialog-KFXSZXTC.js.map} +0 -0
  68. /package/dist/chunks/{LinearGraphDisplay-BEU7V4JU.js.map → LinearGraphDisplay-K3AT3S7J.js.map} +0 -0
  69. /package/dist/chunks/{MinigraphBubbleAdapter-FZZLY3ZI.js.map → MinigraphBubbleAdapter-XYAUUM35.js.map} +0 -0
  70. /package/dist/chunks/{RgfaTabixAdapter-DXBQEVFS.js.map → RgfaTabixAdapter-SBIUUIRI.js.map} +0 -0
  71. /package/dist/chunks/{WalkFormsAdapter-ZKZ5PUYO.js.map → WalkFormsAdapter-ANELMZU4.js.map} +0 -0
  72. /package/dist/chunks/{WalkTabixSyntenyAdapter-HEGPYGKB.js.map → WalkTabixSyntenyAdapter-I3MGWUQ5.js.map} +0 -0
  73. /package/dist/chunks/{chunk-JTOW3TOE.js.map → chunk-EENENDGZ.js.map} +0 -0
  74. /package/dist/chunks/{chunk-5X3OZSDO.js.map → chunk-OHQ3WIPI.js.map} +0 -0
  75. /package/dist/chunks/{chunk-VP6AGIRF.js.map → chunk-OXU7F4BR.js.map} +0 -0
  76. /package/dist/chunks/{chunk-EINURNZ6.js.map → chunk-SYKOZDP6.js.map} +0 -0
  77. /package/dist/chunks/{chunk-YMK7HFJV.js.map → chunk-WANYNRGU.js.map} +0 -0
  78. /package/dist/chunks/{renderSvg-XIEGA5N5.js.map → renderSvg-2YULK24A.js.map} +0 -0
@@ -0,0 +1,4 @@
1
+ import{Ab as de,Da as $e,Ea as Ke,Fa as Xe,Fb as Ze,Ga as Ue,Hb as G,Ib as be,Ja as Fe,Jb as fe,Na as Ye,Nb as Qe,Oa as ie,Pb as et,Ra as ze,Rb as tt,Tb as he,Ua as Ve,Va as le,Xb as nt,Za as ce,a as Se,ac as rt,b as X,da as Ie,db as qe,f as Q,g as ee,gc as ot,ic as at,jb as je,la as P,lb as pe,ma as ae,ob as Je,sa as Be,ta as We,ua as Ge,va as se,xa as De,ya as He,zb as ue}from"./chunk-CNFMSSE2.js";import{D as oe,f as Oe,m as I,p as re,q as Ae,r as B}from"./chunk-YS3R3J2I.js";import{A as Ee,E as ne,T as Ne,U as ve,Z as Te,m as A,o as F,p as te,x as _e}from"./chunk-DKQFTMWL.js";import{b as E,c as W}from"./chunk-QB5JERW4.js";import{c as Z}from"./chunk-HQ7FQACT.js";import{e as K}from"./chunk-3WG3GF2A.js";import{b as Pe,d as M,e as Le,f as Me,g as U,h as Ce}from"./chunk-NIEZKWQV.js";import{a as v,b as u,c as k,d as m}from"./chunk-JMBDTNUR.js";var _t="data-pans-with-drawing";function st(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var C=m(function({model:t,zIndex:n,overflow:o="hidden",testId:r,pansWithDrawing:a,children:l}){return u("svg",{style:{...st(n,o),userSelect:a?"none":void 0},width:t.paneWidth,height:t.canvasHeight,"data-testid":r,...a?{[_t]:""}:{},children:l})}),it=m(function({model:t,children:n}){let{scaleX:o,scaleY:r,translateX:a,translateY:l}=t;return u("g",{transform:`translate(${a} ${l}) scale(${o} ${r})`,children:n})});function _({model:e,zIndex:t,shown:n=!0,testId:o,paint:r}){let a=Ce(null);return Le(()=>{if(n)return Se(()=>{let l=a.current,i=l?.getContext("2d");if(l&&i){let d=e.paneWidth,c=e.canvasHeight;Ie(at());let p=Ze(l,d,c);i.setTransform(p,0,0,p,0,0),i.clearRect(0,0,d,c),r(i,p)}})},[e,n,r]),u("canvas",{ref:a,"data-testid":n?o:void 0,style:{...st(t),display:n?"block":"none"}})}var Et=m(function({model:t}){let{bubbleHalos:n,hoveredBubble:o}=t;if(n.length===0)return null;let r=t.contigThickness*Qe;return u(C,{model:t,zIndex:2,testId:"graph-bubble-halos",children:u(it,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||o&&E(a.bubble,o))).map(a=>u("path",{d:a.path,fill:"none",stroke:P[a.kind],strokeOpacity:o&&E(a.bubble,o)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},W(a.bubble)))})})}),Gn=Et;var lt=["#d4735e","#d8a94a","#c98aa4"],Ot="#e6e6e6",Nt="#555",vt="bold 11px sans-serif";var ge=e=>lt[e]??Ot;function Y(e){let t=String.fromCharCode(65+e%26);return e<26?t:Y(Math.floor(e/26)-1)+t}var z=lt.length;function ct(e,t,n){e.font=vt,e.textAlign="center",e.textBaseline="middle";for(let{row:o,start:r,bp:a,block:l}of t){let i=n.x(r),d=n.x(r+a)-i,c=n.rowCentre(o)-n.barPx/2;e.fillStyle=ge(l),e.fillRect(i,c,d,n.barPx),e.strokeStyle=Nt,e.lineWidth=1,e.strokeRect(i+.5,c+.5,d-1,n.barPx-1),d>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(Y(l),i+d/2,n.rowCentre(o)))}}var R=18,me=32,dt="rgba(160, 160, 160, 0.45)",At="#18181c",It=6,bt=7,Bt="#b8b8c0",V=We-4,Wt="rgba(119, 119, 119, 0.85)",Gt=15,pt=10;function j(e){return e.kind==="fill"?e.width??R:R}var ke=e=>e.length>1?3:4;function D(e){switch(e.kind){case"fill":return e.height??8;case"bands":return ke(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"blank":return 0}}function Ar(e){return e.reduce((t,n)=>n.swatch?Math.max(t,j(n.swatch)):t,0)}function Ir(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(D(n.swatch))+3):t,Gt)}var S=e=>[{offset:0,color:e}];function q(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:S(t),width:pt,height:pt,edged:!0}}}function ut(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}function Dt(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(o=>E(o.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:P[n.kind]}:{kind:"blank"},closesBubble:!0}]}function Ht(e){let t=e.walkLift?void 0:e.referenceRampDomain;if(!t)return[];let n=Math.round(t.start),o=Math.round(t.end);return[{key:"ramp",label:`position on ${e.graph?Z(e.graph):"reference"}`,swatch:{kind:"fill",stops:I,width:me},under:`${n.toLocaleString("en-US")}-${o.toLocaleString("en-US")} (${ne(o-n)})`},...e.referenceRampDrawsOffReference?[q("off",B,"off the reference")]:[]]}function $t(e){let t=e.walkLift;if(t)return t.walks.map(r=>oe(r.encoding));if(e.effectiveColorScheme==="reference-position")return[I];let n=e.referenceStripBlocks.map(r=>r.colors[0]).filter((r,a,l)=>r!==l[a-1]),o=Math.min(It,n.length);return[o===0?S(re):Array.from({length:o},(r,a)=>({offset:o>1?a/(o-1):0,color:n[o>1?Math.round(a*(n.length-1)/(o-1)):0]}))]}function Kt(e){if(!e.referenceStripShown)return[];let t=(e.walkLift?.walks.length??0)>1;return[{key:"strip",label:`reference${t?", a row per walk":""}`,swatch:{kind:"bands",bands:$t(e)}},...e.referenceStripFaded?[q("strip-faded",re,e.walkLift?`reference not on ${t?"that row's walk":e.liftedWalksLabel}`:"reference outside the open bubble")]:[],...e.referenceStripOverhangs?[{key:"overhang",label:"graph runs past this edge",swatch:{kind:"overhang"}}]:[]]}function Xt(e){let t=new Map;for(let n of e.bubbleHalos)if(!n.whole){let o=P[n.kind],r=t.get(o)??new Set;r.add(ae[n.kind]),t.set(o,r)}return[...t].map(([n,o])=>{let r=[...o].join(" or ");return{key:`halo-${n}`,label:r===ae.superbubble?r:`${r} bubble`,swatch:{kind:"halo",color:n}}})}function ft(e){let{graph:t}=e;return t&&Ee(e.deletions,e.walkLift).length>0?[{key:"deletion",label:_e(Z(t)),swatch:{kind:"line",color:e.walkLift?dt:At,dashed:!0}}]:[]}function we(e,t,n,o){return{key:e,label:t,swatch:{kind:"fill",stops:S(o),width:me,height:n}}}var Ut=e=>e>=10?Math.round(e):Math.round(e*10)/10;function Ft(e){let{graph:t,contigThickness:n,depthRange:o}=e;if(!t||!e.drawsNodes||e.walkRowBars)return[];if(e.nodeWidth==="frequency"){let c=t.nodes.some(p=>p.frequency!==void 0);return Ne(n).map(({label:p,widthPx:b})=>we(`width-${p}`,c?`AF ${p}`:`${p} of haplotypes`,b,B))}if(e.nodeWidth!=="depth"||!o||o.min===o.max)return[];let r=t.paths?.length??0,a=r>0,l=[...new Set([o.max,o.mean,o.min].map(a?Math.round:Ut))],i=l[0]>r,d=c=>i?`${c.toLocaleString("en-US")} walk pass${c===1?"":"es"}`:`${c.toLocaleString("en-US")} walk${c===1?"":"s"}`;return l.map(c=>we(`width-${c}`,a?d(c):`depth ${c.toLocaleString("en-US")}`,ve({depth:c},n,"depth",o.mean),B))}function Yt(e){let t=e.busiestLink;return!e.drawsNodes||e.walkRowBars||e.linkWidth!=="walks"||t===0?[]:(t>1?[t,1]:[1]).map(o=>we(`link-width-${o}`,`${o.toLocaleString("en-US")} walk${o===1?"":"s"}`,e.connectorThickness*Te(o,t,"walks"),Wt))}function zt(e){return e.genePins.some(t=>t.exonsByNode.length>0)?[{key:"exon",label:"exon",swatch:{kind:"outline",color:G,stroke:2,radius:5,height:8}}]:[]}function Vt(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function qt(e){return e.pathLegend.map(({name:t,label:n,color:o})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:o}}))}function O(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:bt,square:!0}}}function jt(e){let{roles:t,haplotypeTube:n,bundled:o,values:r,logWidths:a,foldBp:l,forwardReads:i,reverseReads:d,substitution:c,insertion:p,deletion:b}=e.tubeMapKeys,h=e.readsShown,s=[];if(r){s.push(O("value-reference",S(pe),"reference"));for(let{value:f,color:g}of r)s.push(O(`value-${f}`,S(g),f))}return t&&s.push(O("ref",S(pe),"reference"),O("hap",S(n),o?"shared route, \xD7n haplotypes":"haplotype")),i&&s.push(O("fwd",ut(Q),"read on the forward strand")),d&&s.push(O("rev",ut(ee),"read on the reverse strand")),h&&h.shown<h.total&&s.push({key:"sampled",label:`${h.shown.toLocaleString("en-US")} of ${h.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),c&&s.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),p&&s.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),b&&s.push(O("del",S("grey"),"read deletion")),l!==void 0&&s.push({key:"tube-fold",label:`haplotype variant < ${ne(l)}`,swatch:{kind:"tick",color:Ve(),height:bt,backing:Bt}}),a&&s.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),s}function Jt(e){return e.kind==="gene"?{kind:"outline",color:Be,stroke:1.5,radius:0,height:V}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?I:S(e.fill),height:e.kind==="gap"?e.px:V}}function Zt(e){let t=new Set(e.sharedBlocks?.map(o=>o.block)),n=o=>({kind:"fill",stops:S(ge(o)),height:V});return[...[...t].filter(o=>o<z).sort((o,r)=>o-r).map(o=>({key:`block-${o}`,label:`${Y(o)}: off the reference, walked by several rows`,swatch:n(o)})),...[...t].some(o=>o>=z)?[{key:"block-more",label:"more shared blocks",swatch:n(z)}]:[]]}function Qt(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(r=>r.call??[]),o=(r,a,l)=>({key:r,label:l,swatch:{kind:"tick",color:a,height:V}});return[...$e(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation}).map(r=>({key:`rows-${r.label}`,label:r.label,swatch:r.note?void 0:Jt(r.swatch)})),...Zt(e),...n.some(r=>r.spanningReads!==0)?[o("call",Ke,"allele length called for this walk")]:[],...n.some(r=>r.spanningReads===0)?[o("unbacked",Xe,"called with no read spanning it")]:[],...n.some(r=>r.agrees===!1)?[o("disagrees",Ue,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function en(e,t){let n=nt(t,e.walkReference);return{key:`walk-${t.name}`,strong:e.walkLabel(t.name),label:n.delta+n.gaps+n.reversed,swatch:{kind:"fill",stops:oe(t.encoding),width:n.shades?me:R},under:n.scale,title:n.hover,walk:t}}function ht(e,t){return[...e.liftPaintsOffReference?[q("lift-off",B,"off the reference")]:[],q("faded",dt,t)]}function tn(e){let t=e.walkLift;if(!t||e.facetPanels)return[];let n=t.walks.map(r=>en(e,r)),o=e.graph?he(e.graph,t,e.liftedWalksLabel):`not on ${e.liftedWalksLabel}`;return[...n,...ht(e,o)]}function Br(e){let{graph:t,facetPanels:n}=e;if(!t||!n)return[];let o=new Set(n.map(r=>he(t,r,"the panel's walk")));return[...ht(e,o.size===1?[...o][0]:"not on the panel's walk"),...ft(e)]}function Wr(e){let t=[{testid:"graph-open-bubble-legend",rows:Dt(e)},{testid:"graph-ramp-legend",rows:Ht(e),group:"Color"},{testid:"graph-walk-readout",rows:tn(e),group:"Walks"},{testid:"graph-width-legend",rows:Ft(e),group:"Node thickness"},{testid:"graph-link-width-legend",rows:Yt(e),group:"Link thickness"},{testid:"graph-halo-legend",rows:Xt(e),group:"Marks"},{testid:"graph-deletion-legend",rows:ft(e),group:"Marks"},{testid:"graph-gene-legend",rows:zt(e),group:"Marks"},{testid:"graph-path-legend",rows:qt(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:jt(e),group:"Tube map"},{testid:"graph-walk-rows-legend",rows:Qt(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:Kt(e),group:"Top strip"},{testid:"graph-fold-legend",rows:Vt(e)}].filter(r=>r.rows.length>0);if(new Set(t.flatMap(r=>r.group??[])).size<2)return t;let o=new Set;return t.map((r,a)=>{let{group:l}=r;return l?o.has(l)?r:(o.add(l),{...r,heading:l}):a===0?r:{...r,spaced:!0}})}function nn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function gt(e,t){if(typeof e=="string")return e;let n={key:t};for(let[o,r]of Object.entries(e.attrs))r!==void 0&&(n[nn(o)]=r);return Pe(e.tag,n,e.children.map(gt))}function T(){return Me().replaceAll(/[^\w-]/g,"")}function H({el:e}){return gt(e,0)}var rn="rgba(0, 0, 0, 0.28)";function wt({id:e,x:t,y:n,stops:o,width:r,height:a,square:l,edged:i}){let d=i?.5:0,c=p=>u("rect",{x:t+d,y:n+d,width:r-d*2,height:a-d*2,rx:l?0:2,fill:p,stroke:i?rn:void 0});return o.length>1?k(v,{children:[u("defs",{children:u("linearGradient",{id:e,children:o.map((p,b)=>u("stop",{offset:p.offset,stopColor:p.color},b))})}),c(`url(#${e})`)]}):c(o[0].color)}function on({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let r=D(e);return u(wt,{id:n,x:t,y:-5-r/2,stops:e.stops,width:j(e),height:r,square:e.square,edged:e.edged})}case"bands":{let r=ke(e.bands),a=-5-D(e)/2;return u(v,{children:e.bands.map((l,i)=>u(wt,{id:`${n}-${i}`,x:t,y:a+i*r,stops:l,width:R,height:r,square:!0},i))})}case"line":return e.dashed?u("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):u("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return u("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let r=e.stroke/2;return u("rect",{x:t+r,y:-5-e.height/2+r,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-r),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return u("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"glyph":return u("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let r=-5-e.height/2;return k(v,{children:[e.backing?u("rect",{x:t,y:r,width:R,height:e.height,fill:e.backing}):null,u("rect",{x:t+R/2-1,y:r,width:2,height:e.height,fill:e.color})]})}case"bracket":return u("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:Ye()});case"blank":return null}}function Ur({swatch:e}){let t=T(),n=D(e);return u("svg",{width:j(e),height:n,overflow:"visible",style:{flex:"none"},children:u("g",{transform:`translate(0 ${n/2+5})`,children:u(on,{swatch:e,x:0,id:t})})})}var zr={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Vr={display:"flex",alignItems:"center",gap:5},qr={color:"#666"},an="#6b7479",jr=4,Jr={color:an,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};var sn=m(function({model:t}){let n=`exon-outline-${T()}`,o=U(()=>X(()=>{let{genePins:b,walkLift:h}=t,s=h?void 0:t.openBubbleFocus,f=s?b.map(g=>({...g,exonsByNode:g.exonsByNode.filter(w=>s.nodeIds.has(w.nodeId))})):b;return be(f,t.nodeInk.halfWidthPx,h)}),[t]),{scaleX:r,scaleY:a,translateX:l,translateY:i,paneWidth:d,canvasHeight:c}=t,p=fe(o.get(),{id:n,width:d,height:c,transform:`translate(${l} ${i}) scale(${r} ${a})`});return p?u(C,{model:t,zIndex:2,testId:"graph-gene-pins",children:u(H,{el:p})}):null}),ao=sn;function mt(e,t,n){return{x:e-n/2,y:t-A-F+2,width:n,height:A+F*2-2}}function kt(e,t,n){let o=mt(e.x,e.y,e.w);return t>=o.x&&t<=o.x+o.width&&n>=o.y&&n<=o.y+o.height}function $({x:e,y:t,w:n,text:o,note:r,color:a,edge:l=a,italic:i,dimmed:d,title:c,testId:p,onClick:b,onHover:h}){return k("g",{style:{pointerEvents:b||h?"auto":"none",cursor:b?"pointer":void 0,opacity:d?.35:1},"data-testid":p,onClick:b,onMouseEnter:()=>{h?.(!0)},onMouseLeave:()=>{h?.(!1)},...b&&{role:"button",tabIndex:0,"aria-label":(c??o).replaceAll(`
2
+ `,", "),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),b())},onFocus:()=>{h?.(!0)},onBlur:()=>{h?.(!1)}},children:[c?u("title",{children:c}):null,u("rect",{...mt(e,t,n),rx:3,fill:"rgba(255,255,255,0.85)",stroke:l,strokeWidth:1}),k("text",{x:e,y:t,fontSize:A,fontFamily:"sans-serif",fontStyle:i?"italic":void 0,fontWeight:i?600:void 0,fill:a,textAnchor:"middle",children:[o,r?u("tspan",{fontStyle:"normal",fontWeight:"normal",children:r}):null]})]})}var Rt="#1c1c22",Re=9,xe=3;function Co({genes:e},t,n){let o=e.find(l=>kt(l,t,n))?.item;if(!o)return;let{gene:r}=o,a=et(o);return{label:r.name,readout:`${r.refName}:${r.start.toLocaleString()}-${r.end.toLocaleString()}${a?`, ${a} in the cut`:""}`}}var ln=m(function({model:t}){let{bubbles:n,genes:o,ticks:r}=t.overlayLabels;if(n.length+o.length+r.length===0)return null;let{scaleY:a,translateY:l,contigThickness:i,hoveredBubble:d}=t,c=d?r.find(s=>E(s.item.bubble,d)):void 0,p=s=>r[Number(s.getAttribute("data-tick"))],b=s=>t.bubbleFaded(s),h=s=>t.bubbleIsOpen(s.bubble);return k(C,{model:t,zIndex:3,testId:"graph-label-layer",pansWithDrawing:!0,children:[u("g",{"data-testid":"graph-bubble-ticks",onClick:s=>{let f=p(s.target);f&&t.toggleBubble(f.item.bubble)},onMouseOver:s=>{let f=p(s.target);f&&t.setHoveredBubble(f.item.bubble)},onMouseOut:()=>{K(t)&&t.setHoveredBubble(null)},onFocus:s=>{let f=p(s.target);f&&t.setHoveredBubble(f.item.bubble)},onBlur:()=>{K(t)&&t.setHoveredBubble(null)},onKeyDown:s=>{let f=p(s.target);f&&(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),t.toggleBubble(f.item.bubble))},children:r.map(({item:s,x:f,y:g},w)=>u("rect",{"data-tick":w,role:"button",tabIndex:0,"aria-label":`${s.label}, ${h(s)?"close":"open"} bubble`,x:f-xe/2,y:g-Re,width:xe,height:Re,rx:xe/2,fill:P[s.kind],opacity:b(s)?.35:1,style:{pointerEvents:"all",cursor:"pointer"}},W(s.bubble)))}),o.map(({item:s,x:f,y:g,w,text:L})=>{let{gene:x}=s,{y1:y,y2:Ct}=tt({y:g},s.at.y*a+l,i);return k("g",{children:[u("line",{x1:f,x2:f,y1:y,y2:Ct,stroke:Rt,strokeWidth:.8,strokeOpacity:.6}),u($,{x:f,y:g,w,text:x.name,note:L.slice(x.name.length)||void 0,color:Rt,edge:G,italic:!0,testId:"graph-gene-pin-label"})]},`${x.name}-${x.start}`)}),n.map(({item:s,x:f,y:g,w,text:L})=>u($,{x:f,y:g,w,text:L,color:P[s.kind],dimmed:b(s),title:`${s.label}
3
+ ${s.bubble.segmentCount} segments${s.bubble.covering?"":h(s)?" \xB7 click to close":" \xB7 click to open"}`,testId:"graph-bubble-halo-label",onClick:s.bubble.covering?void 0:()=>{t.toggleBubble(s.bubble)},onHover:x=>{K(t)&&t.setHoveredBubble(x?s.bubble:null)}},W(s.bubble))),c?u($,{x:c.x,y:c.y-Re-4,w:te(c.item.label),text:c.item.label,color:P[c.item.kind],testId:"graph-bubble-tick-label"}):null]})}),_o=ln;function cn(e,t,{lit:n,dpr:o}){let r=t.hostBpFrame;r&&ot(e,t.referenceStripBlocks,r,{width:t.paneWidth,lit:n,dpr:o})}var pn=m(function({model:t}){let n=M((o,r)=>{cn(o,t,{lit:t.referenceStripLit,dpr:r})},[t]);return u(_,{model:t,zIndex:5,shown:t.referenceStripShown,testId:"graph-reference-strip",paint:n})}),Io=pn;var un=.45;function dn(e,t,{highlightNode:n}){let o=t.tubeMapPicture,r=t.tubeMapFrame;if(!o||!r)return;let a=t.paneWidth,l=t.tubeMapPanelViews;if(l){bn(e,t,l,n);return}let i={...r,width:a,highlightNode:n,tubeColors:t.tubeMapTubeColors,nodeColors:t.tubeMapNodeColors};ce(e,o,i);let d=t.layoutResult?.tubeMap;d&&(ue(e,o,d.graph,i),de(e,d,i)),le(e,t.tubeMapDeviations,i),ze(e,t.tubeMapConnectors,t.connectorZoneBottom,i);let{bounds:c}=o;rt(e,t.tubeMapGenes,i,r.y(c.minY)-2);let p=t.tubeMapRulerBoxes;p&&ie(e,p,i,r.y(c.maxY)+4,t.layoutResult?.referenceAxis)}function bn(e,t,n,o){let r=t.paneWidth;for(let i of n){if(i.bottom<0||i.titleTop>t.canvasHeight)continue;let d={...i.frame,width:r,highlightNode:o,tubeColors:i.tubeColors,nodeColors:i.nodeColors};ce(e,i.picture,d),ue(e,i.picture,i.panel.result.tubeMap.graph,d),de(e,i.panel.result.tubeMap,d),e.globalAlpha=un,le(e,i.deviations,d),e.globalAlpha=1,e.strokeStyle="rgba(0,0,0,0.15)",e.lineWidth=1,e.beginPath(),e.moveTo(0,Math.round(i.titleTop)+.5),e.lineTo(r,Math.round(i.titleTop)+.5),e.stroke(),e.font=Je,e.textAlign="left",e.textBaseline="top",e.fillStyle="rgba(0,0,0,0.85)",e.fillText(i.label,6,i.titleTop+4)}let a=n.at(-1),l=t.tubeMapPanelRulerBoxes;a&&l&&ie(e,l,{...a.frame,width:r},a.bottom+4,!0)}var fn=m(function({model:t}){let n=M(o=>{dn(o,t,{highlightNode:t.selectedNode})},[t]);return u(_,{model:t,zIndex:1,shown:!!t.tubeMapPicture,testId:"graph-tube-map",paint:n})}),zo=fn;var N=JBrowseExports["@jbrowse/render-core/marks"],hn=e=>N!=null&&e in Object(N)?N[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/render-core/marks' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var xt=hn("spanMark");var jo=N&&N.__esModule?N.default:N;function St(e){if(e.startsWith("#")){let r=Number.parseInt(e.slice(1),16);return[r>>16&255,r>>8&255,r&255]}let[t=0,n=0,o=0]=e.match(/[\d.]+/g).map(Number);return e.startsWith("hsl")?Ae(t,n/100,o/100).map(r=>r*255):[t,n,o]}var Pt=([e,t,n])=>Oe(Math.round(e),Math.round(t),Math.round(n),255),yt=new Map;function gn(e){let t=yt.get(e);return t===void 0&&(t=Pt(St(e)),yt.set(e,t)),t}function wn(e,t,n){let o=e.start+e.bp,r=He(e,t);if("fill"in r)return[[e.start,o,gn(r.fill)]];let a=r.stops.map(St),l=r.stops.map(p=>Number(/[\d.]+/.exec(p)[0])),i=Math.abs(l.at(-1)-l[0]),d=Math.max(1,Math.min(Math.ceil(e.bp*n),Math.ceil(i),e.bp)),c=[];for(let p=0;p<d;p++){let b=(p+.5)/d*(a.length-1),h=Math.min(Math.floor(b),a.length-2),s=a[h],f=a[h+1],g=b-h;c.push([Math.round(e.start+e.bp*p/d),Math.round(e.start+e.bp*(p+1)/d),Pt([0,1,2].map(w=>s[w]+(f[w]-s[w])*g))])}return c}function ye(e){return{x:new Uint32Array(e),x2:new Uint32Array(e),row:new Uint32Array(e),color:new Uint32Array(e),count:0}}function J(e,t,n){return{x:e.x.subarray(t,n),x2:e.x2.subarray(t,n),row:e.row.subarray(t,n),color:e.color.subarray(t,n),count:n-t}}function Lt(e,t,n){let o=e.map(h=>Fe(h.runs,t).map(s=>({gap:s.gap,hairline:s.gap&&De(s.cause).px===se,pieces:wn(s,n,t)}))),r=0;for(let h of o)for(let s of h)r+=s.pieces.length;let a=ye(r),l=ye(r),i=ye(r),d=new Uint32Array(e.length+1),c=new Uint32Array(e.length+1),p=new Uint32Array(e.length+1),b=1;return o.forEach((h,s)=>{for(let f of h){let g=f.hairline?i:f.gap?l:a;for(let[w,L,x]of f.pieces){let y=g.count++;g.x[y]=w,g.x2[y]=L,g.row[y]=s,g.color[y]=x,b=Math.max(b,g.x2[y])}}d[s+1]=a.count,c[s+1]=l.count,p[s+1]=i.count}),{bars:J(a,0,a.count),gaps:J(l,0,l.count),hairlines:J(i,0,i.count),barRows:d,gapRows:c,hairlineRows:p,longest:b}}function Mt(e,t,n){let{longest:o}=t,r={start:0,end:o,screenStartPx:n.origin*n.scaleX+n.translateX,screenEndPx:(n.origin+o)*n.scaleX+n.translateX,reversed:!1,displayedRegionIndex:0},a={canvasWidth:n.width,canvasHeight:n.height},l=n.rowPx*n.scaleY;for(let{first:i,count:d,rowY:c}of n.blocks){let p=l/2-n.translateY-(c-i*n.rowPx)*n.scaleY,b=(c-n.rowPx/2)*n.scaleY+n.translateY;if(!(b>n.height||b+d*l<0))for(let[h,s,f]of[[t.bars,t.barRows,n.barPx],[t.gaps,t.gapRows,Math.min(Ge,n.barPx)],[t.hairlines,t.hairlineRows,Math.min(se,n.barPx)]])xt.paintBlock(e,J(h,s[i],s[i+d]),r,a,{rowHeight:l,rowProportion:f/l,minWidthPx:1,seamPx:0,scrollTop:p})}}function mn({model:e}){let t=U(()=>X(()=>{let o=e.walkRowBars;return o?Lt([o.reference,...o.rows],e.scaleX,e.referenceRampDomain):void 0}),[e]),n=M(o=>{let r=e.walkRowBars,a=e.walkRowPlacement,l=e.walkRowPitch,i=t.get();if(!r||!a||!l||!i)return;let d=e.walkRowGroups?.sections,c=d?.length?[{first:0,count:1,rowY:a.rowY(0)},...d.map(p=>({first:p.first,count:p.count,rowY:a.rowY(p.first)}))]:[{first:0,count:r.rows.length+1,rowY:a.rowY(0)}];Mt(o,i,{...e.screenTransform,width:e.paneWidth,height:e.canvasHeight,rowPx:l.rowPx,barPx:l.barPx,origin:r.origin,blocks:c})},[e,t]);return u(_,{model:e,zIndex:3,testId:"graph-walk-rows-spans",paint:n})}var kn="rgba(160, 196, 232, 0.55)",Rn="rgba(160, 140, 220, 0.55)";function xn({model:e}){let t=M(n=>{let o=e.walkRowRibbons,r=e.walkRowBars,a=e.walkRowPlacement,l=e.walkRowPitch;if(!o||!r||!a||!l)return;let{scaleX:i,scaleY:d,translateX:c,translateY:p}=e.screenTransform,b=s=>(r.origin+s)*i+c,h=l.barPx/2;for(let{row:s,a0:f,a1:g,b0:w,b1:L}of o){let x=a.rowY(s)*d+p+h,y=a.rowY(s+1)*d+p-h;n.fillStyle=w>L?Rn:kn,n.beginPath(),n.moveTo(b(f),x),n.lineTo(b(g),x),n.lineTo(b(L),y),n.lineTo(b(w),y),n.closePath(),n.fill()}},[e]);return u(_,{model:e,zIndex:2,testId:"graph-walk-rows-ribbons",paint:t})}function yn({model:e}){let t=M(n=>{let o=e.sharedBlocks,r=e.walkRowBars,a=e.walkRowPlacement,l=e.walkRowPitch;if(!o||!r||!a||!l)return;let{scaleX:i,scaleY:d,translateX:c,translateY:p}=e.screenTransform;ct(n,o,{x:b=>(r.origin+b)*i+c,rowCentre:b=>a.rowY(b)*d+p,barPx:l.barPx})},[e]);return u(_,{model:e,zIndex:3,testId:"graph-walk-rows-blocks",paint:t})}var Sn=m(function({model:t}){let n=t.walkRowBars,o=t.walkRowPlacement,r=t.walkRowPitch;if(!n||!o||!r||!t.hoveredWalkRowText)return null;let a=[n.reference,...n.rows],l=a.findIndex(c=>c.name===t.hoveredWalkRow),i=a[l];if(!i)return null;let d=t.toScreen({x:n.origin,y:o.rowY(l)});return u("rect",{"data-testid":"graph-walk-row-hovered",x:d.x-2,y:d.y-r.rowPx/2-1,width:i.bp*t.scaleX+4,height:r.rowPx+2,fill:"none",stroke:"#111",strokeWidth:1})}),Pn=m(function({model:t,vector:n=!1}){let o=T(),r=t.walkRowBars,a=t.walkRowPlacement,l=t.walkRowPitch;if(!r||!a||!l)return null;let{paneWidth:i,canvasHeight:d}=t,c={...t.screenTransform,width:i,height:d,...l,bars:n};return k(v,{children:[n||!t.walkRowRibbons?null:u(xn,{model:t}),n?null:u(mn,{model:t}),n||!t.sharedBlocks?null:u(yn,{model:t}),k(C,{model:t,zIndex:3,overflow:"visible",testId:"graph-walk-rows",children:[je(r,t.walkRowGroups?.sections??[],a.rowY,c,{ramp:t.referenceRampDomain,rowGenes:t.walkRowGenes,idPrefix:o}).map((p,b)=>u(H,{el:p},b)),a.headers.map(p=>u("text",{x:10,y:t.toScreen({x:0,y:p.top}).y+qe-4,fontFamily:"sans-serif",fontSize:11,fontWeight:"bold",fill:"#333","data-testid":"graph-walk-section",children:p.title},p.key)),u(Sn,{model:t})]})]})}),ua=Pn;export{_t as a,st as b,C as c,Gn as d,T as e,H as f,j as g,Ar as h,Ir as i,Jt as j,en as k,Br as l,Wr as m,on as n,Ur as o,zr as p,Vr as q,qr as r,an as s,jr as t,Jr as u,ao as v,Co as w,_o as x,cn as y,Io as z,dn as A,zo as B,ua as C};
4
+ //# sourceMappingURL=chunk-NBS4FGQ6.js.map