@sjcrh/proteinpaint-client 2.76.2 → 2.77.1
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/{2dmaf-f240211f.js → 2dmaf-dbeff225.js} +1 -1
- package/dist/{AppHeader-c9432a24.js → AppHeader-1fc7f7bd.js} +1 -1
- package/dist/{ColorScale-b991fc9e.js → ColorScale-23c17654.js} +1 -1
- package/dist/{DEanalysis-bbfad00d.js → DEanalysis-a3cf1900.js} +1 -1
- package/dist/{Disco-b7c9bf72.js → Disco-b26a0556.js} +1 -1
- package/dist/{Disco.UI-a5296c36.js → Disco.UI-891c4c35.js} +1 -1
- package/dist/{DragControls-ca3fa0cf.js → DragControls-2fabac26.js} +1 -1
- package/dist/{DziViewer-28915c11.js → DziViewer-5b830c31.js} +1 -1
- package/dist/FilterRxComp-fb608459.js +1 -0
- package/dist/FilterStateless-fc4e4e1b.js +1 -0
- package/dist/{HicApp-e713aa40.js → HicApp-5ed85d49.js} +1 -1
- package/dist/{OrbitControls-2466d420.js → OrbitControls-604f40af.js} +1 -1
- package/dist/{WSIViewer-957695a8.js → WSIViewer-dcce2a10.js} +1 -1
- package/dist/{adSandbox-27d93bc0.js → adSandbox-5fa90964.js} +1 -1
- package/dist/app-0de0ae35.js +1 -0
- package/dist/{app-d215327f.js → app-7f695ce7.js} +1 -1
- package/dist/app-977b083f.js +1 -0
- package/dist/app.js +1 -1
- package/dist/{bam-d67e5315.js → bam-06a5a6a2.js} +1 -1
- package/dist/{barchart-2898d229.js → barchart-978fb21a.js} +1 -1
- package/dist/{barchart.events-426d737a.js → barchart.events-9b482604.js} +1 -1
- package/dist/{bars.renderer-71935d34.js → bars.renderer-d7461d5d.js} +1 -1
- package/dist/{block-75d4ff92.js → block-3db9c74c.js} +1 -1
- package/dist/block.lazyload-19a55cac.js +1 -0
- package/dist/{block.legend-93d85a6e.js → block.legend-97401467.js} +1 -1
- package/dist/{block.mds-84b9d1c1.js → block.mds-dc409568.js} +1 -1
- package/dist/{block.mds.cnv-a991ed79.js → block.mds.cnv-cdabd3f6.js} +1 -1
- package/dist/{block.mds.expressionrank-33b858de.js → block.mds.expressionrank-d768640f.js} +1 -1
- package/dist/{block.mds.expressionstat-3093599f.js → block.mds.expressionstat-7e40426f.js} +1 -1
- package/dist/{block.mds.geneboxplot-b8391d18.js → block.mds.geneboxplot-dae9cfa3.js} +1 -1
- package/dist/{block.mds.junction-69708c7f.js → block.mds.junction-3bc8baea.js} +1 -1
- package/dist/{block.mds.svcnv-322baea6.js → block.mds.svcnv-456dc845.js} +1 -1
- package/dist/{block.mds.svcnv.share-c5c38237.js → block.mds.svcnv.share-4776459b.js} +1 -1
- package/dist/{block.mds2-de4811dd.js → block.mds2-cc586d9d.js} +1 -1
- package/dist/{block.svg-ac9fec2d.js → block.svg-adf47e3a.js} +1 -1
- package/dist/{block.tk.aicheck-ac4b8d4d.js → block.tk.aicheck-f284f080.js} +1 -1
- package/dist/{block.tk.ase-6dc0f9f1.js → block.tk.ase-0477c9f4.js} +1 -1
- package/dist/{block.tk.bam-8f68b41d.js → block.tk.bam-d4c998d4.js} +1 -1
- package/dist/{block.tk.bedgraphdot-d8878860.js → block.tk.bedgraphdot-0177d836.js} +1 -1
- package/dist/{block.tk.bigwig.ui-f6ed051c.js → block.tk.bigwig.ui-95531269.js} +1 -1
- package/dist/{block.tk.hicstraw-725bdc8a.js → block.tk.hicstraw-06e97317.js} +1 -1
- package/dist/{block.tk.junction-f8b0b51d.js → block.tk.junction-18b6b825.js} +1 -1
- package/dist/{block.tk.junction.textmatrixui-252e7d7e.js → block.tk.junction.textmatrixui-ffdbdf81.js} +1 -1
- package/dist/{block.tk.ld-11acf730.js → block.tk.ld-2b56500f.js} +1 -1
- package/dist/{block.tk.menu-5e04436d.js → block.tk.menu-707a4226.js} +1 -1
- package/dist/{block.tk.pgv-fef17dc4.js → block.tk.pgv-63c956c4.js} +1 -1
- package/dist/{boxplot-4c9a5479.js → boxplot-1f229616.js} +1 -1
- package/dist/{brainImaging-7716bc66.js → brainImaging-a0c72fad.js} +1 -1
- package/dist/{brush-9faa7ae7.js → brush-4c775f74.js} +1 -1
- package/dist/{categorical-1dea48ba.js → categorical-25b06bc5.js} +1 -1
- package/dist/{condition-ebac4f75.js → condition-70084a85.js} +1 -1
- package/dist/{controls-268e40e6.js → controls-1f3ac9d0.js} +1 -1
- package/dist/controls.btns-5b44e5d0.js +1 -0
- package/dist/{controls.config-2f0fa061.js → controls.config-b0339f96.js} +1 -1
- package/dist/{cuminc-8dffb765.js → cuminc-6d1de932.js} +1 -1
- package/dist/{customdata.inputui-b229d3a0.js → customdata.inputui-5ad0f25c.js} +1 -1
- package/dist/{dataDownload-452ae3cd.js → dataDownload-a60d80e4.js} +1 -1
- package/dist/databrowser.ui-a5c8194c.js +1 -0
- package/dist/{density-09feb0c9.js → density-30dbad8b.js} +1 -1
- package/dist/{dictionary-a132a3cc.js → dictionary-d8435ddc.js} +1 -1
- package/dist/{drag-2e9c80bb.js → drag-ad04f964.js} +1 -1
- package/dist/{e2pca-4f1648e3.js → e2pca-02adebbd.js} +1 -1
- package/dist/{ep-1d4c58b4.js → ep-b2e464fe.js} +1 -1
- package/dist/{facet-fa4fe49c.js → facet-e7612200.js} +1 -1
- package/dist/{filter-b3d3964e.js → filter-67d51c09.js} +1 -1
- package/dist/{fusion.parse-7dfd6988.js → fusion.parse-68670e99.js} +1 -1
- package/dist/{geneExpClustering-ed9121b8.js → geneExpClustering-d96c27ef.js} +1 -1
- package/dist/geneExpression-072e0be1.js +1 -0
- package/dist/{geneExpression-394672ff.js → geneExpression-4901955e.js} +1 -1
- package/dist/{geneExpression-66208299.js → geneExpression-65346c08.js} +1 -1
- package/dist/{geneORA-9456872c.js → geneORA-e3d6619e.js} +1 -1
- package/dist/geneVariant-9fc29f37.js +1 -0
- package/dist/{geneVariant-beaf9adb.js → geneVariant-f6bbc247.js} +1 -1
- package/dist/{genefusion.ui-9238ec7f.js → genefusion.ui-a5a08183.js} +1 -1
- package/dist/{genesearch-ffd88bf2.js → genesearch-5fa13afa.js} +1 -1
- package/dist/{geneset-0315daf8.js → geneset-c36036bd.js} +1 -1
- package/dist/genomeBrowser-d4515002.js +1 -0
- package/dist/{genomeBrowser.controls-2601cab5.js → genomeBrowser.controls-b89629b0.js} +1 -1
- package/dist/{groupsetting-e3a4ecd5.js → groupsetting-a3de9ec7.js} +1 -1
- package/dist/{gsea-0c0cf8de.js → gsea-af1a7cec.js} +1 -1
- package/dist/{hierCluster-7ab62ca5.js → hierCluster-8aa2265a.js} +1 -1
- package/dist/hierCluster.config-11a176e2.js +1 -0
- package/dist/{hierCluster.interactivity-7f475259.js → hierCluster.interactivity-103b2f0f.js} +1 -1
- package/dist/{hierCluster.renderers-19b79639.js → hierCluster.renderers-48bdf7a6.js} +1 -1
- package/dist/{html.legend-80b2b3ec.js → html.legend-455f7881.js} +1 -1
- package/dist/{imagePlot-1ef24562.js → imagePlot-862c7baf.js} +1 -1
- package/dist/{lasso-1a02a545.js → lasso-e12204af.js} +1 -1
- package/dist/launch.adhoc-b8af0ace.js +1 -0
- package/dist/leftlabel.sample-784c5aeb.js +1 -0
- package/dist/{legacyDataset-fbaa5ebb.js → legacyDataset-501a0298.js} +1 -1
- package/dist/{log-c26b6cfd.js → log-d560d2a5.js} +1 -1
- package/dist/{lollipop-3aebe5d3.js → lollipop-aa25084e.js} +1 -1
- package/dist/{maf-c439c851.js → maf-13befc91.js} +1 -1
- package/dist/{maftimeline-0da64e54.js → maftimeline-f9ee156e.js} +1 -1
- package/dist/{matrix-38cd47c3.js → matrix-971b44da.js} +1 -1
- package/dist/{matrix.cells-a018d731.js → matrix.cells-92037b17.js} +1 -1
- package/dist/{matrix.cluster-a6e713e8.js → matrix.cluster-0bca59fd.js} +1 -1
- package/dist/{matrix.config-2c550b5d.js → matrix.config-b8d8faef.js} +1 -1
- package/dist/matrix.controls-07c6128c.js +1 -0
- package/dist/{matrix.data-2b814c9f.js → matrix.data-1090f6c7.js} +1 -1
- package/dist/{matrix.dom-1e0da5b3.js → matrix.dom-1154156c.js} +1 -1
- package/dist/{matrix.groups-824a7244.js → matrix.groups-f10a8c05.js} +1 -1
- package/dist/{matrix.interactivity-1cb56534.js → matrix.interactivity-99de0399.js} +1 -1
- package/dist/{matrix.layout-47e44357.js → matrix.layout-405db70f.js} +1 -1
- package/dist/{matrix.legend-9af0c757.js → matrix.legend-d06de359.js} +1 -1
- package/dist/{matrix.renderers-337ce240.js → matrix.renderers-2211c4b2.js} +1 -1
- package/dist/{matrix.serieses-7b7184c9.js → matrix.serieses-f0803a76.js} +1 -1
- package/dist/{matrix.sort-1ac05842.js → matrix.sort-3d376f1a.js} +1 -1
- package/dist/{matrix.sorterUi-1c60c145.js → matrix.sorterUi-469ed804.js} +1 -1
- package/dist/{mavb-da8d1a0a.js → mavb-e5cbd894.js} +1 -1
- package/dist/{mds.fimo-8604c3f8.js → mds.fimo-f9215ef6.js} +1 -1
- package/dist/{mds.samplescatterplot-3f09ae0e.js → mds.samplescatterplot-6fce6594.js} +1 -1
- package/dist/{mds.survivalplot-1d8f2b7e.js → mds.survivalplot-16e9e8c5.js} +1 -1
- package/dist/{metaboliteIntensity-bbb23c76.js → metaboliteIntensity-b47fb792.js} +1 -1
- package/dist/{niceNumLabels-29a7c6ca.js → niceNumLabels-1bd7a93b.js} +1 -1
- package/dist/{nodrag-b2737073.js → nodrag-0fa60f70.js} +1 -1
- package/dist/{notify-0cb8904f.js → notify-42149e65.js} +1 -1
- package/dist/{numeric-24dacbee.js → numeric-5b626171.js} +1 -1
- package/dist/{numeric.binary-f382cc98.js → numeric.binary-07e15211.js} +1 -1
- package/dist/numeric.continuous-76dd29ba.js +1 -0
- package/dist/numeric.discrete-6d697c68.js +1 -0
- package/dist/{numeric.spline-a35cfbf0.js → numeric.spline-cf331bad.js} +1 -1
- package/dist/{numeric.toggle-2f98d6e5.js → numeric.toggle-332c2578.js} +1 -1
- package/dist/oncomatrix-7c84c94b.js +1 -0
- package/dist/{parseData-292648dd.js → parseData-05ab5f81.js} +1 -1
- package/dist/{plot.2dvaf-6ae22dc1.js → plot.2dvaf-1debbf12.js} +1 -1
- package/dist/plot.app-0b02df66.js +1 -0
- package/dist/{plot.barplot-34841e70.js → plot.barplot-45b57df9.js} +1 -1
- package/dist/{plot.boxplot-87ac2ce9.js → plot.boxplot-06cef6e2.js} +1 -1
- package/dist/{plot.brainImaging-32a484b6.js → plot.brainImaging-07795744.js} +1 -1
- package/dist/{plot.disco-1fdfee3c.js → plot.disco-9c631d77.js} +1 -1
- package/dist/{plot.dzi-e3d0f610.js → plot.dzi-a9a81de5.js} +1 -1
- package/dist/{plot.ssgq-d33113d5.js → plot.ssgq-02ffde06.js} +1 -1
- package/dist/{plot.vaf2cov-9f4f1776.js → plot.vaf2cov-c111c5fb.js} +1 -1
- package/dist/{plot.wsi-dea124a7.js → plot.wsi-6ccc7bb2.js} +1 -1
- package/dist/{profileBarchart-58f0a8c0.js → profileBarchart-0c97e8c9.js} +1 -1
- package/dist/{profileHome-7f404152.js → profileHome-2255d66d.js} +1 -1
- package/dist/profilePlot-ba7e03ab.js +1 -0
- package/dist/{profilePolar-50b8e40e.js → profilePolar-d38d502f.js} +1 -1
- package/dist/{profileRadar-fff0b004.js → profileRadar-f95cfa87.js} +1 -1
- package/dist/{profileRadarFacility-d6d34c15.js → profileRadarFacility-7e200a91.js} +1 -1
- package/dist/profileSummary-8c41a731.js +1 -0
- package/dist/{recover-299ffdb3.js → recover-6f2f3379.js} +1 -1
- package/dist/{regression.inputs-14df7c31.js → regression.inputs-b515101d.js} +1 -1
- package/dist/{regression.inputs.values.table-d79efa9e.js → regression.inputs.values.table-f8a0cad9.js} +1 -1
- package/dist/{regression.results-4767144e.js → regression.results-91a486f0.js} +1 -1
- package/dist/{renderPvalueTable-002cc8ff.js → renderPvalueTable-d4d2624c.js} +1 -1
- package/dist/sampleScatter-7c2773de.js +1 -0
- package/dist/{sampleScatter.rendererThree-ef289434.js → sampleScatter.rendererThree-b6db5a09.js} +2 -2
- package/dist/{sampleView-1dff3fca.js → sampleView-8885e86b.js} +1 -1
- package/dist/{samplelst-d2db0f24.js → samplelst-83e593da.js} +1 -1
- package/dist/{samplematrix-0841387f.js → samplematrix-a8b3f845.js} +1 -1
- package/dist/{scatter-f8285107.js → scatter-34d52e2d.js} +1 -1
- package/dist/{select2Terms-d48d037e.js → select2Terms-d9320d21.js} +1 -1
- package/dist/{selectGenomeWithTklst-9af86d31.js → selectGenomeWithTklst-fed6a2ea.js} +1 -1
- package/dist/shapes-21ebfec4.js +1 -0
- package/dist/singleCellCellType-e6848f45.js +1 -0
- package/dist/{singleCellGeneExpression-537f1157.js → singleCellGeneExpression-d3a5394e.js} +1 -1
- package/dist/singleCellPlot-3cad6bd8.js +1 -0
- package/dist/{singlecell-38336cbc.js → singlecell-0754aab0.js} +1 -1
- package/dist/{singlecell-87b4b9a9.js → singlecell-7c57cd77.js} +1 -1
- package/dist/{snp-b81ef740.js → snp-6b23e7a6.js} +1 -1
- package/dist/snp-a0cdd2a5.js +1 -0
- package/dist/snplocus-c60eab56.js +1 -0
- package/dist/{spliceevent.a53ss.diagram-5f8352eb.js → spliceevent.a53ss.diagram-8714f740.js} +1 -1
- package/dist/{spliceevent.exonskip.diagram-0d30a735.js → spliceevent.exonskip.diagram-40c1e363.js} +1 -1
- package/dist/spliceevent.exonskip.getdefault-4bb6f19f.js +1 -0
- package/dist/{spliceevent.noeventdiagram-df9ce4bc.js → spliceevent.noeventdiagram-41a56db9.js} +1 -1
- package/dist/{spliceevent.phrase-a8401d53.js → spliceevent.phrase-7f34e3b1.js} +1 -1
- package/dist/{stattable-46cde32c.js → stattable-78dc5c34.js} +1 -1
- package/dist/{style.gdc-72d730f2.js → style.gdc-cd49882c.js} +1 -1
- package/dist/summary-45c56298.js +1 -0
- package/dist/{sunburst-fe95832e.js → sunburst-2140e468.js} +1 -1
- package/dist/{survival-57ff3c03.js → survival-db972025.js} +1 -1
- package/dist/{survival-52714cd3.js → survival-ed4bdad2.js} +1 -1
- package/dist/{svg.download-f4aa48e4.js → svg.download-a5e20a92.js} +1 -1
- package/dist/{svg.legend-749348e0.js → svg.legend-8d21872d.js} +1 -1
- package/dist/{svgraph-b46f1f92.js → svgraph-f6a28b78.js} +1 -1
- package/dist/{svmr-9a76c6d4.js → svmr-8b4b4c59.js} +1 -1
- package/dist/{table-bf40249b.js → table-1cbe3a36.js} +1 -1
- package/dist/{table-0daf2b89.js → table-e2a307e6.js} +1 -1
- package/dist/{termInfo-491b10af.js → termInfo-5477ba96.js} +1 -1
- package/dist/termdb.bins-7ecc48db.js +1 -0
- package/dist/{termsetting-492eefa7.js → termsetting-2e75e729.js} +1 -1
- package/dist/tk-a8a4481a.js +1 -0
- package/dist/{toggleButtons-c4d6f260.js → toggleButtons-7ce58d97.js} +1 -1
- package/dist/{tp.ui-0a476325.js → tp.ui-be14f635.js} +1 -1
- package/dist/{tvs.density-034b506d.js → tvs.density-8b953cef.js} +1 -1
- package/dist/{tvs.geneVariant-c59c8b54.js → tvs.geneVariant-ecad287d.js} +1 -1
- package/dist/{tvs.numeric-aa1f892f.js → tvs.numeric-b56a5aba.js} +1 -1
- package/dist/{tvs.samplelst-515f27b9.js → tvs.samplelst-3150e0b7.js} +1 -1
- package/dist/{uiUtils-ea7dfea2.js → uiUtils-71cc22de.js} +1 -1
- package/dist/{variantBrowser-14d5c3f6.js → variantBrowser-df2f9c22.js} +1 -1
- package/dist/{vcf-d357ce08.js → vcf-3e370c9b.js} +1 -1
- package/dist/{violin-74d26b75.js → violin-4595cef4.js} +1 -1
- package/dist/{violin.interactivity-bf40ddde.js → violin.interactivity-8b63e000.js} +1 -1
- package/dist/{violin.renderer-469fa0ff.js → violin.renderer-0b7431a2.js} +1 -1
- package/dist/{violinRenderer-14fa200d.js → violinRenderer-7b0a4e98.js} +1 -1
- package/dist/{viridis-cc59f478.js → viridis-725f66e0.js} +1 -1
- package/dist/{y-59cbff5e.js → y-300bac24.js} +1 -1
- package/dist/{zoom-f445cfef.js → zoom-d3d38b3b.js} +1 -1
- package/package.json +2 -4
- package/dist/FilterRxComp-02e68f1b.js +0 -1
- package/dist/FilterStateless-16a33070.js +0 -1
- package/dist/app-42f69951.js +0 -1
- package/dist/app-6fb77603.js +0 -1
- package/dist/block.lazyload-d2951c91.js +0 -1
- package/dist/controls.btns-5bf9e7d7.js +0 -1
- package/dist/databrowser.ui-2197fc73.js +0 -1
- package/dist/downloadTextfile-5723af95.js +0 -1
- package/dist/geneExpression-c61e8f1c.js +0 -1
- package/dist/geneVariant-f17cda85.js +0 -1
- package/dist/genomeBrowser-608b924e.js +0 -1
- package/dist/hierCluster.config-f4daaf92.js +0 -1
- package/dist/launch.adhoc-e124c993.js +0 -1
- package/dist/leftlabel.sample-59f99ef5.js +0 -1
- package/dist/matrix.controls-42ad4912.js +0 -1
- package/dist/numeric.continuous-6feb34a7.js +0 -1
- package/dist/numeric.discrete-ed10bbc1.js +0 -1
- package/dist/oncomatrix-c0b2d635.js +0 -1
- package/dist/plot.app-2a805759.js +0 -1
- package/dist/profilePlot-4db8ca78.js +0 -1
- package/dist/profileSummary-04b8b15b.js +0 -1
- package/dist/sampleScatter-55d9eb74.js +0 -1
- package/dist/singleCellCellType-fd1606b8.js +0 -1
- package/dist/singleCellPlot-eff5760b.js +0 -1
- package/dist/snp-f6123244.js +0 -1
- package/dist/snplocus-acafb1ba.js +0 -1
- package/dist/spliceevent.exonskip.getdefault-237c481c.js +0 -1
- package/dist/summary-a6c15c9e.js +0 -1
- package/dist/termdb.bins-39d11f24.js +0 -1
- package/dist/tk-ac524564.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let n;async function t(t){if(!n){const t=await import("./block-75d4ff92.js").then((function(n){return n.c}));n=t.Block}return new n(t)}export{t as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,K as e,L as n}from"./app-6fb77603.js";class o{constructor(t){this.type="controlsTopBar"}async init(){const t=this.opts;this.dom={holder:t.holder,burger_div:t.holder.append("div"),button_bar:t.holder.append("div")};const n=this.opts.debug;this.features=await e({burgerbtn:i({holder:this.dom.burger_div,callback:t.callback,debug:n}),downloadbtn:a({id:t.id,holder:this.dom.holder.insert("div"),callback:t.downloadHandler,debug:n}),helpbtn:s({id:t.id,holder:this.dom.holder.insert("div"),callback:t.helpHandler,debug:n})})}getState(t){return{config:t.plots.find((t=>t.id===this.id)),isOpen:this.opts.isOpen()}}main(){const t=this.state.config;const e=this.opts.isOpen();this.dom.button_bar.style("display",e?"inline-block":"block").style("float",e?"right":"none");for(const n in this.features){this.features[n].main(e,t)}}}const l=t(o);function i(t){const e={dom:{btn:t.holder.style("margin","10px").style("margin-left","20px").style("font-family","verdana").style("font-size","28px").style("cursor","pointer").style("transition","0.5s").html("≡").on("click",t.callback).attr("aria-label","Settings")}};const n={main(t){e.dom.btn.style("display",t?"inline-block":"block")}};if(t.debug)n.Inner=e;return Object.freeze(n)}function s(t){const e=t.holder.style("margin","20px");n["help"](e,{handler:t.callback,title:"Documentation"});const o={plotTypes:["profilePolar","profileBarchart","profileRadar","profileRadarFacility"],dom:{btn:e}};const l={main(t,e){if(o.plotTypes.includes(e.chartType))o.dom.btn.style("display",t?"inline-block":"block");else o.dom.btn.style("display","none")}};if(t.debug)l.Inner=o;return Object.freeze(l)}function a(t){const e=t.holder.style("margin-left","20px").attr("aria-label","Download plot image");n["download"](e,{handler:t.callback});const o={plotTypes:["summary","boxplot","scatter"],dom:{btn:e}};const l={main(t,e){o.dom.btn.style("display",t?"inline-block":"block")}};if(t.debug)l.Inner=o;return Object.freeze(l)}export{l as topBarInit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,m as t,c as n,d as i,i as o,f as s,e as r}from"./uiUtils-ea7dfea2.js";import{j as a,aT as l}from"./app-6fb77603.js";import{T as c}from"./toggleButtons-c4d6f260.js";import{appInit as d}from"./app-42f69951.js";import"./tslib.es6-c3c2d88f.js";import"./recover-299ffdb3.js";import"./termsetting-492eefa7.js";import"path";import"./FilterRxComp-02e68f1b.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";import"./sampleScatter-55d9eb74.js";import"./controls-268e40e6.js";import"./controls.btns-5bf9e7d7.js";import"./controls.config-2f0fa061.js";import"./zoom-f445cfef.js";import"./pointer-c7475677.js";import"./nodrag-b2737073.js";import"./lasso-1a02a545.js";import"./drag-2e9c80bb.js";import"./downloadTextfile-5723af95.js";import"./sampleView-1dff3fca.js";import"./select2Terms-d48d037e.js";import"./svg.download-f4aa48e4.js";import"./sampleScatter.rendererThree-ef289434.js";import"./axis-747c801e.js";import"./line-264f8f9e.js";import"./constant-426a1483.js";import"./summary-a6c15c9e.js";import"./violin-74d26b75.js";import"./violin.renderer-469fa0ff.js";import"./brush-9faa7ae7.js";import"./basis-3870f5ba.js";import"./log-c26b6cfd.js";import"./html.legend-80b2b3ec.js";import"./violin.interactivity-bf40ddde.js";import"./niceNumLabels-29a7c6ca.js";import"./barchart-2898d229.js";import"./bars.settings-64bb4642.js";import"./bars.renderer-71935d34.js";import"./svg.legend-749348e0.js";import"./barchart.events-426d737a.js";function p(e){const t={};const n=e.trim().split(/\r?\n/);const i=n[0].split("\t");const o=i.findIndex((e=>e.toLowerCase().includes("term_id")));const s=i.findIndex((e=>e.toLowerCase().includes("variable")));if(o!=-1)r(n,i);if(s!=-1)a(n,i);if(s==-1&&o==-1){throw`Unrecognized file format. Please check the header names.`}function r(e,n){const i=n.findIndex((e=>e.toLowerCase().includes("parent_id")));if(i==-1){throw`Missing required 'parent_id' header`}const s=n.findIndex((e=>e.toLowerCase().includes("name")));if(s==-1){throw`Missing required 'Name' header`}const r=n.findIndex((e=>e.toLowerCase().includes("type")));if(r==-1){throw`Missing required 'Type' header`}const a=n.findIndex((e=>e.toLowerCase().includes("values")));if(a==-1){throw`Missing required 'Values' header`}if(i==-1||s==-1||r==-1||a==-1){throw`Missing required header(s)`}const l=new Set;for(const[n,c]of e.entries()){if(n===0)continue;const e=n+1;try{const n=c.split("\t");for(const[t,i]of n.entries()){const n=t+1;let o;if(t==a)continue;if(i==""||i=="-"){o=true;throw`Blank or '-' entered for line ${e}, column ${n}`}if(o==true)throw`Invalid entry for line ${e}, column ${n}`}const d=n[o];const p=n[r];t[d]={id:d,name:n[s].trim().replace(/"/g,""),parent_id:n[i]!="root"?n[i]:null,type:n[r]!="non graphable"?n[r]:null};l.add(t[d].parent_id);if(p=="categorical"){t[d].values={}}const f=n[a].trim().replace(/"/g,"").split(";");for(const n of f){const i=n.trim();if(i=="")continue;const o=i.split("=");const s=o.shift();const r=o.join("=");if(!r)throw`Values="${i}" in line ${e} not in a key = value format.`;if(!t[d].values)t[d].values={};t[d].values[s]={label:r}}const m=Object.keys(t[d].values).length;t[d].groupsetting={disabled:m<3};u(t[d])}catch(t){throw`Line ${e} error: ${t}`}}for(const e in t)t[e].isleaf=!l.has(t[e].id)}function a(e,n){if(s==-1){throw`Missing required 'Variable' header`}const i=n.findIndex((e=>e.toLowerCase().includes("type")));if(i==-1){throw`Missing required 'Type' header`}const o=n.findIndex((e=>e.toLowerCase().includes("categories")));const r=n.map(((e,t)=>e.toLowerCase().includes("level_")?t:-1)).filter((e=>e!=-1));if(!r.length)r.push(s);const a=n.findIndex((e=>e.toLowerCase().includes("additional attributes")));const l={};const c=new Set;const d=new Map;d.set(null,[]);for(const[n,p]of e.entries()){if(n===0)continue;const e=n+1;try{const n=p.split("\t");const m=r.map((e=>n[e].trim().replace(/"/g,""))).filter((e=>e!="-"));if(m.length!=new Set(m).size){throw`Non-unique levels in line ${e}: ${JSON.stringify(m)}`}for(const[e,t]of m.entries()){if(e==0){if(d.get(null).indexOf(t)==-1)d.get(null).push(t)}if(e!=m.length-1){if(!d.has(t))d.set(t,[])}for(const n of m){if(e==m.indexOf(n)-1){if(d.get(t).indexOf(n)==-1)d.get(t).push(n)}}}const u=m.pop();const y=n.indexOf("-");if(y!=-1&&y<n.indexOf(u)){throw`Blank or '-' value detected between levels in line ${e}`}const b=f(n[i],n[o],n[a],e,u);const h=n[s]||u;if(h in t){const n=t[h];throw`Error: Multiple config rows for term.id='${h}': lines# ${n.lineNum} and ${e}`}t[h]={id:h,name:u,type:b.type,values:b.values,groupsetting:b.groupsetting,ancestry:m.slice(),parent_name:m.pop()||null,lineNum:e,additionalAttributes:b.attributes};l[u]=h;c.add(t[h].parent_name)}catch(t){throw`Line ${e} error: ${t}`}}m(l,t,c);for(const e in t){const n=t[e];n.child_order=d.get(n.parent_name).indexOf(n.name)+1;n.isleaf=!c.has(n.name);n.parent_id=l[n.parent_name]||null;delete n.parent_name;delete n.lineNum;delete n.ancestry}}return{terms:Object.values(t)}}function f(e,t,n,i,o){if(!e)throw`No type provided for variable: ${o} on line ${i}`;const s={type:e,values:t==""||t==undefined?{}:JSON.parse(t),attributes:n==""||n==undefined?{}:JSON.parse(n)};u(s);if(s.type=="categorical"){const e=Object.keys(s.values).length;s.groupsetting={disabled:e<3}}return s}function m(e,t,n,i){for(const i in t){const o=t[i];for(const[i,s]of o.ancestry.entries()){if(s in e){const n=e[s];const r=t[n];if(i-1<0&&r.parent_name||r.parent_name!=o.ancestry[i-1]){throw`Different parents for term=${s}, '${o.ancestry[i-1]}' and '${r.parent_name}'`}continue}t[s]={id:s,name:s,isleaf:false,ancestry:o.ancestry.slice(0,i)};t[s].parent_name=t[s].ancestry.slice(-1)[0]||null;e[s]=s;n.add(s)}}}function u(e){if(e.type!="integer"&&e.type!="float")return;if(!e.values)return;if(typeof e.values!="object")throw"numeric .values{} is not object";for(const t in e.values){if(t=="")throw"Cannot use empty string as an uncomputable category";const n=Number(t);if(Number.isNaN(n)){throw`Uncomputable category of a numeric term is required to be a number (here uses non-numeric value of ${t}).`}e.values[t].uncomputable=true}}function y(t,n){const i=t.append("div").style("margin","20px 20px 20px 40px").style("font-family","'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif").style("place-items","center left").style("overflow","hidden").classed("sjpp-app-ui",true);const o={};b(i);h(i,"Data Dictionary");const s=i.append("div").style("margin-left","2vw");g(s,o);const r=i.append("div").style("display","flex").style("align-items","center").style("margin","40px 0px 40px 130px");x(r,o,i,t);e(r,o,".databrowser_input");if(n)window.doms=o;return o}function b(e){e.append("div").style("margin","10px").style("opacity","0.65").html(`\n\t\t\t<ul>\n <li>\n Please see the <a href="https://github.com/stjude/proteinpaint/wiki/Data-Browser" target="_blank">documentation</a> for more information.\n </li>\n\t\t\t\t<li>\n\t\t\t\t\tDownload an example data dictionary <a href="https://proteinpaint.stjude.org/ppdemo/databrowser/dictionaryDemoData.tar.gz" target="_self" "download>here</a>.\n\t\t\t\t</li>\n </ul>`)}function h(e,n){const i=t(e,n);i.style("font-size","1.5em").style("color","#003366").style("margin","20px 10px 40px 10px").classed("sjpp-databrowser-section-header",true);const o=e.append("hr");o.style("color","ligthgrey").style("margin","-30px 0px 15px 0px").style("width","50vw").style("opacity","0.4")}function g(e,n){const i=[{label:"Select File",active:true,width:95,callback:async(e,t)=>{t.contentHolder.style("border","none").style("display","block");l(t.contentHolder);t.contentHolder.append("div").html(`<p style="margin-left: 10px; opacity: 0.65;">Select a file from your computer.</p>`);v(t.contentHolder,n);delete t.callback}},{label:"Paste Data",active:false,width:95,callback:async(e,t)=>{t.contentHolder.style("border","none").style("display","block");l(t.contentHolder);t.contentHolder.append("div").html(`<p style="margin-left: 10px; opacity: 0.65;">Paste data dictionary or phenotree in a tab delimited format.</p>`);j(t.contentHolder,n);delete t.callback}},{label:"File Path",active:false,width:95,callback:async(e,i)=>{i.contentHolder.style("border","none").style("display","block");l(i.contentHolder);i.contentHolder.append("div").html(`<p style="margin-left: 10px; opacity: 0.65;">Provide a URL file path.</p>`);t(i.contentHolder,"URL");w(i.contentHolder,n);delete i.callback}}];new c({holder:e,tabs:i}).main()}function w(e,t){const n=e.append("div").style("display","inline-block");const s=i(n).style("border","1px solid rgb(138, 177, 212)").classed("databrowser_input",true).on("keyup",(async()=>{const e=s.property("value").trim();if(o(e)){await fetch(e).then((e=>e.text())).then((e=>{t.data=p(e)}))}}))}function v(e,t){const n=e.append("div").style("display","inline-block");const i=s(n).classed("databrowser_input",true);i.on("change",(e=>{const n=e.target.files[0];const i=new FileReader;i.onload=e=>{t.data=p(e.target.result)};i.readAsText(n,"utf8")}))}function j(e,t){const n=e.append("div").style("display","block");const i=r({div:n,rows:10}).style("border","1px solid rgb(138, 177, 212)").style("margin","0px 0px 0px 20px").classed("databrowser_input",true).on("keyup",(async()=>{t.data=p(i.property("value").trim())}))}function x(e,t,i,o){const s=n({div:e,text:"Create Data Browser",color:"white",backgroundColor:"#001aff",border:"2px solid #001aff"});const r=e.append("div");s.style("margin-right","10px").style("font-size","16px").classed("sjpp-ui-submitBtn",true).attr("type","submit").on("click",(()=>{if(!t.data||t.data==undefined){const e=r.append("div").style("display","inline-block").style("max-width","20vw");a(e,"Please provide data");setTimeout((()=>e.remove()),3e3)}else{i.remove();d({holder:o,state:{vocab:{terms:t.data.terms},plots:[{chartType:"dictionary"}]}})}}))}export{y as init_databrowserUI};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,e){const n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e));n.setAttribute("download",t);n.style.display="none";document.body.appendChild(n);n.click();document.body.removeChild(n)}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./tslib.es6-c3c2d88f.js";import{M as t}from"./app-6fb77603.js";import{a as s}from"./genesearch-ffd88bf2.js";import{T as a}from"./termsetting-492eefa7.js";import"path";class o{init(e){this.callback=e.callback;this.app=e.app;const a=s({tip:new t({padding:"0px"}),genome:e.genomeObj,row:e.holder,searchOnly:"gene",callback:()=>this.selectGene(a.geneSymbol)})}selectGene(t){return e(this,void 0,void 0,(function*(){if(!t)throw new Error("No gene selected");this.callback({gene:t,type:a.GENE_EXPRESSION,name:t})}))}}export{o as SearchHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./tslib.es6-c3c2d88f.js";import{M as t}from"./app-6fb77603.js";import{a as n}from"./genesearch-ffd88bf2.js";class o{init(e){this.callback=e.callback;const o=n({tip:new t({padding:"0px"}),genome:e.genomeObj,row:e.holder,callback:()=>this.selectGene(o)})}selectGene(t){return e(this,void 0,void 0,(function*(){if(t.geneSymbol){this.callback({kind:"gene",id:t.geneSymbol,gene:t.geneSymbol,name:t.geneSymbol,type:"geneVariant"})}else if(t.chr&&t.start&&t.stop){const{chr:e,start:n,stop:o}=t;const s=`${e}:${n+1}-${o}`;this.callback({kind:"coord",id:s,chr:e,start:n,stop:o,name:s,type:"geneVariant"})}else{throw"no gene or position specified"}}))}}export{o as SearchHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as t,h as e,P as s,y as a,b as o,f as i}from"./app-6fb77603.js";import{a as n}from"./genesearch-ffd88bf2.js";import"./termsetting-492eefa7.js";import{g as r}from"./FilterRxComp-02e68f1b.js";import{mayUpdateGroupTestMethodsIdx as l,gbControlsInit as c}from"./genomeBrowser.controls-2601cab5.js";import"./tslib.es6-c3c2d88f.js";import"path";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./checkbox-96437f4d.js";import"./FilterStateless-16a33070.js";import"./toggleButtons-c4d6f260.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";const p=new t({padding:"0px"});class f{constructor(){this.type="genomeBrowser"}async init(){const e=this.opts.holder.append("div");this.opts.header.append("div").style("opacity",.6).style("padding-left","10px").style("font-size","0.75em").text("GENOME BROWSER");const s=e.append("div");const a=e.append("div").style("margin-left","25px");a.append("span").html(" ");this.dom={tip:new t,holder:e,errDiv:s,loadingDiv:a.append("span").text("Loading..."),controlsDiv:e.append("div").style("margin-left","25px"),blockHolder:e.append("div")};this.components={gbControls:await c({app:this.app,id:this.id,holder:this.dom.controlsDiv})}}getState(t){const e=t.plots.find((t=>t.id===this.id));if(!e)throw`No plot with id='${this.id}' found`;return{config:e,termdbConfig:t.termdbConfig,filter:r(t.termfilter.filter)}}async main(){this.dom.loadingDiv.style("display","inline");try{if(this.state.config?.snvindel?.details){await this.launchCustomMds3tk()}else if(this.state.config?.trackLst){await this.launchBlockWithTracks(this.state.config.trackLst)}else{const t={type:"mds3",dslabel:this.app.opts.state.vocab.dslabel,newChartHolder:this.opts.plotDiv};if(this.state.filter?.lst?.length>0){t.filterObj=structuredClone(this.state.filter)}await this.launchBlockWithTracks([t])}this.updateLDtrack()}catch(t){a(this.dom.errDiv,t.message||t);if(t.stack)console.log(t.stack)}this.dom.loadingDiv.style("display","none")}async launchCustomMds3tk(){const t=await this.preComputeData();this.mayDisplaySampleCountInControls(t);if(this.blockInstance){const e=this.blockInstance.tklst.find((t=>t.type=="mds3"));e.custom_variants=t.mlst;b(this,e.skewer.viewModes.find((t=>t.type=="numeric")));e.load();return}const e={type:"numeric",inuse:true,byAttribute:"nm_axis_value"};b(this,e);const s={type:"mds3",dslabel:this.app.opts.state.vocab.dslabel,name:"Variants",custom_variants:t.mlst,skewerModes:[e]};await this.launchBlockWithTracks([s])}mayDisplaySampleCountInControls(t){if(Number.isInteger(t.totalSampleCount_group1)||Number.isInteger(t.totalSampleCount_group2)){const e={appState:{plots:[{id:this.components.gbControls.id,_partialData:{groupSampleCounts:[t.totalSampleCount_group1,t.totalSampleCount_group2],pop2average:t.pop2average}}]}};this.components.gbControls.update(e)}}async preComputeData(){const t={genome:this.app.opts.state.vocab.genome,dslabel:this.app.opts.state.vocab.dslabel,for:"mds3variantData",chr:this.state.config.geneSearchResult.chr,start:this.state.config.geneSearchResult.start,stop:this.state.config.geneSearchResult.stop,details:this.state.config.snvindel.details,filter:this.state.filter,variantFilter:this.state.config.variantFilter?.filter};const e=await o("termdb",{body:t});if(e.error)throw e.error;return e}async launchBlockWithTracks(t){this.dom.blockHolder.selectAll("*").remove();const e={holder:this.dom.blockHolder,genome:this.app.opts.genome,nobox:true,tklst:await this.getTracks2show(t),debugmode:true};if(this.state.termdbConfig?.queries.defaultBlock2GeneMode&&this.state.config.geneSearchResult.geneSymbol){e.query=this.state.config.geneSearchResult.geneSymbol;const t=await import("./app-6fb77603.js").then((function(t){return t.c3}));await t.default(e);this.blockInstance=e.__blockInstance;this.opts.header.text(e.query);return}e.chr=this.state.config.geneSearchResult.chr;e.start=this.state.config.geneSearchResult.start;e.stop=this.state.config.geneSearchResult.stop;i(this.app.opts.genome,e.tklst);e.onCoordinateChange=async t=>{await this.app.dispatch({type:"plot_edit",id:this.id,config:{geneSearchResult:{chr:t[0].chr,start:t[0].start,stop:t[0].stop}}})};const s=await import("./block-75d4ff92.js").then((function(t){return t.c}));this.blockInstance=new s.Block(e)}async getTracks2show(t){const e=[];for(const s of t){if(s.isfacet){const t=JSON.parse(JSON.stringify(s));if(!this.app.opts.genome.tkset)this.app.opts.genome.tkset=[];if(!t.tklst)throw".tklst[] missing from a facet table";if(!Array.isArray(t.tklst))throw".tklst[] not an array from a facet table";for(const s of t.tklst){if(!s.assay)throw".assay missing from a facet track";if(!s.sample)throw".sample missing from a facet track";s.tkid=Math.random().toString();if(s.defaultShown)e.push(s)}this.app.opts.genome.tkset.push(t)}else{e.push(s)}}return e}updateLDtrack(){if(!this.state.config.ld)return;if(!this.blockInstance)return;for(const t of this.state.config.ld.tracks){const e=this.blockInstance.tklst.findIndex((e=>e.file==t.file0));if(t.shown){if(e==-1){const e={type:"ld",name:t.name,file:t.file0};const s=this.blockInstance.block_addtk_template(e);this.blockInstance.tk_load(s)}continue}if(e==-1)continue;this.blockInstance.tk_remove(e)}}}const d=e(f);const h=d;async function m(t,e){try{return await g(e.vocabApi,t)}catch(t){throw`${t} [genomeBrowser getPlotConfig()]`}}function u(t,e){const s=e.app.opts.genome;if(typeof s!="object")throw"chartsInstance.app.opts.genome not an object and needed for gene search box";const a={tip:p,genome:s,row:t.append("div").style("margin","10px"),callback:async()=>{try{const t=await g(e.app.vocabApi);t.chartType="genomeBrowser";t.geneSearchResult=o;const s={config:t};e.prepPlot(s)}catch(e){t.append("div").text("Error: "+(e.message||e));console.log(e)}}};if(!e.state.termdbConfig.queries.defaultBlock2GeneMode){a.defaultCoord=e.state.termdbConfig.queries.defaultCoord}else{a.searchOnly="gene"}const o=n(a)}async function g(t,e){const a=await t.getMds3queryDetails();const o=await t.get_variantFilter();if(o?.filter){a.variantFilter=o}const i=e?s(a,e):a;if(i.snvindel?.details){l({state:{config:i}},i.snvindel.details)}return i}function b(t,e){delete e.tooltipPrintValue;const[s,a]=t.state.config.snvindel.details.groups;if(s&&a){if(s.type=="info"||a.type=="info"){e.label="Value difference";return}const o=t.state.config.snvindel.details.groupTestMethods[t.state.config.snvindel.details.groupTestMethodsIdx];e.label=o.axisLabel||o.name;if(o.name=="Allele frequency difference"){e.tooltipPrintValue=t=>[{k:"AF diff",v:t.nm_axis_value}]}else if(o.name=="Fisher's exact test"){e.tooltipPrintValue=t=>[{k:"p-value",v:t.p_value}]}else;return}if(s.type=="info"){const a=t.state.config.variantFilter?.terms?.find((t=>t.id==s.infoKey));e.label=a?.name||s.infoKey;e.tooltipPrintValue=t=>[{k:e.label,v:t.info[s.infoKey]}];return}if(s.type=="filter"){e.label="Allele frequency";e.tooltipPrintValue=t=>[{k:"Allele frequency",v:t.nm_axis_value}];return}if(s.type=="population"){e.label="Allele frequency";e.tooltipPrintValue=t=>[{k:"Allele frequency",v:t.nm_axis_value}];return}throw"unknown type of the only group"}export{h as componentInit,d as genomeBrowserInit,m as getPlotConfig,u as makeChartBtnMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as e}from"./app-6fb77603.js";import{getPlotConfig as t}from"./matrix.config-2c550b5d.js";import{T as r,f as s}from"./termsetting-492eefa7.js";import"./matrix.sort-1ac05842.js";import"./tslib.es6-c3c2d88f.js";import"path";async function i(i={},a){i.chartType="hierCluster";const o=await t(i,a);delete o.genes;o.settings.hierCluster={dataType:o.dataType,clusterSamples:true,clusterMethod:"average",distanceMethod:"euclidean",zScoreCap:5,xDendrogramHeight:100,yDendrogramHeight:200,colorScale:"blueWhiteRed"};const n=a.vocabApi.termdbConfig.hierCluster||{};e(o.settings.hierCluster,n.settings,i.settings?.hierCluster||{});{const e=o.settings.hierCluster.colorScale;if(!e)throw"colorScale missing"}o.settings.matrix.collabelpos="top";const p=o.settings.hierCluster.termGroupName;const m=o.termgroups.find((e=>e.type=="hierCluster"||e.name==p))||{name:p};m.type="hierCluster";if(!m.lst?.length){if(!Array.isArray(i.terms))throw"opts.terms[] not array (may show geneset edit ui)";const e=[];for(const t of i.terms){const i=t.term?t:{term:t};if(!i.term.type){if(o.dataType==r.GENE_EXPRESSION||o.dataType==r.METABOLITE_INTENSITY){i.term.type=o.dataType}else{throw`term type missing and cannot be assigned by dataType`}}else if(!["geneExpression","metaboliteIntensity","float"].includes(i.term.type)){throw"term type not supported in hierCluster"}else if(o.dataType&&i.term.type!==o.dataType){throw`cannot have term type ${i.term.type} in ${o.dataType} term group`}e.push(s(i,a.vocabApi))}m.lst=await Promise.all(e);if(o.termgroups.indexOf(m)==-1)o.termgroups.unshift(m)}o.settings.matrix.maxSample=1e5;return o}export{i as getPlotConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t}from"./tslib.es6-c3c2d88f.js";import{appInit as o}from"./plot.app-2a805759.js";import{ai as e,z as s}from"./app-6fb77603.js";import"./recover-299ffdb3.js";import"./termsetting-492eefa7.js";import"path";import"./FilterRxComp-02e68f1b.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./toggleButtons-c4d6f260.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";function n(s,n,i){return t(this,void 0,void 0,(function*(){const[t,c]=yield r(s);if(c===null||c===void 0?void 0:c.length){return e(c,i)}const p={holder:i,vocabApi:{vocab:{terms:[]},main:()=>{},getTermdbConfig:()=>({})},state:{args:{data:t,genome:n},plots:[{chartType:"Disco",subfolder:"disco",extension:"ts"}]}};const u=yield o(p);return u}))}function r(o){return t(this,void 0,void 0,(function*(){if(Array.isArray(o.mlst)){return[o.mlst,null]}const t=[];const e=[];if(o.snvText)i(o.snvText,t,e);if(o.svText)c(o.svText,t,e);if(o.cnvText)p(o.cnvText,t,e);return[t,e]}))}function i(t,o,e){for(const s of t.trim().split("\n")){const t=s.trim().split("\t");if(t.length!=5){e.push("snv input not equal to 5 columns");continue}let n;try{n={dt:1,chr:t[0],position:Number(t[1]),gene:t[2],mname:t[3],class:u(t[4],e)}}catch(t){e.push(t);continue}o.push(n)}}function c(t,o,e){for(const s of t.trim().split("\n")){const t=s.trim().split("\t");if(t.length<4||t.length>6){e.push("sv input not equal to 4 or 6 columns");continue}let n;try{const o=t.length;if(o==4){n={dt:2,chrA:t[0],posA:Number(t[1]),chrB:t[2],posB:Number(t[3])}}else{n={dt:2,chrA:t[0],posA:Number(t[1]),geneA:t[2],chrB:t[3],posB:Number(t[4]),geneB:t[5]}}}catch(t){e.push(t);continue}o.push(n)}}function p(t,o,e){for(const s of t.trim().split("\n")){const t=s.trim().split("\t");if(t.length!=4){e.push("cnv input not equal to 4 columns");continue}let n;try{n={dt:4,chr:t[0],start:Number(t[1]),stop:Number(t[2]),value:Number(t[3])}}catch(t){e.push(t);continue}o.push(n)}}function u(t,o){const e=t.toLowerCase();const n=Object.values(s).find((t=>t.key.toLowerCase()===e||t.label.toLowerCase()===e));if(n){return n.key}else{o.push(`Invalid mutation class: ${t}`)}}export{n as launch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as t,g as e,d as s}from"./tk-ac524564.js";import{T as a}from"./toggleButtons-c4d6f260.js";import{aN as o}from"./app-6fb77603.js";import{r as l}from"./table-0daf2b89.js";import{f as n}from"./FilterStateless-16a33070.js";import{g as i}from"./FilterRxComp-02e68f1b.js";import"./termsetting-492eefa7.js";import{v as r}from"./violinRenderer-14fa200d.js";import"./block.legend-93d85a6e.js";import"./vcf-d357ce08.js";import"./partition-db811f6b.js";import"./arc-3d6751aa.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";import"./axis-747c801e.js";import"./legacy-d3-polyfill-bdb2d792.js";import"./regression.results-4767144e.js";import"./axisstyle-fac7f76b.js";import"./ColorScale-b991fc9e.js";import"./log-c26b6cfd.js";import"./block-75d4ff92.js";import"./checkbox-96437f4d.js";import"./pointer-c7475677.js";import"./downloadTextfile-5723af95.js";import"./radiobutton-09bff425.js";import"./niceNumLabels-29a7c6ca.js";import"./rehydrateFilter-12d118cb.js";import"./tslib.es6-c3c2d88f.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"path";import"./brush-9faa7ae7.js";import"./nodrag-b2737073.js";import"./line-264f8f9e.js";import"./basis-3870f5ba.js";function m(e,s,a,o){if(!s.leftlabels.doms.samples){s.leftlabels.doms.samples=t(s,a,o)}if(e.sampleTotalNumber){s.leftlabels.doms.samples.attr("class","sja_clbtext2").style("opacity",1).text(`${e.sampleTotalNumber} sample${e.sampleTotalNumber>1?"s":""}`).attr("data-testid","sjpp_mds3tk_samples_label").on("click",(async t=>{s.menutip.clear().showunder(t.target);await d(s,a);const o=s.menutip.d.append("div").style("margin","10px");g(o,e,s,a)}))}else{s.leftlabels.doms.samples.text("No samples").attr("class","").style("opacity",.5).on("click",null)}}function p(s,a,o,l){if(!a.leftlabels.doms.filterObj){a.leftlabels.doms.filterObj=t(a,o,l)}a.leftlabels.doms.filterObj.text(e(a.filterObj)).on("click",(async t=>{a.menutip.clear().showunder(t.target);const e={holder:a.menutip.d.append("div").style("margin","10px"),vocabApi:a.mds.termdb.vocabApi,callback:t=>{a.filterObj=t;a.load()}};c(e,o);n(e).main(a.filterObj)}))}function c(t,e){if(e.usegm){t.getCategoriesArguments={currentGeneNames:[e.usegm.name]}}else{t.getCategoriesArguments={rglst:structuredClone(e.rglst)}}}async function d(t,e){if(!t.mds.variant2samples.twLst){return}const s=t.menutip.d.append("div").style("margin","10px");const a=s.append("div").text("Loading...");try{const{summary:o}=await t.mds.getSamples({isSummary:true});t.leftlabels.__samples_data=o;a.remove();await f(o,s.append("div").attr("class","sja_mds3samplesummarydiv"),t,e)}catch(t){a.text(`Error: ${t.message||t}`);if(t.stack)console.log(t.stack)}}async function f(t,e,s,o){const l=[];for(const{termid:e,numbycategory:a}of t){l.push({label:s.mds.variant2samples.twLst.find((t=>t.term.id==e)).term.name+(a?`<span style="opacity:.8;font-size:.8em;float:right;margin-left: 5px;">n=${a.length}</span>`:"")})}new a({holder:e,tabsPosition:"vertical",linePosition:"right",tabs:l}).main();for(const[e,a]of t.entries()){const t=l[e].contentHolder.style("padding-left","20px");if(a.numbycategory){t.append("div").text("Click a category to create new track.").style("margin-bottom","10px").style("font-size",".8em").style("opacity",.5);b(a.termid,t,a.numbycategory,s,o);continue}if(a.density_data){if(!Number.isFinite(a.density_data.minvalue)||!Number.isFinite(a.density_data.maxvalue)){t.append("div").text("No data");continue}t.append("div").text("Select a range to create new track.").style("margin-bottom","10px").style("font-size",".8em").style("opacity",.5);y(a.termid,t,a,s,o);continue}throw"unknown summary data"}}function b(t,e,s,a,n){const i=a.mds.variant2samples.twLst.find((e=>e.term.id==t));if(!i)throw"showSummary4oneTerm(): tw not found from variant2samples.twLst";const r=[];for(const[t,e,a]of s){const s=[{value:i.term.values?.[t]?.label||t},{html:a==undefined?"":o(null,{f:e/a,v1:e,v2:a})},{html:e+(a?' <span style="font-size:.8em">/ '+a+"</span>":"")}];r.push(s)}l({div:e,rows:r,columns:[{nowrap:true},{},{}],showHeader:false,singleMode:true,noRadioBtn:true,noButtonCallback:t=>{m(s[t][0])}});async function m(e){a.menutip.clear();const o=await a.mds.termdb.vocabApi.getterm(t);if(!o.values||Object.keys(o.values).length==0){o.values={};for(const t of s){o.values[t[0]]={label:t[0],samplecount:t[1]}}}const l={type:"tvs",tvs:{term:o,values:[{key:e}]}};const i={type:"mds3",dslabel:a.dslabel,filter0:a.filter0,showCloseLeftlabel:true,filterObj:u(a,l),allow2selectSamples:a.allow2selectSamples};const r=n.block_addtk_template(i);n.tk_load(r)}}function u(t,e){if(t.filterObj){return i({type:"tvslst",join:"and",in:true,lst:[t.filterObj,e]})}return{type:"tvslst",in:true,join:"",lst:[e]}}async function y(t,e,s,a,o){const l=await a.mds.termdb.vocabApi.getterm(t);const n=async t=>{a.menutip.clear();const e={type:"tvs",tvs:{term:l,ranges:[{start:t.range_start,stop:t.range_end}]}};const s={type:"mds3",dslabel:a.dslabel,filter0:a.filter0,showCloseLeftlabel:true,filterObj:u(a,e),allow2selectSamples:a.allow2selectSamples};const n=o.block_addtk_template(s);o.tk_load(n)};const i=l.valueConversion?l.valueConversion.scaleFactor:1;const m=new r(e,s.density_data,400,100,10,20,n,i);m.render()}function g(t,e,a,o){t.append("div").text(`List ${e.sampleTotalNumber} sample${e.sampleTotalNumber>1?"s":""}`).attr("class","sja_menuoption sja_mds3_slb_sampletablebtn").on("click",(async()=>{a.menutip.clear();const t=a.menutip.d.append("div").text("Loading...").style("margin","15px");try{const{samples:e}=await a.mds.getSamples();await s(e,{div:a.menutip.d,tk:a,block:o});t.remove()}catch(e){t.text(e.message||e);console.log(e)}}))}export{p as makeSampleFilterLabel,m as makeSampleLabel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{initByInput as t}from"./controls.config-2f0fa061.js";import{d as e,M as a,U as s,ak as n,B as i,z as o,ap as l,at as r,as as p,L as c}from"./app-6fb77603.js";import{getSorterUi as d}from"./matrix.sorterUi-1c60c145.js";import{i as m,f as h,T as u,g}from"./termsetting-492eefa7.js";import{m as y}from"./radiobutton-09bff425.js";import{m as b}from"./checkbox-96437f4d.js";import{G as f}from"./recover-299ffdb3.js";import"./tslib.es6-c3c2d88f.js";import"path";import"./FilterRxComp-02e68f1b.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./toggleButtons-c4d6f260.js";import"./genesearch-ffd88bf2.js";import"./rehydrateFilter-12d118cb.js";function x(t){if(!t.holder)throw`zoom requires an opts.holder`;if(typeof t.callback!="function")throw`zoom requires an opts.callback function`;const e={min:1,max:100,value:25,step:10,increment:1,numberInputWidth:"35px",showJumpBtns:false};const a=Object.assign({},e,t.settings||{});t.holder.attr("title",t.title||null).style("vertical-align","top").style("text-align","center").on("mouseenter",(()=>{o.style("display","inline-block").style("overflow","visible")})).on("mouseleave",(()=>{o.style("display","none").style("overflow","hidden")}));const s=t.holder.append("label");s.append("span").text("Zoom");const n=s.append("input").attr("title","Enter a desired zoom level").attr("type","number").attr("min",a.min).attr("max",a.max).attr("step",a.increment).style("min-width",a.numberInputWidth).style("width",t.width||"fit-content").style("margin","3px 5px").property("value",a.value).on("change",(e=>{const a=Number(e.target.value);c.update({value:a});t.callback(a)}));s.append("span").text("unit"in t?t.unit:"%");const i=t.holder.node().getBoundingClientRect();t.holder.style("max-height",i.height+"px").style("max-width",i.width+"px");t.holder.append("br");const o=t.holder.append("div").style("display","none");const l=!t.showJumpBtns?null:t.holder.append("button").attr("title","Zoom in").style("width","25px").html("-").on("click",(()=>{const e=Math.max(a.step*Math.ceil((a.value-a.step)/a.step),a.min);c.update({value:e});t.callback(e)}));const r=o.append("input").attr("title","Slide to desired zoom level").attr("type","range").attr("min",a.min).attr("max",a.max).attr("step",a.increment).style("margin","2px 5px").style("padding",0).style("vertical-align","middle").property("value",a.value).html("-").on("input",(t=>{n.property("value",t.target.value)})).on("change",(e=>{const a=Number(e.target.value);c.update({value:a});t.callback(a)}));const p=!t.showJumpBtns?null:t.holder.append("button").attr("title","Zoom out").style("width","25px").html("+").on("click",(()=>{const e=Math.min(a.step*Math.floor((a.value+a.step)/a.step),a.max);c.update({value:e});t.callback(e)}));o.append("span").style("text-decoration","underline").style("cursor","pointer").style("title","use the default zoom value").text("Reset").on("click",t.reset);const c={update(e={}){const s=t.holder.node().getBoundingClientRect();if(!s.height||!s.width){t.holder.style("max-height","").style("max-width","");const e=t.holder.node().getBoundingClientRect();t.holder.style("max-height",e.height+"px").style("max-width",e.width+"px")}Object.assign(a,e);r.property("value",a.value).attr("min",a.min).attr("max",a.max).attr("step",a.increment);n.property("value",a.value).attr("min",a.min).attr("max",a.max).attr("step",a.increment);l?.property("disabled",a.value<=a.min);p?.property("disabled",a.value>=a.max)}};if(t.debug)c.Inner={settings:a,number:n,slider:r,minusBtn:l,plusBtn:p};return c}function v(t){if(!t.holder)throw`missing svgScroll.opts.holder argument`;const a={height:12,zoomLevel:1,opacity:.3};const s=Object.assign({},a,t);function n(t){g.x=t.clientX;e("body").on("mousemove.sjppSvgScroll",i).on("mouseup.sjppSvgScroll",o)}function i(t){if(!("x"in g))return;const e=t.clientX-g.x;if(g.sliderX+g.sliderWidth+e>s.visibleWidth-1){return}if(g.sliderX+e<0){return}h.attr("x",g.sliderX+e);s.callback(g.dxFactor*e,"move")}function o(t){if(!("x"in g))return;const a=t.clientX-g.x;s.callback(g.dxFactor*Math.min(g.maxDx,Math.max(a,g.minDx)),"up");delete g.x;e("body").on("mousemove.sjppSvgScroll",null).on("mouseup.sjppSvgScroll",null)}function l(t){g.x=t.clientX;const e=t.clientX<u.getBoundingClientRect().x?-1:1;o({clientX:Math.floor(g.x+e*g.arrowDx)})}s.holder.attr("display","none").attr("opacity",s.opacity).on("mouseover",(()=>s.holder.attr("opacity",1))).on("mouseout",(()=>s.holder.attr("opacity",s.opacity)));const r=s.holder.append("rect").style("height",s.height).style("stroke","none").style("fill","#fff").on("click",l);const p=s.holder.append("line").style("stroke","#ccc").style("stroke-width",1).on("click",l);const c=s.holder.append("path").attr("y",-s.height).attr("d",`M0,${s.height/2}L${s.height},0L${s.height},${s.height}Z`).style("stroke","#ccc").style("stroke-width",1).style("fill","#ccc").on("click",(t=>{g.x=t.clientX;o({clientX:Math.round(g.x-g.arrowDx)})}));const d=s.holder.append("path").attr("y",-s.height).style("stroke","#ccc").style("stroke-width",1).style("fill","#ccc").attr("d",`M0,0L${s.height},${s.height/2}L0,${s.height}Z`).on("click",(t=>{g.x=t.clientX;o({clientX:Math.round(g.x+g.arrowDx)})}));const m=s.height-4;const h=s.holder.append("rect").attr("y",2).attr("height",m).attr("stroke","#aaa").attr("stroke-width",1).attr("fill","#ccc").attr("rx",m/2).on("mousedown",n).on("mousemove",i).on("mouseup",o);const u=h.node();const g={};const y={update(t){const e={v:s.visibleWidth,t:s.totalWidth,z:s.zoomCenter};Object.assign(s,t);const a=s.totalWidth;const n=s.visibleWidth;if(a<=n){s.holder.attr("display","none");return}s.holder.attr("transform",`translate(${s.x},${s.y})`).attr("display","");r.attr("width",n);p.attr("x1",0).attr("x2",n).attr("y1",s.height/2).attr("y2",s.height/2);c.attr("transform",`translate(0,0)`);d.attr("transform",`translate(${n-s.height},0)`);if(n!=e.v||a!=e.t){g.sliderWidth=n*n/a;g.dxFactor=(a-n)/(n-g.sliderWidth)}const i=n*(s.zoomCenter/a);g.sliderX=Math.max(0,Math.min(i-g.sliderWidth/2,n-g.sliderWidth-1));h.attr("width",g.sliderWidth).attr("x",g.sliderX);g.maxDx=s.visibleWidth-g.sliderX-g.sliderWidth;g.minDx=-g.sliderX;g.arrowDx=Math.round(.1*s.visibleWidth);delete g.x}};return y}const w=new a({padding:""});class C{constructor(t,e){this.type="matrixControls";this.opts=t;this.parent=t.parent;this.overrides={};this.opts.holder.style("margin","10px 10px 20px 10px").style("white-space","nowrap");const a=this.parent.getState(e);const s=a.config.settings.matrix;if(this.parent.setClusteringBtn)this.parent.setClusteringBtn(this.opts.holder,((t,e)=>this.callback(t,e)));this.setSamplesBtn(s);this.setGenesBtn(s);if(s.addMutationCNVButtons&&this.parent.chartType!=="hierCluster"){this.setMutationBtn();this.setCNVBtn()}this.setVariablesBtn(s);this.setDimensionsBtn(s);this.setLegendBtn(s);this.setDownloadBtn(s);this.setZoomInput();this.setDragToggle({holder:this.opts.holder.append("div").style("display","inline-block"),target:this.parent.dom.seriesesG});this.setSvgScroll(a);this.keyboardNavHandler=async t=>{if(t.target.tagName=="BUTTON")this.keyEventTarget=t.target;if(t.key=="Escape"){this.parent.app.tip.hide()}else if(t.key=="Enter"||t.key=="ArrowDown"){const e=t.target.tagName=="BUTTON"?this.parent.app.tip.d.node().querySelectorAll("input, select"):t.target.querySelectorAll("input, select");for(const t of e){if(t.checkVisibility?.()||!t.checkVisibility&&t.getBoundingClientRect().height){t.focus();return false}}}else if(t.key=="Tab"&&t.shiftKey||t.key=="Backspace"||t.key=="ArrowUp"){this.keyEventTarget.focus();return false}};this.btns=this.opts.holder.selectAll(":scope>button").filter((t=>t&&t.label)).on(`keyup.matrix-${this.parent.id}`,this.keyboardNavHandler)}setSamplesBtn(t){const e=t.controlLabels;const a=this;const s=this.parent;const n=[{label:`Maximum # ${e.Samples}`,title:`Limit the number of displayed ${e.samples}`,type:"number",chartType:"matrix",settingsKey:"maxSample",getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"}},{label:`Sort ${e.Sample} Groups`,title:`Set how to sort ${e.sample} groups`,type:"radio",chartType:"matrix",settingsKey:"sortSampleGrpsBy",options:[{label:"Predefined or Group Name",value:"name",title:`Sort by group name`},{label:`${e.Sample} Count`,value:"sampleCount",title:`Sort by the number of samples in the group`},{label:`Hits`,value:"hits",title:`Sort by the total number of variants for every ${e.sample} in the group`}],getDisplayStyle(t){return t.divideBy&&!t.hierCluster?"table-row":"none"}},{label:`${e.Sample} Group Label Character Limit`,title:`Truncate the ${e.sample} group label if it exceeds this maximum number of characters`,type:"number",chartType:"matrix",settingsKey:"sampleGrpLabelMaxChars",getDisplayStyle(t){return t.divideBy&&!t.hierCluster?"table-row":"none"}},{label:`${e.Sample} Label Character Limit`,title:`Truncate the ${e.sample} label if it exceeds this maximum number of characters`,type:"number",chartType:"matrix",settingsKey:"collabelmaxchars"},{label:`Group ${e.Samples} By`,title:`Select a variable with discrete values to group ${e.samples}`,type:"term",chartType:"matrix",configKey:"divideBy",vocabApi:this.opts.app.vocabApi,state:{vocab:this.opts.vocab},processInput:async t=>{if(t?.term&&m(t.term)){t.q={...t.q,mode:"discrete"}}if(t)await h(t,this.opts.app.vocabApi);return t},processConfig:t=>{if(this.parent.chartType=="hierCluster"&&t["divideBy"]){t.settings={hierCluster:{yDendrogramHeight:0,clusterSamples:false}}}if(this.parent.config.divideBy)t.legendValueFilter=this.parent.mayRemoveTvsEntry(this.parent.config.divideBy)},getBodyParams:()=>{const t=this.parent.termOrder.filter((t=>t.tw.term.type==="geneVariant")).map((t=>t.tw.term.chr?`${t.tw.term.chr}:${t.tw.term.start}-${t.tw.term.stop}`:t.tw.term.gene||t.tw.term.name));return{currentGeneNames:t}}}];n.push({label:`Sort ${e.Sample} Priority`,title:`Set how to sort ${e.samples}`,type:"custom",init(t){const e=s.config.settings.matrix;if(!a.activeTab)a.activeTab="basic";t.dom.inputTd.style("padding","5px");const n=t.dom.inputTd.append("div").style("margin-bottom","5px");const i=n.append("div").style("display","inline-block").style("padding-right","5px").style("border-right","2px solid black").style("text-decoration",a.activeTab=="basic"?"underline":"").style("cursor","pointer").html("Basic").on("click",(()=>{a.activeTab="basic";i.style("text-decoration","underline");o.style("text-decoration","");l.style("display","");h.style("display","none")}));const o=n.append("div").style("display","inline-block").style("margin-left","5px").style("text-decoration",a.activeTab=="advanced"?"underline":"").style("cursor","pointer").html("Advanced").on("click",(()=>{a.activeTab="advanced";i.style("text-decoration","");o.style("text-decoration","underline");l.style("display","none");h.style("display","")}));const l=t.dom.inputTd.append("div").style("display",a.activeTab=="basic"?"":"none");const r=l.append("div");r.append("span").html("SSM");const{inputs:p}=y({holder:r.append("span"),options:[{label:"by consequence",value:"consequence",checked:e.sortByMutation==="consequence"},{label:"by presence",value:"presence",checked:e.sortByMutation==="presence"}],styles:{display:"inline-block"},callback:t=>{const e=s.config.settings.matrix.sortOptions;const a=e.a;const n=a.sortPriority[0].tiebreakers[1];n.disabled=!t;n.isOrdered=t==="consequence";s.app.dispatch({type:"plot_edit",id:s.id,config:{settings:{matrix:{sortByMutation:t,sortOptions:e}}}})}});p.style("margin","2px 0 0 2px").style("vertical-align","top");const c=l.append("div").style("display",e.showMatrixCNV!="none"&&!e.allMatrixCNVHidden?"block":"none");c.append("span").html("CNV");const m=b({holder:c.append("span"),divstyle:{display:"inline-block"},checked:e.sortByCNV,labeltext:"sort by CNV",callback:()=>{const t=m.property("checked");const e=s.config.settings.matrix.sortOptions;const a=e.a;const n=a.sortPriority[0].tiebreakers[2];n.disabled=!t;n.isOrdered=t;s.app.dispatch({type:"plot_edit",id:s.id,config:{settings:{matrix:{sortByCNV:t,sortOptions:e}}}})}});const h=t.dom.inputTd.append("div").style("display",a.activeTab=="advanced"?"":"none");t.dom.row.on("mouseover",(function(){this.style.backgroundColor="#fff";this.style.textShadow="none"}));if(!a.sorterUi){a.sorterUi=d({controls:this,holder:h,tip:this.parent.app.tip})}else{a.sorterUi.main(this.parent.config.settings.matrix,{holder:h})}return{main:t=>{const e=t.settings.matrix;p.property("checked",(t=>t.value==e.sortByMutation));m.property("checked",e.sortByCNV);c.style("display",e.showMatrixCNV!="none"&&!e.allMatrixCNVHidden?"block":"none")}}}});this.opts.holder.append("button").datum({label:e.Samples||`Samples`,getCount:()=>"sampleCount"in this.overrides?this.overrides.sampleCount:this.parent.sampleOrder?.length||0,rows:n,customInputs:this.updateSamplesControls}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setGenesBtn(t){const e=t.controlLabels;const a=[{label:` Stacked <span style="font-size:.7em;color:#555;">Show stacked rectangles in the same matrix cell to render variants for the same ${e.sample} and gene</span>`,value:"",title:`Show stacked rectangles in the same matrix cell to render variants for the same ${e.sample} and gene`},{label:` OncoPrint <span style="font-size:.7em;color:#555;">Show overlapping rectangles in the same matrix cell to render variants for the same ${e.sample} and gene</span>`,value:"oncoprint",title:`Show overlapping rectangles in the same matrix cell to render variants for the same ${e.sample} and gene`}];if(t.addMutationCNVButtons&&this.parent.chartType!=="hierCluster")a.unshift({label:` Single <span style="font-size:.7em;color:#555;">Show a single rectangle in a matrix cell to render the most severe variant (truncating > indels > missense > synonymous) for the same ${e.sample} and gene</span>`,value:"single",title:`Show a single rectangle in a matrix cell to render the most severe variant (truncating > indels > missense > synonymous) for the same ${e.sample} and gene`});this.opts.holder.append("button").datum({label:"Genes",getCount:()=>this.parent.termOrder?.filter((t=>t.tw.term.type=="geneVariant"||t.tw.term.type==u.GENE_EXPRESSION)).length||0,customInputs:this.appendGeneInputs,rows:[{label:`Display ${e.Sample} Counts for Gene`,title:`Include the ${e.sample} count in the gene label`,type:"radio",chartType:"matrix",settingsKey:"samplecount4gene",options:[{label:"Absolute",value:"abs"},{label:`Percent`,value:"pct"},{label:`None`,value:""}]},{label:"Genomic Alterations Rendering",title:`Set how to indicate a ${e.sample}'s applicable variant types in the same matrix cell`,type:"radio",chartType:"matrix",settingsKey:"cellEncoding",options:a,styles:{padding:"5px 0px",margin:0},labelDisplay:"block",callback:this.parent.geneStyleControlCallback},{label:"Sort Genes",title:"Set how to order the genes as rows",type:"radio",chartType:"matrix",settingsKey:"sortTermsBy",options:[{label:"By Input Data Order",value:"asListed"},{label:`By ${e.sample} Count`,value:"sampleCount"}],styles:{padding:0,"padding-right":"10px",margin:0}}]}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setVariablesBtn(t){t.controlLabels;this.opts.holder.append("button").datum({label:t.controlLabels.Terms||`Variables`,rows:[{label:`Row Group Label Max Length`,title:`Truncate the row group label if it exceeds this maximum number of characters`,type:"number",chartType:"matrix",settingsKey:"termGrpLabelMaxChars"},{label:`Row Label Max Length`,title:`Truncate the row label if it exceeds this maximum number of characters`,type:"number",chartType:"matrix",settingsKey:"rowlabelmaxchars"}],customInputs:this.appendDictInputs}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setDimensionsBtn(t){const e=t.controlLabels;this.opts.holder.append("button").datum({label:"Cell Layout",tables:[{rows:[{label:"Grid",title:"Show grid lines, which creates borders around each matrix cells. "+" Note that grid lines are hidden when the auto-computed width <= 2, or when either the column and row spacing is set to 0.",type:"checkbox",boxLabel:"show",processInput:t=>t===true?"rect":t==="rect",chartType:"matrix",settingsKey:"showGrid",colspan:2,align:"center"},{label:"Outline Color",title:"Set a border color for the whole matrix",type:"color",chartType:"matrix",settingsKey:"outlineStroke",colspan:2,align:"center"},{label:"Beam Color",title:"Set a color for the beam highlighter",type:"color",chartType:"matrix",settingsKey:"beamStroke",colspan:2,align:"center"},{label:"Grid Line Color",title:"Set the grid color, equivalent to applying the same border color for each matrix cell",type:"color",chartType:"matrix",settingsKey:"gridStroke",colspan:2,align:"center"},{label:"Background Color",title:`Set the background color when there are no alterations or annotation data for a ${e.sample}`,type:"color",chartType:"matrix",settingsKey:"cellbg",colspan:2,align:"center"},{label:`Use Canvas If # ${e.sample} Exceeds`,title:`Switch from SVG to canvas rendering when the number of ${e.samples} exceeds this number`,type:"number",chartType:"matrix",settingsKey:"svgCanvasSwitch",colspan:2,align:"center",width:60,min:0,max:1e4,step:1},{label:"Canvas Min. Pixel Width",title:"Set a minimum pixel width for a matrix cell when using canvas, may affect the perceived sharpness of the canvas image",type:"checkbox",boxLabel:"apply",chartType:"matrix",settingsKey:"useMinPixelWidth",colspan:2,align:"center",getDisplayStyle:()=>this.parent.settings.matrix.useCanvas?"":"none"}]},{header:["Cells","Columns","Rows"],rows:[{label:"Row Height",title:"Set the height of a matrix row",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{label:"N/A"},{settingsKey:"rowh",min:8,max:30,step:1}],getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"}},{label:"Min Col. Width",title:"Set the minimum width of the auto-computed matrix column width",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{settingsKey:"colwMin",min:.1,max:16,step:.2},{label:"N/A"}]},{label:"Max Col. Width",title:"Set the maximum width of the auto-computed matrix column width",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{settingsKey:"colwMax",min:1,max:24,step:.2},{label:"N/A"}]},{label:"Spacing",title:"Set the column spacing. Note that this will be set to 0 when the auto-computed width < 2.",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{settingsKey:"colspace",min:0,max:20,step:1},{settingsKey:"rowspace",min:0,max:20,step:1}],getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"}},{label:"Group spacing",title:"Set the spacing between column and row groups.",type:"number",width:50,align:"center",chartType:"matrix",inputs:[this.parent.chartType=="hierCluster"?{label:"N/A"}:{settingsKey:"colgspace",min:0,max:20,step:1},{settingsKey:"rowgspace",min:0,max:20,step:1}]}]},{header:["Labels","Columns","Rows"],rows:[{label:"Offset",title:"Set the gap between the label text and matrix edge",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{settingsKey:"collabelgap",min:0,max:20,step:1},{settingsKey:"rowlabelgap",min:0,max:20,step:1}]},{label:"Spacing",title:"Set the gap between labels",type:"number",width:50,align:"center",chartType:"matrix",inputs:[{settingsKey:"collabelpad",min:0,max:20,step:1},{settingsKey:"rowlabelpad",min:0,max:20,step:1}]},{label:"Min font size",title:"Set the minimum auto-computed font size for labels. Note that labels will be hidden if the auto-computed values falls below this minimum.",type:"number",width:50,align:"center",colspan:2,chartType:"matrix",settingsKey:"minLabelFontSize",min:0,max:24,step:.1},{label:"Max font size",title:"Set the maximum auto-computed font size for labels",type:"number",width:50,align:"center",colspan:2,chartType:"matrix",settingsKey:"maxLabelFontSize",min:0,max:24,step:.1},{label:"Group label<br/>position",title:"Set which side of the matrix to display group labels",type:"radio",width:50,chartType:"matrix",labelDisplay:"block",getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"},inputs:[{settingsKey:"collabelpos",options:[{label:"Top",value:"bottom",title:`Display ${e.sample} group labels at the bottom`},{label:"Bottom",value:"top",title:`Display ${e.sample} group labels on top`}]},{settingsKey:"rowlabelpos",options:[{label:"Left",value:"right",title:`Display gene or variable group labels on the left side`},{label:"Right",value:"left",title:`Display gene or variable group labels on the right side`}]}]}]}]}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setLegendBtn(t){this.opts.holder.append("button").style("margin","2px 0").datum({label:"Legend Layout",rows:[{label:"Font Size",title:"Set the font size for the legend text",type:"number",chartType:"legend",settingsKey:"fontsize"},{label:"Line Height",title:"Set the line height for a legend group",type:"number",chartType:"legend",settingsKey:"lineh"},{label:"Icon Height",title:"Set the icon height for a legend item",type:"number",chartType:"legend",settingsKey:"iconh"},{label:"Icon Width",title:"Set the icon width for a legend item",type:"number",chartType:"legend",settingsKey:"iconw"},{label:"Item Left Pad",title:"Set a left margin for each legend item",type:"number",chartType:"legend",settingsKey:"padx"},{label:"Left Margin",title:"Set a left margin for the whole legend",type:"number",chartType:"legend",settingsKey:"padleft"},{label:"Left Indent",title:`Set a left margin for the first legend item in each group, and should be set to the length of the longest group label.`+` The left indent will align the legend group label text to the right.`,type:"number",chartType:"legend",settingsKey:"hangleft"},{label:"Item Layout",title:"Option to separate each legend item into a new line, instead of a horizontal layout in the same line.",type:"checkbox",chartType:"legend",settingsKey:"linesep",boxLabel:"Line separated"}]}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setMutationBtn(){this.opts.holder.append("button").style("margin","2px 0").datum({label:"Mutation",updateBtn:t=>{const e=this.parent.config.settings.matrix;t.style("text-decoration",e.allMatrixMutationHidden?"line-through":"").style("text-decoration-thickness",e.allMatrixMutationHidden?"2px":"")},rows:[{title:`Show mutation options`,type:"radio",chartType:"matrix",settingsKey:"showMatrixMutation",options:[{label:"Show all mutations",value:"all"},{label:`Show only truncating mutations`,value:"onlyTruncating"},{label:`Show only protein-changing mutations`,value:"onlyPC"},{label:`Do not show mutations`,value:"none"},{label:`Show selected mutation`,value:"bySelection"}],labelDisplay:"block",getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"},callback:this.parent.mutationControlCallback}],customInputs:this.generateMutationItems}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setCNVBtn(){this.opts.holder.append("button").style("margin","2px 0").datum({label:"CNV",updateBtn:t=>{const e=this.parent.config.settings.matrix;const a=e.allMatrixCNVHidden;t.style("text-decoration",a?"line-through":"").style("text-decoration-thickness",a?"2px":"")},rows:[{title:`Show CNV options`,type:"radio",chartType:"matrix",settingsKey:"showMatrixCNV",options:[{label:"Show all CNV",value:"all"},{label:`Do not show CNV`,value:"none"},{label:`Show selected CNV`,value:"bySelection"}],labelDisplay:"block",getDisplayStyle(t){return t.chartType=="hierCluster"?"none":"table-row"},callback:this.parent.CNVControlCallback}],customInputs:this.generateCNVItems}).html((t=>t.label)).style("margin","2px 0").on("click",((t,e)=>this.callback(t,e)))}setDownloadBtn(t){this.opts.holder.append("button").style("margin","2px 0").text("Download").on("focus",(()=>this.parent.app.tip.hide())).on("click.sjpp-matrix-download",(t=>{const e=this.parent;if(!e.dom.downloadMenu)e.dom.downloadMenu=new a({padding:""});const c=e.dom.downloadMenu.clear();const d=c.d.append("div");d.append("div").attr("class","sja_menuoption sja_sharp_border").text(`SVG image`).on("click.sjpp-matrix-download",(()=>{s(this.opts.getSvg(),"matrix",{apply_dom_styles:true});e.dom.downloadMenu.destroy()}));d.append("div").attr("class","sja_menuoption sja_sharp_border").text(`TSV data`).on("click.sjpp-matrix-download",(()=>{const t=e.data.lst;const a=e.termOrder.map((t=>t.tw));const s=e.state.termdbConfig.assayAvailability;const c=e.settings.matrix.controlLabels;if(e.config.divideBy?.id&&!a.find((t=>t.id==e.config.divideBy.id))){a.push(e.config.divideBy)}const d=[];for(const e of t){for(const t of a){if(t.$id in e){d.push(e);break}}}const m=[c.Sample];for(const t of a)m.push(t.term.name);const h=[m];for(const t of d){const e=[t._ref_.label];for(const c of a){if(!t[c.$id]){e.push("")}else{if(c.term.type=="geneVariant"){const a=[];for(const e of t[c.$id].renderedValues){const t=s?.byDt?.[parseInt(e.dt)];if(e.dt==n){a.push((e.origin?`${e.origin} `:"")+(t?`${i[e.dt]}:`:"")+`${o[e.class]?.label}`+(e.mname?`,${e.mname}`:""))}else if(e.dt==l){const s=e.value?`${t?"":"CNV:"}${e.value}`:e.class=="CNV_amp"?"CNV gain":e.class=="CNV_loss"?"CNV loss":o[e.class]?.label;a.push((e.origin?`${e.origin} `:"")+(t?`${i[e.dt]}:`:"")+s)}else if(e.dt==r||e.dt==p){a.push((e.origin?`${e.origin} `:"")+(t?`${i[e.dt]}:`:"")+`${o[e.class]?.label}`+(e.gene&&e.mname?`(${e.gene}::${e.mname})`:""))}else{a.push(`DO NOT SUPPORT dt='${e.dt}'`)}}e.push(a.join("|"))}else if(c.term.type==u.GENE_EXPRESSION||c.term.type==u.METABOLITE_INTENSITY){e.push(t[c.$id]?.renderedValues?.[0]?.value||"")}else{e.push(t[c.$id]?.renderedValues?.[0]||t[c.$id]?.value||"")}}}h.push(e)}const g=h.map((t=>t.join("\t"))).join("\n");const y=document.createElement("a");document.body.appendChild(y);y.addEventListener("click",(function(){const t=(new Date).toISOString().split("T")[0];y.download=e.config.settings?.hierCluster?.termGroupName?.startsWith("Gene Expression")?`GeneExpression.${t}.tsv`:e.chartType=="hierCluster"?`HierCluster.${t}.tsv`:`${e.app.vocabApi.termdbConfig.matrix?.appName||"Matrix"}.${t}.tsv`;y.href=URL.createObjectURL(new Blob([g],{type:"text/tab-separated-values"}));document.body.removeChild(y)}),false);y.click();e.dom.downloadMenu.destroy()}));c.showunder(t.target)}))}main(t={}){this.overrides=t;this.parent.app.tip.hide();this.btns.text((t=>(t.getCount?`${t.getCount()} `:"")+t.label)).each((function(t){if(t.updateBtn)t.updateBtn(e(this))}));const a=this.parent.config.settings.matrix;const s=this.parent.dimensions;if(this.zoomApi)this.zoomApi.update({value:a.zoomLevel.toFixed(1),min:a.colwMin/a.colw,max:a.colwMax/a.colw,increment:a.zoomIncrement,step:a.zoomStep||1});if(this.svgScrollApi&&s){this.svgScrollApi.update({x:s.xOffset,y:s.yOffset-a.scrollHeight,totalWidth:s.zoomedMainW,visibleWidth:s.mainw,zoomCenter:a.zoomCenterPct*s.mainw-s.seriesXoffset})}if(this.dragToggleApi){this.dragToggleApi.update(a.mouseMode?{mouseMode:a.mouseMode}:{})}}getSettings(){return{mouseMode:this.dragToggleApi.getSettings().mouseMode}}async callback(e,a){const s=this.opts.app;const n=this.opts.parent;const i=a.tables||[a];e.target.focus();s.tip.clear();const o=s.tip.d.append("table").attr("class","sjpp-controls-table");for(const e of i){if(e.header){o.append("tr").selectAll("th").data(e.header).enter().append("th").html((t=>t))}for(const a of e.rows){const e=o.append("tr");const i=await t[a.type](Object.assign({},{holder:e,dispatch:s.dispatch,id:n.id,debug:this.opts.debug,parent:n},a));i.main(n.config)}if(e.customInputs)e.customInputs(this,s,n,o);o.selectAll("select, input, button").attr("tabindex",0).on("keydown",self.keyboardNavHandler)}s.tip.showunder(e.target)}prependInfo(t,e,a){const s=t.append("tr");s.append("td").text(e).attr("class","sja-termdb-config-row-label");s.append("td").text(a)}async appendGeneInputs(e,a,s,n){w.clear();if(!s.selectedGroup)s.selectedGroup=0;if(s.opts.customInputs?.genes){for(const a of s.opts.customInputs.genes){a.chartType="matrix";const i=n.append("tr");if(a.title)i.attr("aria-label",a.title);const o=await t[a.type](Object.assign({},{holder:i,id:s.id,debug:e.opts.debug,parent:s},a));o.main(s.config)}}e.addGenesetInput(event,a,s,n.append("tr"))}addGenesetInput(t,e,a,s){const n=this.btns.filter((t=>t.label=="Genes"))?.node();const i=e.tip;const o=a.config.termgroups;let l;const r=t=>{t.selectAll("*").remove();const a=l.lst.map((t=>({gene:t.name})));new f({holder:t,genome:e.opts.genome,geneList:a,customInputs:this.parent.opts.customInputs?.geneset,mode:l.mode,minNumGenes:l.mode=="geneExpression"?3:1,vocabApi:this.opts.app.vocabApi,callback:async({geneList:t,groupName:a})=>{if(!l)throw`missing selectedGroup`;i.hide();const s=l.status=="new"?{name:a,lst:[]}:o[l.index];if(l.status=="new")o.push(s);const n=l.mode=="geneExpression"?"geneExpression":"geneVariant";const r=s.lst.filter((t=>t.term.type!=n));const p=await Promise.all(t.map((async t=>{const e={gene:t.symbol||t.gene,name:t.symbol||t.gene,type:n};let a=s.lst.find((e=>e.term.name==t.symbol||e.term.name==t.gene));if(!a){a={term:e,q:{}};a.$id=await g(this.opts.app.vocabApi.getTwMinCopy(a))}else if(!a.$id){a.$id=await g(this.opts.app.vocabApi.getTwMinCopy({term:e}))}return a})));s.lst=[...r,...p];if(!s.lst.length)o.splice(l.index,1);e.dispatch({type:"plot_edit",id:this.parent.id,config:{termgroups:o}})},backBtn:{target:"Genes Menu",callback:()=>{n.click()}}})};const p=o.filter((t=>t.type!="hierCluster"||t.lst.find((t=>t.term.type=="geneExpression")))).length;s.append("td").attr("class","sja-termdb-config-row-label").html("Gene Set");if(p>0){const t=s.append("td").style("display","block").style("padding","5px 0px");const e=t.append("div").append("label");e.append("button").html(p>1?"Edit Selected Group":"Edit Current Group").on("click",(()=>{i.clear();this.setMenuBackBtn(i.d.append("div").style("padding","5px"),(()=>n.click()));const t=i.d.append("div");r(t)}));if(p>1){const{groups:t,groupSelect:a}=this.setTermGroupSelector(e,o);l=t.find((t=>t.selected));a.on("change",(()=>{l=t[a.property("value")]}))}else{const t=a.config.settings.hierCluster;const e=o.find((t=>t.type!="hierCluster"||t.lst.find((t=>t.term.type=="geneExpression"))));l={index:0,name:e.name,type:e.type,lst:e.lst.filter((t=>t.term.type.startsWith("gene"))).map((t=>({name:t.term.name}))),mode:this.parent.chartType=="hierCluster"&&(e.type=="hierCluster"||e.name==t?.termGroupName)?t.dataType:this.parent.state.termdbConfig.queries?.snvindel?u.GENE_VARIANT:"",selected:true}}}const c=s.append("td").style("display","block").style("padding","5px 0px");const d=c.append("div").append("label");const m=d.append("button").html("Create New Group").property("disabled",true).on("click",(()=>{i.clear();this.setMenuBackBtn(i.d.append("div"),(()=>n.click()));const t=h.property("value");a.config.settings.hierCluster;l={index:o.length,name:t,label:t,lst:[],status:"new",mode:a.state.termdbConfig.queries?.snvindel?u.GENE_VARIANT:""};r(i.d.append("div"))}));const h=d.append("input").style("margin","2px 5px").style("width","210px").attr("placeholder","Group Name").on("input",(()=>{m.property("disabled",!h.property("value"))})).on("keyup",(t=>{if(t.key=="Enter"&&!m.property("disabled")){m.node().click()}}))}setMenuBackBtn(t,e){t.attr("tabindex",0).style("padding","5px").style("text-decoration","underline").style("cursor","pointer").style("margin-bottom","12px").html(`« Back to Genes`).on("click",e).on("keyup",(t=>{if(t.key=="Enter")t.target.click()}))}setTermGroupSelector(t,e){const a=e.find((t=>t.lst.find((t=>t.term.type.startsWith("gene")))));const s=this.parent.config.settings.hierCluster;const n=e.map(((t,e)=>({index:e,name:t.name,type:t.type,lst:t.lst.filter((t=>t.term.type.startsWith("gene"))).map((t=>({name:t.term.name}))),mode:this.parent.chartType=="hierCluster"&&(t.type=="hierCluster"||t.name==s?.termGroupName)?s.dataType:this.parent.state.termdbConfig.queries?.snvindel?u.GENE_VARIANT:"",selected:this.parent.chartType=="hierCluster"&&(t.type=="hierCluster"||t.name&&t.name==s?.termGroupName)||t===a})));const i=t.append("select").style("width","218px").style("margin","2px 5px");for(const[t,e]of n.entries()){if(e.label)continue;if(e.name)e.label=e.name;else e.label=`Unlabeled group #${t+1}`}i.selectAll("option").data(n).enter().append("option").property("selected",(t=>t.selected)).attr("value",((t,e)=>e)).html((t=>t.label));return{groups:n,groupSelect:i}}appendDictInputs(t,e,a,s){w.clear();if(!a.selectedGroup)a.selectedGroup=t.chartType=="hierCluster"?1:0;e.tip.d.append("hr");t.addDictMenu(e,a,e.tip.d.append("div"))}generateCNVItems(t,e,a,s){s.attr("class",null);const i=a.config.settings.matrix;const o=a.legendData.find((t=>t.dt?.includes(n)));if(i.showMatrixCNV!=="none"&&(i.allMatrixMutationHidden||!o||o.crossedOut||!o.items.find((t=>!t.greyedOut&&!t.crossedOut)))){s.select("input[type='radio'][value='none']").property("disabled",true);s.select("input[type='radio'][value='none'] + span").style("opacity","0.5").on("mouseup",null)}if(i.addMutationCNVButtons&&a.chartType!=="hierCluster"&&i.showMatrixCNV=="bySelection")a.CNVControlCallback("bySelection")}generateMutationItems(t,e,a,s){s.attr("class",null);const n=a.config.settings.matrix;const i=a.legendData.find((t=>t.dt?.includes(l)));if(n.showMatrixMutation!=="none"&&(n.allMatrixCNVHidden||!i||i.crossedOut||!i.items.find((t=>!t.greyedOut&&!t.crossedOut)))){s.select("input[type='radio'][value='none']").property("disabled",true);s.select("input[type='radio'][value='none'] + span").style("opacity","0.5").on("mouseup",null)}if(n.addMutationCNVButtons&&a.chartType!=="hierCluster"&&n.showMatrixMutation=="bySelection")a.mutationControlCallback("bySelection")}updateSamplesControls(t,e,a,s){if(a.chartType=="hierCluster"&&a.config.settings.hierCluster.clusterSamples){const t=a.config.settings.matrix.controlLabels;const e=s.select(`tr[title='Set how to sort ${t.samples}']`);e.style("display","none")}}async addDictMenu(t,e,a,s=undefined){const n=await import("./app-d215327f.js");n.appInit({holder:s||t.tip.d,vocabApi:this.parent.app.vocabApi,focus:"off",state:{vocab:this.parent.state.vocab,activeCohort:this.parent.activeCohort,nav:{header_mode:"search_only"},tree:{usecase:{target:"matrix",detail:"termgroups"}}},tree:{submit_lst:e=>{this.submit_lst(e);t.tip.hide()}},search:{focus:"off"}})}async submit_lst(t){const e=await Promise.all(t.map((async t=>{const e=structuredClone(t);const a="id"in e?{id:e.id,term:e}:{term:e};await h(a,this.opts.app.vocabApi);return a})));this.parent.settings.matrix;const a=structuredClone(this.parent.config.termgroups);const s=a.findIndex((t=>t.name=="Variables"));if(s!==-1){const t=a[s];t.lst.push(...e);this.parent.app.dispatch({type:"plot_nestedEdits",id:this.parent.id,edits:[{nestedKeys:["termgroups",s,"lst"],value:t.lst}]})}else{const t={name:"Variables",lst:e};a.push(t);this.parent.app.dispatch({type:"plot_edit",id:this.parent.id,config:{termgroups:a}})}}setZoomInput(){const t=this.opts.holder.append("div").style("display","inline-block").style("margin-left","50px");const e=this.parent.config.settings.matrix;this.zoomApi=x({holder:t,title:"Zoom factor relative to the ideal column width, as computed for the number of columns versus available screen width",unit:"",width:"80px",settings:{value:1,min:.1,max:10,increment:e.zoomIncrement,step:e.zoomStep||5},callback:t=>{const e=this.parent;e.dimensions;e.settings.matrix;const a=e.getVisibleCenterCell(0);e.app.dispatch({type:"plot_edit",id:e.id,config:{settings:{matrix:{zoomLevel:t,zoomCenterPct:.5,zoomIndex:a.totalIndex,zoomGrpIndex:a.grpIndex}}}})},reset:()=>{this.parent.settings.matrix;this.parent.dimensions;this.parent.app.dispatch({type:"plot_edit",id:this.parent.id,config:{settings:{matrix:{zoomLevel:1,zoomCenterPct:0}}}})}})}setDragToggle(t={}){const e={mouseMode:"select",activeBgColor:"rgb(255, 255, 255)"};t.target.style("cursor","default");const a={opts:Object.assign({},e,t),dom:{selectBtn:t.holder.append("button").attr("aria-label","Click the matrix to select data").style("display","inline-block").style("width","25px").style("height","24.5px").style("background-color",e.activeBgColor).on("click",(()=>n("select"))),grabBtn:t.holder.append("button").attr("aria-label","Click the matrix to drag and move").style("display","inline-block").style("width","25px").style("height","24.5px").on("click",(()=>n("pan")))}};c.arrowPointer(a.dom.selectBtn,{width:14,height:14,transform:"translate(50,50)"});c.grab(a.dom.grabBtn,{width:14,height:14,transform:"translate(30,50)"});const s=this;function n(e){a.opts.mouseMode=e;s.parent.settings.matrix.mouseMode=e;t.target.style("cursor",e=="select"?"default":"grab");a.dom.selectBtn.style("background-color",e=="select"?a.opts.activeBgColor:"");a.dom.grabBtn.style("background-color",e=="pan"?a.opts.activeBgColor:"")}this.dragToggleApi={update(t={}){Object.assign(a.opts,t);n(a.opts.mouseMode)},getSettings(){return{mouseMode:a.opts.mouseMode}}}}setSvgScroll(t){this.svgScrollApi=v({holder:this.parent.dom.scroll,height:t.config.settings.matrix.scrollHeight,callback:(t,e)=>{const a=this.parent;const s=a.settings.matrix;const n=a.dimensions;if(e=="move"){a.dom.seriesesG.attr("transform",`translate(${n.xOffset+n.seriesXoffset-t},${n.yOffset})`);a.clusterRenderer.translateElems(-t,s,n);a.layout.top.attr.adjustBoxTransform(-t);a.layout.btm.attr.adjustBoxTransform(-t);if(a.dom.topDendrogram){a.dom.topDendrogram.attr("transform",`translate(${a.topDendroX-t},0)`)}}else if(e=="up"){const e=a.getVisibleCenterCell(-t);a.app.dispatch({type:"plot_edit",id:a.id,config:{settings:{matrix:{zoomCenterPct:.5,zoomIndex:e.totalIndex,zoomGrpIndex:e.grpIndex}}}})}}})}}export{C as MatrixControls};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t}from"./tslib.es6-c3c2d88f.js";import{o as e}from"./termsetting-492eefa7.js";import{convertViolinData as i}from"./tvs.numeric-aa1f892f.js";import{v as o}from"./violinRenderer-14fa200d.js";import{m as l}from"./checkbox-96437f4d.js";import"./app-6fb77603.js";import"path";import"./tvs.density-034b506d.js";import"./brush-9faa7ae7.js";import"./pointer-c7475677.js";import"./nodrag-b2737073.js";import"./niceNumLabels-29a7c6ca.js";import"./axis-747c801e.js";import"./line-264f8f9e.js";import"./constant-426a1483.js";import"./basis-3870f5ba.js";function n(n){return{getPillName(t){return e(n,t)},getPillStatus(){return{text:"continuous"}},showEditMenu(e){var a,r,p,d,c;return t(this,void 0,void 0,(function*(){s(n);e.style("padding","5px").selectAll("*").remove();const t=e.append("div");const m={width:500,height:100,xpad:10,ypad:20};const u=yield n.vocabApi.getViolinPlotData({tw:{term:n.term,q:n.q},filter:n.filter,filter0:(r=(a=n.vocabApi.state)===null||a===void 0?void 0:a.termfilter)===null||r===void 0?void 0:r.filter0,svgw:m.width/window.devicePixelRatio},(d=(p=n.opts).getBodyParams)===null||d===void 0?void 0:d.call(p));const v=i(u);const f=new o(t,v,m.width,m.height);f.render();let h;if(((c=n.usecase)===null||c===void 0?void 0:c.target)=="matrix"){h=l({holder:e,labeltext:"Convert to z-score",checked:n.q.convert2ZScore?true:false,divstyle:{display:"inline-block",padding:"3px 10px"},callback:t=>{n.q.convert2ZScore=t;if(t){g.property("value",1);delete n.q.scale}}})}const y=e.append("div").style("display","inline-block");y.append("div").style("display","inline-block").style("padding","3px 10px").html("Scale values");const g=y.append("select").on("change",(t=>{if(!n.q)throw`Missing .q{} [numeric.continuous getHandler()]`;if(t.target.value!="1"){if(h)h.property("checked",false);n.q.scale=Number(t.target.value)}else delete n.q.scale}));g.selectAll("option").data([{html:"No Scaling",value:1},{html:"Per 10",value:10},{html:"Per 100",value:100},{html:"Per 1000",value:1e3}]).enter().append("option").attr("value",(t=>t.value)).html((t=>t.html)).property("selected",(t=>"scale"in n.q&&t.value==n.q.scale));const b=e.append("div").style("padding","3px 10px");if(n.term.type=="survival"){b.append("div").style("font-size",".8em").style("margin","20px 5px 5px 5px").html(`\n\t\t\t\t\t\tDisplay survival outcomes as time to event (${n.term.unit})\n\t\t\t\t\t`)}b.append("button").style("margin","5px").html("Apply").on("click",(()=>{n.q.mode="continuous";n.runCallback()}))}))}}}function s(t){const e=t.numqByTermIdModeType;const i=t.term;if(!e[i.id])e[i.id]={};if(!e[i.id].continuous){e[i.id].continuous={mode:"continuous"}}const o=JSON.parse(JSON.stringify(e[i.id].continuous));t.q=Object.assign(o,t.q)}export{n as getHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t}from"./tslib.es6-c3c2d88f.js";import{W as e,k as n}from"./app-6fb77603.js";import{setDensityPlot as i}from"./density-09feb0c9.js";import{g as s,a}from"./termdb.bins-39d11f24.js";import{T as r}from"./toggleButtons-c4d6f260.js";import{m as o}from"./radiobutton-09bff425.js";import{o as l}from"./termsetting-492eefa7.js";import{convertViolinData as d}from"./tvs.numeric-aa1f892f.js";import{v as u}from"./violinRenderer-14fa200d.js";import"./drag-2e9c80bb.js";import"./nodrag-b2737073.js";import"./pointer-c7475677.js";import"path";import"./tvs.density-034b506d.js";import"./brush-9faa7ae7.js";import"./niceNumLabels-29a7c6ca.js";import"./axis-747c801e.js";import"./line-264f8f9e.js";import"./constant-426a1483.js";import"./basis-3870f5ba.js";function p(e){return{getPillName(t){return l(e,t)},getPillStatus(){var t,n;if(!e.q)throw`Missing .q{} [numeric.discrete getPillStatus()]`;const i=((t=e.q)===null||t===void 0?void 0:t.name)||((n=e.q)===null||n===void 0?void 0:n.reuseId);if(i)return{text:i};if(e.q.type=="regular-bin")return{text:"bin size="+e.q.bin_size};return{text:e.q.lst.length+" bins"}},showEditMenu(n){return t(this,void 0,void 0,(function*(){m(e,n)}))}}}function m(e,n){var s,a,r,o;return t(this,void 0,void 0,(function*(){e.num_obj={};e.num_obj.plot_size={width:500,height:100,xpad:10,ypad:20};n.selectAll("*").remove();n.append("div").style("padding","10px").style("text-align","center").html("Getting distribution data ...<br/>");try{const t=yield e.vocabApi.getViolinPlotData({tw:{term:e.term,q:{mode:"continuous"}},filter:e.filter,filter0:(a=(s=e.vocabApi.state)===null||s===void 0?void 0:s.termfilter)===null||a===void 0?void 0:a.filter0,svgw:e.num_obj.plot_size.width/window.devicePixelRatio,strokeWidth:.2},(o=(r=e.opts).getBodyParams)===null||o===void 0?void 0:o.call(r));e.num_obj.density_data=d(t)}catch(t){console.log(t)}n.selectAll("*").remove();if(e.term.type=="survival"){e.dom.discreteSur_div=n.append("div").style("padding","4px");w(e);return}e.dom.num_holder=n;e.dom.density_div=n.append("div");e.vr=new u(e.dom.density_div,e.num_obj.density_data,e.num_obj.plot_size.width,e.num_obj.plot_size.height);e.num_obj.svg=e.vr.svg;e.dom.bins_div=n.append("div").style("padding","4px");y(e);i(e);v(e);f(e);I(e)}))}function c(t){var e;if(t.q.type=="regular-bin"){if(!t.q.first_bin){t.q.first_bin={stop:Number(t.dom.first_stop_input.property("value"))}}t.q.startinclusive=t.dom.boundaryInput.property("value")=="startinclusive";t.q.stopinclusive=t.dom.boundaryInput.property("value")=="stopinclusive";const n=t.dom.bin_size_input.property("value");t.q.bin_size=Number(n);if(n.includes(".")&&!n.endsWith(".")){t.q.rounding="."+n.split(".")[1].length+"f"}else{t.q.rounding=".0f"}if(t.q.scale)delete t.q.scale;if(Number.isFinite((e=t.q.last_bin)===null||e===void 0?void 0:e.start));else{delete t.q.last_bin}t.numqByTermIdModeType[t.term.id].discrete["regular-bin"]=JSON.parse(JSON.stringify(t.q))}else if(t.term.type!=="survival"){if(t.dom.bins_table.selectAll("input").node().value){t.q.lst=b(t);t.numqByTermIdModeType[t.term.id].discrete["custom-bin"]=JSON.parse(JSON.stringify(t.q))}}t.q.mode="discrete";t.dom.tip.hide();t.runCallback()}function b(t){var e;const n=t.dom.boundaryInput.property("value")=="startinclusive";const i=t.dom.boundaryInput.property("value")=="stopinclusive";const r=t.dom.bins_table.node().querySelectorAll("input");let o;const l=t.dom.customBinBoundaryInput.property("value").split("\n").filter((t=>t!=""&&!isNaN(t)));const d=new Set(l);const u=Array.from(d).map((t=>+t)).sort(((t,e)=>t-e)).map(((e,l)=>{const d={start:+e,startinclusive:n,stopinclusive:i};if(o){delete o.stopunbounded;o.stop=d.start;const e=r[l].value;o.label=e?e:s(o,t.q,t.term.valueConversion);o.range=a(o,t.q)}o=d;return d}));if(u.length==0)return;o.stopunbounded=true;const p=(e=r[u.length])===null||e===void 0?void 0:e.value;o.label=p?p:s(o,t.q,t.term.valueConversion);o.range=a(o,t.q);u.unshift({startunbounded:true,stop:u[0].start,startinclusive:n,stopinclusive:i,label:r[0].value});if(!u[0].label)u[0].label=s(u[0],t.q,t.term.valueConversion);if(!u[0].range)u[0].range=a(u[0],t.q);return u}function y(t){var e,n;const i=t.num_obj.density_data;const r=t.numqByTermIdModeType;const o=t.term;if(!r[o.id])r[o.id]={};if(!r[o.id].discrete){const e=!Number.isFinite(i.minvalue)||!Number.isFinite(i.maxvalue)?0:i.maxvalue!=i.minvalue?i.minvalue+(i.maxvalue-i.minvalue)/2:i.maxvalue;r[o.id].discrete={"regular-bin":t.q&&t.q.type=="regular-bin"?JSON.parse(JSON.stringify(t.q)):t.opts.use_bins_less&&o.bins.less?JSON.parse(JSON.stringify(o.bins.less)):JSON.parse(JSON.stringify(o.bins.default)),"custom-bin":t.q&&t.q.type=="custom-bin"?t.q:{type:"custom-bin",mode:"discrete",lst:[{startunbounded:true,startinclusive:true,stopinclusive:false,stop:+e.toFixed(o.type=="integer"?0:2)},{stopunbounded:true,startinclusive:true,stopinclusive:false,start:+e.toFixed(o.type=="integer"?0:2)}]}};if(!r[o.id].discrete["regular-bin"].type){r[o.id].discrete["regular-bin"].type="regular-bin"}}if(t.q&&!t.q.mode)t.q.mode="discrete";if(!t.q||t.q.mode!=="discrete")t.q={};if(!t.q.type){t.q.type=((n=(e=t.term.bins)===null||e===void 0?void 0:e.default)===null||n===void 0?void 0:n.type)||"regular-bin"}const l=JSON.parse(JSON.stringify(r[o.id].discrete[t.q.type]));t.q=Object.assign(l,t.q);const d="bin_size"in t.q&&t.q.bin_size.toString();if(!t.q.rounding&&typeof d=="string"&&d.includes(".")&&!d.endsWith(".")){const e=d.split(".")[1].length;t.q.rounding="."+e+"f"}if(t.q.lst){t.q.lst.forEach((e=>{if(!("label"in e))e.label=s(e,t.q,t.term.valueConversion);if(!("range"in e))e.range=a(e,t.q)}))}}function v(t){t.dom.boundaryInclusionDiv=t.dom.bins_div.append("div").style("margin-left","5px");t.dom.boundaryInclusionDiv.append("span").style("padding","5px").style("color","rgb(136, 136, 136)").html("Boundary Inclusion");const e='<span style="font-family:Times;font-style:italic">x</span>';t.dom.boundaryInput=t.dom.boundaryInclusionDiv.append("select").style("margin-left","10px").on("change",(function(){const e=t.q.mode=="binary"?t.numqByTermIdModeType[t.term.id].binary:t.numqByTermIdModeType[t.term.id].discrete[t.q.type];e.lst=t.q.lst;if(e.type=="regular-bin"){n(e)}else{e.lst.forEach((e=>{n(e);e.label=s(e,t.q,t.term.valueConversion);e.range=a(e,t.q)}));z(t,e.lst)}function n(e){e.startinclusive=t.dom.boundaryInput.node().selectedIndex==1;e.stopinclusive=t.dom.boundaryInput.node().selectedIndex==0}}));t.dom.boundaryInput.selectAll("option").data([{value:"stopinclusive",html:"start < "+e+" ≤ end"},{value:"startinclusive",html:"start ≤ "+e+" < end"}]).enter().append("option").property("value",(t=>t.value)).property("selected",(e=>{if(t.q.type=="regular-bin")return t.q[e.value]==true;else return t.q.lst[0][e.value]==true})).html((t=>t.html))}function f(e){const n=e.dom.bins_div.append("div").style("margin","10px");if(e.term.bins.default.type=="custom-bin"){e.q.type="custom-bin";y(e);i(e);j(e,n);return}if(e.term.bins.default.type!="regular-bin")throw"self.bins.default.type is neither regular-bin or custom-bin, cannot render ui";const s=[{active:e.q.type=="regular-bin",label:"Same bin size",callback:(n,a)=>t(this,void 0,void 0,(function*(){e.q.type="regular-bin";y(e);i(e);if(!s[0].isInitialized){q(e,a.contentHolder);s[0].isInitialized=true}}))},{active:e.q.type=="custom-bin",label:"Varying bin sizes",callback:(n,a)=>t(this,void 0,void 0,(function*(){e.q.type="custom-bin";y(e);i(e);if(!s[1].isInitialized){j(e,a.contentHolder);s[1].isInitialized=true}}))}];new r({holder:n,tabs:s}).main()}function g(t,e){if(!t.term.valueConversion)return;e.append("div").style("margin-bottom","5px").style("opacity",.6).text(`Note: using values by the unit of ${t.term.valueConversion.fromUnit}.`)}function q(t,e){g(t,e);t.dom.bins_table=e.append("table");_(t,t.dom.bins_table.append("tr"));h(t,t.dom.bins_table.append("tr"));x(t,t.dom.bins_table.append("tr"))}function _(t,n){n.append("td").style("margin","5px").style("opacity",.5).text("Bin Size");const s=t.num_obj.density_data;const a=t.q.bin_size;t.dom.bin_size_input=n.append("td").append("input").attr("type","number").attr("value","rounding"in t.q?e(t.q.rounding)(t.q.bin_size):t.q.bin_size).style("margin-left","15px").style("width","100px").style("color",(()=>t.q.bin_size>Math.abs(s.maxvalue-s.minvalue)?"red":"")).on("change",(e=>{const n=Number(e.target.value);if(n<=0){window.alert("Please enter non-negative bin size.");e.target.value=a;return}if((s.maxvalue-s.minvalue)/n>100){window.alert("Bin size too small. Try setting a bigger value.");e.target.value=a;return}t.q.bin_size=n;t.dom.bin_size_input.style("color",t.q.bin_size>s.maxvalue-s.minvalue?"red":n!=a?"green":"");i(t)}))}function h(t,e){if(!t.q.first_bin)throw"missing q.first_bin";e.append("td").style("margin","5px").style("opacity",.5).text("First Bin Stop");const n=t.num_obj.density_data;const i=t.q.first_bin.stop;t.dom.first_stop_input=e.append("td").append("input").attr("type","number").property("value",i).style("width","100px").style("margin-left","15px").on("change",(e=>{const s=Number(e.target.value);if(s<n.minvalue||s>n.maxvalue){window.alert("First bin stop value out of bound.");e.target.value=i;return}if(t.q.first_bin)t.q.first_bin.stop=s;t.renderBinLines(t,t.q)}));e.append("td").append("div").style("font-size",".6em").style("opacity",.5).style("display",t.num_obj.no_density_data?"none":"block").text("Indicated by left-most red line. Drag to change.")}function x(t,e){const n=!t.q.last_bin||!Number.isFinite(t.q.last_bin.start);e.append("td").style("margin","5px").style("opacity",.5).text("Last Bin Start");const s=t.num_obj.density_data;const a=e.append("td").style("padding-left","15px").style("vertical-align","top");const r=a.append("div");o({holder:r,options:[{label:"Automatic",value:"auto",checked:n},{label:"Fixed",value:"fixed",checked:!n}],callback:e=>{if(e=="auto"){delete t.q.last_bin;l.style("display","none");t.renderBinLines(t,t.q);i(t);return}l.style("display","inline-block");if(!t.q.last_bin)t.q.last_bin={};if(t.dom.last_start_input.property("value")==""){t.dom.last_start_input.property("value",s.maxvalue)}d();i(t)}});const l=e.append("td").append("div").style("display",n?"none":"inline-block");t.dom.last_start_input=l.append("input").attr("type","number").property("value",t.q.last_bin?t.q.last_bin.start:"").style("width","100px").on("change",d);l.append("div").style("font-size",".6em").style("opacity",.5).style("display",t.num_obj.no_density_data?"none":"block").text("Indicated by right-most red line. Drag to change.");function d(){const e=Number(t.dom.last_start_input.property("value"));if(t.q.first_bin&&e<=t.q.first_bin.stop){window.alert("Last bin start cannot be smaller than first bin stop.");t.dom.last_start_input.property("value",s.maxvalue);return}if(e>s.maxvalue){window.alert("Last bin start value out of bound.");t.dom.last_start_input.property("value",s.maxvalue);return}if(!t.q.last_bin)t.q.last_bin={};t.q.last_bin.start=e;t.renderBinLines(t,t.q)}}function j(e,i){g(e,i);e.dom.bins_table=i.append("div").style("display","flex").style("width","100%");const s=e.dom.bins_table.append("div").style("margin-right","20px");e.dom.rangeAndLabelDiv=e.dom.bins_table.append("div");s.append("div").style("margin-bottom","5px").style("color","rgb(136, 136, 136)").text("Bin boundaries");e.dom.customBinBoundaryInput=s.append("textarea").style("width","100px").style("height","70px").text(e.q.lst.slice(1).map((t=>t.start)).join("\n")).on("change",a).on("keyup",(function(i){return t(this,void 0,void 0,(function*(){if(!n(i)&&i.key!=8)return;if(!e.dom.bins_table.selectAll("input").node().value)return;a.call(this)}))}));s.append("div").style("font-size",".6em").style("margin-left","1px").style("color","#858585").html("Enter numeric values </br>seperated by ENTER");function a(){const t=e.dom.bins_table.selectAll("input");t.property("value","");const n=b(e);if(n==undefined){return}const i=e.numqByTermIdModeType[e.term.id].discrete[e.q.type];if(e.q.hiddenValues)i.hiddenValues=e.q.hiddenValues;if(r(n,i.lst)){i.lst=n;e.renderBinLines(e,i)}z(e,i.lst);e.q.lst=i.lst}function r(t,e){if(t.length!=e.length)return true;if(Object.keys(t[0]).length!==Object.keys(e[0]).length)return true;for(const[n,i]of e.entries()){for(const e of Object.keys(i)){if(i[e]&&i[e]!==t[n][e]){return true}}}return false}z(e,e.q.lst)}function z(t,e){const n=t.dom.rangeAndLabelDiv;n.selectAll("*").remove();const i=n.append("div").style("display","grid").style("grid-template-columns","auto auto").style("column-gap","20px").style("align-items","center");i.append("div").style("margin-bottom","3px").style("color","rgb(136, 136, 136)").text("Range");i.append("div").style("margin-bottom","3px").style("color","rgb(136, 136, 136)").text("Bin label");for(const[t,n]of e.entries()){i.append("div").attr("name","range").html(n.range);i.append("div").append("input").attr("type","text").style("margin","2px 0px").property("value",n.label).on("change",(function(){e[t].label=this.value}))}t.dom.customBinRanges=t.dom.bins_table.selectAll('div[name="range"]').data(e);t.dom.customBinLabelInput=t.dom.bins_table.selectAll("input").data(e)}function I(t){const e=t.dom.bins_div.append("div");e.append("button").style("margin","5px").html("Apply").on("click",(()=>c(t)));e.append("button").style("margin","5px").html("Reset").on("click",(()=>{t.q={};delete t.numqByTermIdModeType[t.term.id];m(t,t.dom.num_holder)}))}function w(t){const e=t.dom.discreteSur_div.append("div");e.append("div").style("font-size",".8em").style("margin","5px").html(`\n\t\t\tDisplay survival outcomes as exit codes <br>\n\t\t`);const n=t.dom.discreteSur_div.append("div");n.append("button").style("margin","5px").html("Apply").on("click",(()=>c(t)))}export{p as getHandler,v as renderBoundaryInclusionInput,z as renderBoundaryInputDivs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{appInit as t}from"./plot.app-2a805759.js";import{d as e,P as r,b as i}from"./app-6fb77603.js";import{f as s}from"./termsetting-492eefa7.js";import{v as a}from"./FilterRxComp-02e68f1b.js";import"./recover-299ffdb3.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./tslib.es6-c3c2d88f.js";import"./toggleButtons-c4d6f260.js";import"path";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";const o="hg38";const n="GDC";async function p(i,p,f){const m=f[o];try{if(!m)throw o+" missing";const p=i.settings||{};if(typeof p!="object")throw"arg.settings{} not object";if(!p.matrix)p.matrix={};if(typeof p.matrix!="object")throw"arg.settings.matrix{} not object";if(!p.matrix.geneFilter)p.matrix.geneFilter="CGC";if(!Number.isInteger(p.matrix.maxGenes))p.matrix.maxGenes=50;if(i.filter0&&typeof i.filter0!="object")throw"arg.filter0 not object";const f=await a({state:{vocab:{genome:o,dslabel:n}}});f.getTermdbConfig();const c=await t({holder:e(i.holder).select(".sja_root_holder"),genome:m,state:{genome:o,dslabel:n,termfilter:{filter0:i.filter0},plots:[{chartType:"geneset",toolName:"OncoMatrix",settings:{maxGenes:p.matrix.maxGenes,geneFilter:p.matrix.geneFilter}}]},app:i.opts?.app||{},geneset:{mode:"geneVariant",genome:m,genes:i.genes,reactsTo(t){if(t.type.startsWith("plot_"))return t.id===this.id;if(t.type.startsWith("filter"))return true;if(t.type=="app_refresh")return true},showWaitMessage(t){t.style("margin","20px");t.append("div").text("Loading the top mutated genes in the current cohort...")},async callback(t,e){if(!t)return;g=t;if(!d){const t=c.getState().plots.find((t=>t.chartType=="matrix"));if(t)d=c.getComponents(`plots.${t.id}`)}const r=[...i.termgroups||[],{lst:e}];if(d){c.dispatch({type:"plot_edit",id:d.id,config:{termgroups:r}})}else{c.dispatch({type:"plot_create",config:{chartType:"matrix",termgroups:r,divideBy:i.divideBy||undefined,settings:p}})}}},recover:{undoHtml:"Undo",redoHtml:"Redo",resetHtml:"Restore",hide(t){return t.plots[0]?.chartType!="matrix"},adjustTrackedState:t=>{const e=structuredClone(t);delete e.termfilter.filter0;if(e.plots){for(const t of e.plots){if(!t.termgroups)continue;for(const e of t.termgroups){if(!e.lst)continue;for(const t of e.lst){if(!t?.term)continue;delete t.term.category2samplecount;delete t.term.values}}}}return e}},matrix:r({reactsTo(t){if(t.type.startsWith("plot_"))return t.id===this.id;if(t.type.startsWith("filter"))return true;if(t.type=="app_refresh")return true},customInputs:{genes:[{label:`Maximum # Genes`,title:"Limit the number of displayed genes",type:"number",chartType:"matrix",settingsKey:"maxGenes",callback:async t=>{for(const t in i.opts?.app?.callbacks){if(t.startsWith("preDispatch")){i.opts?.app?.callbacks[t]();break}}const e=await l(i,{maxGenes:t,geneFilter:p.matrix.geneFilter},f);u.update({termgroups:[{lst:e}],settings:{matrix:{maxGenes:t}}})}}]},callbacks:{"firstRender.gdcMatrix":async t=>{t.on("firstRender.gdcMatrix",null);if(!g)return;c.dispatch({type:"plot_delete",id:g.id});g=undefined}}},i.opts?.matrix||{})});let d,g;const u={update:async t=>{if(!d){const t=c.getState().plots.find((t=>t.chartType=="matrix"));if(t)d=c.getComponents(`plots.${t.id}`)}if(t.genes){c.dispatch({type:"plot_edit",id:d.id,config:{termgroups:[{lst:await Promise.all(t.genes.map((async t=>await s({term:{gene:t.gene,type:"geneVariant",name:t.gene}},f))))}]}})}else if("filter0"in t){c.dispatch({type:"filter_replace",filter0:t.filter0})}else if(d){c.dispatch({type:"plot_edit",id:d.id,config:t})}}};return u}catch(t){throw t}}async function l(t,e,r){const a={maxGenes:e.maxGenes,geneFilter:e.geneFilter};if(t.filter0)a.filter0=t.filter0;const o=await i("gdc/topMutatedGenes",{body:a});if(o.error)throw o.error;if(!o.genes)return;return await Promise.all(o.genes.map((async t=>await s({term:{gene:t.gene,type:"geneVariant"}},r))))}export{p as init};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as t,M as s,y as r}from"./app-6fb77603.js";import{s as e,r as o}from"./recover-299ffdb3.js";import{v as i}from"./FilterRxComp-02e68f1b.js";import"./termsetting-492eefa7.js";import"./tslib.es6-c3c2d88f.js";import"path";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./toggleButtons-c4d6f260.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";function a(t){switch(t){case"../plots/DEanalysis.js":return import("./DEanalysis-bbfad00d.js");case"../plots/Disco.js":return import("./Disco-b7c9bf72.js");case"../plots/DziViewer.js":return import("./DziViewer-28915c11.js");case"../plots/WSIViewer.js":return import("./WSIViewer-957695a8.js");case"../plots/barchart.data.js":return import("./FilterRxComp-02e68f1b.js").then((function(t){return t.j}));case"../plots/barchart.events.js":return import("./barchart.events-426d737a.js");case"../plots/barchart.js":return import("./barchart-2898d229.js");case"../plots/bars.renderer.js":return import("./bars.renderer-71935d34.js");case"../plots/bars.settings.js":return import("./bars.settings-64bb4642.js");case"../plots/boxplot.js":return import("./boxplot-4c9a5479.js");case"../plots/brainImaging.js":return import("./brainImaging-7716bc66.js");case"../plots/controls.btns.js":return import("./controls.btns-5bf9e7d7.js");case"../plots/controls.config.js":return import("./controls.config-2f0fa061.js");case"../plots/controls.js":return import("./controls-268e40e6.js");case"../plots/cuminc.js":return import("./cuminc-8dffb765.js");case"../plots/dataDownload.js":return import("./dataDownload-452ae3cd.js");case"../plots/dictionary.js":return import("./dictionary-a132a3cc.js");case"../plots/facet.js":return import("./facet-fa4fe49c.js");case"../plots/geneExpression.js":return import("./geneExpression-66208299.js");case"../plots/geneORA.js":return import("./geneORA-9456872c.js");case"../plots/geneset.js":return import("./geneset-0315daf8.js");case"../plots/genomeBrowser.controls.js":return import("./genomeBrowser.controls-2601cab5.js");case"../plots/genomeBrowser.js":return import("./genomeBrowser-608b924e.js");case"../plots/gsea.js":return import("./gsea-0c0cf8de.js");case"../plots/hierCluster.config.js":return import("./hierCluster.config-f4daaf92.js");case"../plots/hierCluster.interactivity.js":return import("./hierCluster.interactivity-7f475259.js").then((function(t){return t.i}));case"../plots/hierCluster.js":return import("./hierCluster-7ab62ca5.js");case"../plots/hierCluster.renderers.js":return import("./hierCluster.renderers-19b79639.js").then((function(t){return t.r}));case"../plots/imagePlot.js":return import("./imagePlot-1ef24562.js");case"../plots/matrix.cells.js":return import("./matrix.cells-a018d731.js");case"../plots/matrix.cluster.js":return import("./matrix.cluster-a6e713e8.js");case"../plots/matrix.config.js":return import("./matrix.config-2c550b5d.js");case"../plots/matrix.controls.js":return import("./matrix.controls-42ad4912.js");case"../plots/matrix.data.js":return import("./matrix.data-2b814c9f.js").then((function(t){return t.m}));case"../plots/matrix.dom.js":return import("./matrix.dom-1e0da5b3.js");case"../plots/matrix.groups.js":return import("./matrix.groups-824a7244.js").then((function(t){return t.m}));case"../plots/matrix.interactivity.js":return import("./matrix.interactivity-1cb56534.js");case"../plots/matrix.js":return import("./matrix-38cd47c3.js");case"../plots/matrix.layout.js":return import("./matrix.layout-47e44357.js").then((function(t){return t.m}));case"../plots/matrix.legend.js":return import("./matrix.legend-9af0c757.js").then((function(t){return t.m}));case"../plots/matrix.renderers.js":return import("./matrix.renderers-337ce240.js");case"../plots/matrix.serieses.js":return import("./matrix.serieses-7b7184c9.js").then((function(t){return t.m}));case"../plots/matrix.sort.js":return import("./matrix.sort-1ac05842.js");case"../plots/matrix.sorterUi.js":return import("./matrix.sorterUi-1c60c145.js");case"../plots/plot.app.js":return Promise.resolve().then((function(){return c}));case"../plots/plot.brainImaging.js":return import("./plot.brainImaging-32a484b6.js");case"../plots/plot.disco.js":return import("./plot.disco-1fdfee3c.js");case"../plots/plot.ssgq.js":return import("./plot.ssgq-d33113d5.js");case"../plots/profileBarchart.js":return import("./profileBarchart-58f0a8c0.js");case"../plots/profilePlot.js":return import("./profilePlot-4db8ca78.js");case"../plots/profilePolar.js":return import("./profilePolar-50b8e40e.js");case"../plots/profileRadar.js":return import("./profileRadar-fff0b004.js");case"../plots/profileRadarFacility.js":return import("./profileRadarFacility-d6d34c15.js");case"../plots/profileSummary.js":return import("./profileSummary-04b8b15b.js");case"../plots/regression.inputs.js":return import("./regression.inputs-14df7c31.js").then((function(t){return t.b}));case"../plots/regression.inputs.term.js":return import("./regression.inputs-14df7c31.js").then((function(t){return t.a}));case"../plots/regression.inputs.values.table.js":return import("./regression.inputs.values.table-d79efa9e.js");case"../plots/regression.js":return import("./regression.inputs-14df7c31.js").then((function(t){return t.r}));case"../plots/regression.results.js":return import("./regression.results-4767144e.js").then((function(t){return t.r}));case"../plots/sampleScatter.interactivity.js":return import("./sampleScatter-55d9eb74.js").then((function(t){return t.a}));case"../plots/sampleScatter.js":return import("./sampleScatter-55d9eb74.js").then((function(t){return t.b}));case"../plots/sampleScatter.renderer.js":return import("./sampleScatter-55d9eb74.js").then((function(t){return t.s}));case"../plots/sampleScatter.rendererThree.js":return import("./sampleScatter.rendererThree-ef289434.js").then((function(t){return t.c}));case"../plots/sampleView.js":return import("./sampleView-1dff3fca.js");case"../plots/scatter.js":return import("./scatter-f8285107.js");case"../plots/singleCellPlot.js":return import("./singleCellPlot-eff5760b.js");case"../plots/stattable.js":return import("./stattable-46cde32c.js");case"../plots/summary.js":return import("./summary-a6c15c9e.js");case"../plots/survival.js":return import("./survival-52714cd3.js");case"../plots/table.js":return import("./table-bf40249b.js");case"../plots/variantBrowser.js":return import("./variantBrowser-14d5c3f6.js");case"../plots/violin.interactivity.js":return import("./violin.interactivity-bf40ddde.js");case"../plots/violin.js":return import("./violin-74d26b75.js");case"../plots/violin.renderer.js":return import("./violin.renderer-469fa0ff.js");default:return new Promise((function(s,r){(typeof queueMicrotask==="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+t)))}))}}class n{constructor(t){this.type="app";const s=t.violin?.mode=="minimal"?null:t.holder.append("div").style("white-space","nowrap");this.dom={holder:t.holder,errdiv:t.holder.append("div"),plotDiv:t.holder.append("div")};if(s){this.dom.plotControls=s.append("div").style("display","inline-block");this.dom.recoverControls=s.append("div").style("display","inline-block")}}validateOpts(t={}){if(!t.holder)throw`missing opts.holder in the MassApp constructor argument`;if(!t.callbacks)t.callbacks={};return t}async preApiFreeze(t){try{t.tip=new s({padding:"5px"});t.printError=t=>this.printError(t);const r=this.opts.state.vocab;t.vocabApi=this.opts.vocabApi?this.opts.vocabApi:await i({app:t,state:{vocab:{genome:r?.genome||this.opts.state.genome,dslabel:r?.dslabel||this.opts.state.dslabel,terms:r?.terms}},fetchOpts:this.opts.fetchOpts});this.opts.state.vocab=t.vocabApi.vocab}catch(t){throw t}}async init(){try{this.opts.state.nav={header_mode:"hidden"};this.store=await e({app:this.api,state:this.opts.state});this.state=await this.store.copyState();this.components={plots:{}};if(this.opts.app?.features?.includes("recover"))this.components.recover=await o({app:this.api,holder:this.dom.recoverControls,getState:t=>t,maxHistoryLen:10});await this.api.dispatch()}catch(t){this.printError(t);throw t}}async main(){this.api.vocabApi.main();for(const t in this.components.plots){const s=this.components.plots[t];if(!this.state.plots.find((t=>t.id===s.id))){s.destroy();delete this.components.plots[t]}}for(const[t,s]of this.state.plots.entries()){if(!this.components.plots[s.id]){const t=this.opts?.app?.getPlotHolder?this.opts.app.getPlotHolder(s,this.dom.holder):this.dom.holder.append("div");if(!this.dom.plotDiv)this.dom.plotDiv=t;const r=await a(`../plots/${s.chartType}.js`);const e=await r.componentInit({id:s.id,app:this.api,holder:t,controls:this.dom.plotControls});this.components.plots[s.id]=e}}}printError(t){r(this.dom.errdiv,"Error: "+(t.message||t));if(t.stack)console.log(t.stack);this.bus.emit("error")}destroy(){this.dom.holder.selectAll("*").remove()}}const p=t(n);var c=Object.freeze({__proto__:null,appInit:p});export{p as appInit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t}from"./svg.download-f4aa48e4.js";import{d as e,M as i,L as s}from"./app-6fb77603.js";import{m as a}from"./termsetting-492eefa7.js";import{c as o}from"./FilterRxComp-02e68f1b.js";import{controlsInit as n}from"./controls-268e40e6.js";import{k as l}from"./recover-299ffdb3.js";import"./tslib.es6-c3c2d88f.js";import"path";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./controls.btns-5bf9e7d7.js";import"./controls.config-2f0fa061.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./toggleButtons-c4d6f260.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";const r=["Low income","Lower middle income","Upper middle income","High income"];const p=["Small (1-25 annual newly diagnoses)","Medium (26-80 annual newly diagnoses)","Large (81-120 annual newly diagnoses)","Very large (>120 annual newly diagnoses)"];class d{constructor(){this.type="profilePlot";this.downloadCount=0}getState(t){const e=t.plots.find((t=>t.id===this.id));if(!e)throw`No plot with id='${this.id}' found`;return{config:e,termfilter:t.termfilter,dslabel:t.vocab.dslabel,vocab:t.vocab,logged:e.logged,site:e.site}}async init(t){const a=t.plots.find((t=>t.id===this.id));if(this.opts.header){const t=a.logged?a.site?a.site:"Admin":"Public";this.opts.header.text(a.header?a.header:a.chartType+` / ${t}`)}const o=this.opts.holder.append("div").style("display","inline-block");const n=o.append("div").style("display","inline-block").style("vertical-align","top");const l=o.append("div").style("display","inline-block").style("vertical-align","top");const r=this.opts.holder.append("div");const p=n.append("div").style("display","inline-block").style("font-size","0.9em");const d=n.append("div").style("margin-left","16px").style("margin-top","8px");const h=l.insert("div").style("display","inline-block");const c=h.append("div");this.dom={controlsDiv:p,iconsDiv:d,holder:h,plotDiv:c,holder2:r};e(".sjpp-output-sandbox-content").on("scroll",(t=>this.onMouseOut(t)));this.dom.plotDiv.on("mousemove",(t=>this.onMouseOver(t)));this.dom.plotDiv.on("mouseleave",(t=>this.onMouseOut(t)));this.dom.plotDiv.on("mouseout",(t=>this.onMouseOut(t)));this.sampleidmap=await this.app.vocabApi.getSamplesByName();if(a.site){if(Object.keys(this.sampleidmap).length==0)throw"You must login to view site info";const t=this.sampleidmap[a.site]?.id;if(!t)throw"Invalid site"}this.tip=new i({padding:"4px",offsetX:10,offsetY:15});document.addEventListener("scroll",(t=>this?.tip?.hide()));s["pdf"](d.append("div").style("padding","0px 5px 15px 5px"),{title:"Prints page, select Save as PDF in the options to download as a pdf",handler:()=>{window.print()}});if(this.type!="profileRadarFacility"&&!a.settings[this.type].comparison){const t=d.append("div").style("margin-bottom","20px");const e=t.append("button").style("border","none").style("background-color","transparent");s["compare"](e,{title:"Compare with another plot"});e.on("click",(async t=>{const i=this.settings.comparison=!this.settings.comparison;e.style("background-color",i?"rgb(207, 226, 243)":"transparent");this.dom.holder2.selectAll("*").remove();if(i)await this.comparePlots()}))}if(this.type!="profileBarchart"){const t=d.append("div").style("padding-bottom","15px");this.dom.tableBt=t.append("button").style("border","none").style("background-color","rgb(207, 226, 243)");s["table"](this.dom.tableBt,{title:"Show table with data"});this.dom.tableBt.on("click",(t=>{const e=!this.settings.showTable;this.dom.tableBt.style("background-color",e?"rgb(207, 226, 243)":"transparent");this.showTable(e)}))}s["restart"](d.append("div").style("padding","0px 5px 15px 5px"),{title:"Clear filters",handler:async()=>{this.clearFiltersExcept([]);this.app.dispatch({type:"plot_edit",id:this.id,config:{filter:this.getFilter(),settings:{[this.type]:this.settings}}})}});if(!a.settings[this.type].comparison)s["add"](d.append("div").style("padding","3px"),{title:"Open a new plot",handler:async()=>{const t={chartType:this.type,insertBefore:this.id,header:this.opts.header.text(),logged:this.state.config.logged,site:this.state.config.site};if(this.type=="profileRadarFacility"||this.type=="profileRadar")t.plot=this.state.config.plot;this.app.dispatch({type:"plot_create",config:t})}})}async showTable(t){this.settings.showTable=t;await this.app.dispatch({type:"plot_edit",id:this.id,config:{settings:{[this.type]:this.settings}}})}getList(t){const e=Object.values(t.term.values);const i=this.filtersData.lst.filter((e=>this.samplesPerFilter[t.term.id].includes(parseInt(e.sample))));const s=Array.from(new Set(i.map((e=>e[t.$id]?.value))));for(const t of e){t.value=t.label;t.disabled=!s.includes(t.label)}e.unshift({label:"",value:""});if(!(t.term.id in this.settings))this.settings[t.term.id]=e[0].label;return e}async main(){this.config=JSON.parse(JSON.stringify(this.state.config));this.settings=this.config.settings[this.type];if(this.dom.tableBt)this.dom.tableBt.style("background-color",this.settings.showTable?"rgb(207, 226, 243)":"transparent")}async comparePlots(){this.plotAdded=true;const t=this.state;const e=await import("./plot.app-2a805759.js");const i={chartType:this.type,settings:{[this.type]:{comparison:true}}};if(this.type=="profileRadar"||this.type=="profileRadarFacility")i.plot=this.config.plot;const s={holder:this.dom.holder2,state:{plots:[i],vocab:t.vocab}};await e.appInit(s)}async setControls(e=[]){const i={};for(const t of this.config.filterTWs){const e=this.getFilter(t);if(e)i[t.term.id]=e}this.samplesPerFilter=await this.app.vocabApi.getSamplesPerFilter({filters:i});this.filtersData=await this.app.vocabApi.getAnnotatedSampleData({terms:this.config.filterTWs,termsPerRequest:10});this.regions=Object.keys(this.config.regionTW.term.values).map((t=>({label:t,value:t})));this.regions.unshift({label:"",value:""});this.countries=this.getList(this.config.countryTW);this.incomes=this.getList(this.config.incomeTW);this.teachingStates=this.getList(this.config.teachingStatusTW);this.referralStates=this.getList(this.config.referralStatusTW);this.fundingSources=this.getList(this.config.fundingSourceTW);this.hospitalVolumes=this.getList(this.config.hospitalVolumeTW);this.yearsOfImplementation=this.getList(this.config.yearOfImplementationTW);this.incomes.sort(((t,e)=>{const i=r.indexOf(t.value);const s=r.indexOf(e.value);if(i<s)return-1;return 1}));this.hospitalVolumes.sort(((t,e)=>{const i=p.indexOf(t.value);const s=p.indexOf(e.value);if(i<s)return-1;return 1}));this.types=this.getList(this.config.typeTW);const s=this.config.filter||this.getFilter();this.data=await this.app.vocabApi.getAnnotatedSampleData({terms:this.twLst,filter:s,termsPerRequest:30});const a=this.type;this.dom.controlsDiv.selectAll("*").remove();let o=[];if(this.state.logged&&this.state.site&&a!="profileRadarFacility"){const t={label:"Data",type:"radio",chartType:a,settingsKey:"isAggregate",options:[{label:this.state.site,value:false},{label:"Aggregate",value:true}]};o.push(t)}if(!this.state.logged||!this.state.site||this.settings.isAggregate||a=="profileRadarFacility"){o.push(...[{label:"Region",type:"dropdown",chartType:a,options:this.regions,settingsKey:this.config.regionTW.term.id,callback:t=>this.setRegion(t)},{label:"Country",type:"dropdown",chartType:a,options:this.countries,settingsKey:this.config.countryTW.term.id,callback:t=>this.setFilterValue(this.config.countryTW.term.id,t)},{label:"Income group",type:"dropdown",chartType:a,options:this.incomes,settingsKey:this.config.incomeTW.term.id,callback:t=>this.setFilterValue(this.config.incomeTW.term.id,t)},{label:"Facility type",type:"dropdown",chartType:a,options:this.types,settingsKey:this.config.typeTW.term.id,callback:t=>this.setFilterValue(this.config.typeTW.term.id,t)},{label:this.config.teachingStatusTW.term.name,type:"dropdown",chartType:a,options:this.teachingStates,settingsKey:this.config.teachingStatusTW.term.id,callback:t=>this.setFilterValue(this.config.teachingStatusTW.term.id,t)},{label:this.config.referralStatusTW.term.name,type:"dropdown",chartType:a,options:this.referralStates,settingsKey:this.config.referralStatusTW.term.id,callback:t=>this.setFilterValue(this.config.referralStatusTW.term.id,t)},{label:this.config.fundingSourceTW.term.name,type:"dropdown",chartType:a,options:this.fundingSources,settingsKey:this.config.fundingSourceTW.term.id,callback:t=>this.setFilterValue(this.config.fundingSourceTW.term.id,t)},{label:this.config.hospitalVolumeTW.term.name,type:"dropdown",chartType:a,options:this.hospitalVolumes,settingsKey:this.config.hospitalVolumeTW.term.id,callback:t=>this.setFilterValue(this.config.hospitalVolumeTW.term.id,t)},{label:this.config.yearOfImplementationTW.term.name,type:"dropdown",chartType:a,options:this.yearsOfImplementation,settingsKey:this.config.yearOfImplementationTW.term.id,callback:t=>this.setFilterValue(this.config.yearOfImplementationTW.term.id,t)}])}await this.loadSampleData(a,o);o.unshift(...e);this.components={controls:await n({app:this.app,id:this.id,holder:this.dom.controlsDiv,inputs:o})};this.components.controls.on(`downloadClick.${a}`,(()=>t(this.svg,this.getDownloadFilename(),this.dom.holder.node())));this.components.controls.on(`helpClick.${a}`,(()=>{let t;if(this.state.dslabel=="ProfileAbbrev"){if(a=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-abbr-profiledash.pdf";else if(a=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-abbr-profiledash.pdf";else if(a.startsWith("profileRadar"))t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/radar-abbr-profiledash.pdf"}else if(this.state.dslabel=="ProfileFull"){if(a=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-full-profiledash.pdf";else if(a=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-full-profiledash.pdf";else if(a.startsWith("profileRadar"))t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/radar-full-profiledash.pdf"}if(t)window.open(t)}));this.filtersCount=0}async loadSampleData(t,e){if(t!="profileRadarFacility"){if(this.state.logged){if(this.state.site&&!this.settings.isAggregate){const t=this.sampleidmap[this.state.site].id;this.settings.site=t;this.sites=[{label:this.state.site,value:t}]}else if(!this.state.site){this.sites=this.data.lst.map((t=>({label:this.data.refs.bySampleId[t.sample].label,value:t.sample})));this.sites.unshift({label:"",value:""});e.push({label:"Site",type:"dropdown",chartType:t,options:this.sites,settingsKey:"site",callback:t=>this.setSite(t)})}if(this.settings.site)this.sampleData=this.data.samples[Number(this.settings.site)];else this.sampleData=null}}else{if(this.state.logged){let i;if(this.state.site){const t=this.sampleidmap[this.state.site].id;this.settings.site=t;this.sites=[{label:this.state.site,value:t}];i=await this.app.vocabApi.getAnnotatedSampleData({terms:this.twLst,termsPerRequest:30,filter:l(parseInt(t))});this.sampleData=i.lst[0]}else{i=await this.app.vocabApi.getAnnotatedSampleData({terms:this.twLst,termsPerRequest:30});this.sites=i.lst.map((t=>({label:i.refs.bySampleId[t.sample].label,value:t.sample})));if(!this.settings.site)this.settings.site=i.lst[0].sample;this.sampleData=i.samples[Number(this.settings.site)]}e.unshift({label:"Site",type:"dropdown",chartType:t,options:this.sites,settingsKey:"site",callback:t=>this.setSite(t)})}}}setFilterValue(t,e){const i=this.config;this.settings[t]=e;if(this.type!="profileRadarFacility")this.settings.site="";i.filter=this.getFilter();this.app.dispatch({type:"plot_edit",id:this.id,config:this.config})}setRegion(t){const e=this.config;this.settings[e.regionTW.term.id]=t;this.clearFiltersExcept([e.regionTW.term.id]);e.filter=this.getFilter();this.app.dispatch({type:"plot_edit",id:this.id,config:e})}clearFiltersExcept(t){for(const e of this.config.filterTWs)if(!t.includes(e.term.id))this.settings[e.term.id]="";if(this.config.chartType!="profileRadarFacility")this.settings.site=""}setSite(t){this.settings.site=t;this.sampleData=null;this.app.dispatch({type:"plot_edit",id:this.id,config:this.config})}getFilter(t=null){const e=[];if(t)e.push(t.$id);const i=[];for(const t of this.config.filterTWs)this.processTW(t,this.settings[t.term.id],e,i);const s={type:"tvslst",in:true,join:"and",lst:i};const a=o([this.state.termfilter.filter,s]);return a}processTW(t,e,i,s){if(e&&!i.includes(t.$id))s.push({type:"tvs",tvs:{term:t.term,values:[{key:e}]}})}addFilterLegend(){if(!this.settings.site||this.config.chartType=="profileRadarFacility"){const t=this.config.filterTWs.some((t=>this.settings[t.term.id]));const e=t?"Filters":"No filter applied";this.filterG.attr("font-size","0.9em").append("text").attr("text-anchor","left").style("font-weight","bold").text(`${e} (n=${this.data.lst.length})`).attr("transform",`translate(0, -5)`);for(const t of this.config.filterTWs)this.addFilterLegendItem(t.term.name,this.settings[t.term.id])}if(this.settings.site&&this.config.chartType!="profileRadarFacility"){const t=this.sites.find((t=>t.value==this.settings.site)).label;this.addFilterLegendItem("Facility",t)}}addFilterLegendItem(t,e){if(!e)return;this.filtersCount++;const i=this.filterG.append("g").attr("font-size","0.95em");const s=i.append("text").attr("transform",`translate(0, ${this.filtersCount*22})`).attr("text-anchor","left");s.append("tspan").attr("font-size","bold").text(t);s.append("tspan").text(`: ${e?e:"None"}`)}addEndUserImpressionNote(t){t.attr("font-size","0.9em");let e=t.append("text").attr("transform",`translate(0, 115)`);e.append("tspan").attr("font-weight","bold").text("End-user Impression: ");e.append("tspan").text("It is provided by the local liaison who completed the assessment ");t.append("text").attr("transform",`translate(0, 140)`).text("in consultation with the PHO medical director or directly by the PHO medical director.");t.append("text").attr("transform",`translate(0, 165)`).text("The end-user was asked to rate the current status of the domains and subdomains included.")}addPOCNote(t){t.attr("font-size","0.9em");let e=t.append("text").attr("transform",`translate(0, 115)`);e.append("tspan").attr("font-weight","bold").text("Point of Care (POC) Staff: ");e.append("tspan").text("All members of the assessment team, ");t.append("text").attr("transform",`translate(0, 140)`).text("excluding the Site Coordinator. POC staff provide subjective information based ");t.append("text").attr("transform",`translate(0, 165)`).text("on their experience and perception about service delivery at the PHO facility.")}addLegendItem(t,e,i){const s=this.legendG.append("text").attr("font-size","0.9em").attr("transform",`translate(0, ${i*20})`).attr("text-anchor","left");s.append("tspan").attr("font-weight","bold").text(t);s.append("tspan").text(`: ${e}`)}getDownloadFilename(){this.downloadCount++;let t=`${this.type}${this.downloadCount}.svg`;t=t.split(" ").join("_");return t}getPercentage(t,e=null){if(!t)return null;if(e==null)e=this.settings.isAggregate||this.sampleData==null;if(e){const e=t.maxScore.term?this.data.lst[0]?.[t.maxScore.$id]?.value:t.maxScore;let i=this.data.lst.map((i=>i[t.score.$id]?.value/e*100));i.sort(((t,e)=>t-e));const s=Math.floor(i.length/2);const a=i.length%2!==0?i[s]:(i[s-1]+i[s])/2;return Math.round(a)}else{const e=this.sampleData[t.score.$id]?.value;const i=t.maxScore.term?this.sampleData[t.maxScore.$id]?.value:t.maxScore;const s=e/i*100;return Math.round(s)}}}async function h(t,e){const i=[];t.countryTW={id:"country"};t.regionTW={id:"WHO_region"};t.incomeTW={id:"Income_group"};t.typeTW={id:"FC_TypeofFacility"};t.teachingStatusTW={id:"FC_TeachingFacility"};t.referralStatusTW={id:"FC_ReferralFacility"};t.fundingSourceTW={id:"FC_FundingSrc"};t.hospitalVolumeTW={id:"PO_HospitalVolume"};t.yearOfImplementationTW={id:"Year_implementation"};i.push(...[t.countryTW,t.regionTW,t.incomeTW,t.typeTW,t.teachingStatusTW,t.referralStatusTW,t.fundingSourceTW,t.hospitalVolumeTW,t.yearOfImplementationTW]);await a(i,e.vocabApi);t.filterTWs=i}function c(){return{isAggregate:false,showTable:true}}export{c as getDefaultProfilePlotSettings,h as loadFilterTerms,d as profilePlot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as t,h as s}from"./app-6fb77603.js";import"./termsetting-492eefa7.js";import{getDefaultProfilePlotSettings as o,loadFilterTerms as i,profilePlot as r}from"./profilePlot-4db8ca78.js";import"./tslib.es6-c3c2d88f.js";import"path";import"./svg.download-f4aa48e4.js";import"./FilterRxComp-02e68f1b.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"./controls-268e40e6.js";import"./controls.btns-5bf9e7d7.js";import"./controls.config-2f0fa061.js";import"./recover-299ffdb3.js";import"./FilterStateless-16a33070.js";import"./app-d215327f.js";import"./termInfo-491b10af.js";import"./toggleButtons-c4d6f260.js";import"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.js";class e extends r{constructor(){super();this.type="profileSummary";this.twLst=[]}async init(t){await super.init(t);t.plots.find((t=>t.id===this.id))}async main(){await super.main();await this.setControls();this.plot()}plot(){const t=this.config;this.dom.plotDiv.selectAll("*").remove();const s=1100;const o=600;this.svg=this.dom.plotDiv.append("div").style("display","inline-block").append("svg").attr("width",s).attr("height",o);this.dom.tableDiv=this.dom.plotDiv.append("div").style("display","inline-block").style("vertical-align","top").style("margin-top","45px");this.svg.append("text").attr("transform",`translate(150, ${o-40})`).attr("font-weight","bold").text(t.title);const i=300;const r=280;const e=this.svg.append("g").attr("transform",`translate(${i},${r})`);this.mainG=e;this.legendG=this.svg.append("g").attr("transform",`translate(${i+280}, ${r-200})`);this.filterG=this.svg.append("g").attr("transform",`translate(${i+280},${r-80})`)}}async function a(s,r){try{const e=r.vocabApi.termdbConfig?.chartConfigByType?.profileSummary;if(!e)throw"default config not found in termdbConfig.chartConfigByType.profileSummary";const a=t(structuredClone(e),s);const n=o();a.settings={profileSummary:n,controls:{isOpen:false}};await i(a,r);return a}catch(t){throw`${t} [profileSummary getPlotConfig()]`}}const n=s(e);const p=n;export{p as componentInit,a as getPlotConfig,n as profileSummaryInit};
|