@sjcrh/proteinpaint-client 2.63.0 → 2.63.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/{2dmaf-70c0b6bb.js → 2dmaf-0cabb4a4.js} +1 -1
- package/dist/{ColorScale-b44d51ef.js → ColorScale-9800a609.js} +1 -1
- package/dist/{DEanalysis-b86d0874.js → DEanalysis-567989ff.js} +1 -1
- package/dist/{Disco-16cd51c0.js → Disco-5d1404ce.js} +1 -1
- package/dist/{Disco.UI-a38a12e6.js → Disco.UI-54228bb6.js} +1 -1
- package/dist/{DragControls-0c173a20.js → DragControls-a05737c2.js} +1 -1
- package/dist/{DziViewer-5c2d68e7.js → DziViewer-3f466d90.js} +2 -2
- package/dist/{FilterRxComp-0e75dd8d.js → FilterRxComp-fc769f34.js} +1 -1
- package/dist/{FilterStateless-ad3df967.js → FilterStateless-8f30f856.js} +1 -1
- package/dist/{HicApp-bcf8330c.js → HicApp-aac413df.js} +1 -1
- package/dist/{OrbitControls-c33cf781.js → OrbitControls-8b7f91ca.js} +1 -1
- package/dist/app-59194db0.js +1 -0
- package/dist/{app-f91922b4.js → app-71453429.js} +1 -1
- package/dist/{app-bfce9bf5.js → app-fb676934.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{bam-95f36008.js → bam-e7f6baea.js} +1 -1
- package/dist/{barchart-e2af00a8.js → barchart-ef4874c8.js} +1 -1
- package/dist/{barchart.events-272fd122.js → barchart.events-e24facf7.js} +1 -1
- package/dist/{bars.renderer-f0e5af5a.js → bars.renderer-c46d3f44.js} +1 -1
- package/dist/{block-ec76524e.js → block-4f585abe.js} +1 -1
- package/dist/block.lazyload-6f83d057.js +1 -0
- package/dist/{block.legend-f8cad7e4.js → block.legend-cec87c6f.js} +1 -1
- package/dist/{block.mds-20655637.js → block.mds-f5a11c42.js} +1 -1
- package/dist/{block.mds.cnv-5feb86a0.js → block.mds.cnv-25423c1e.js} +1 -1
- package/dist/{block.mds.expressionrank-c7043f35.js → block.mds.expressionrank-fc1996d5.js} +1 -1
- package/dist/{block.mds.expressionstat-4bf457f3.js → block.mds.expressionstat-45b6bf47.js} +1 -1
- package/dist/{block.mds.geneboxplot-132e5fe6.js → block.mds.geneboxplot-037df46d.js} +1 -1
- package/dist/{block.mds.junction-1f9810df.js → block.mds.junction-00161de6.js} +1 -1
- package/dist/{block.mds.svcnv-094c416f.js → block.mds.svcnv-0c257af4.js} +1 -1
- package/dist/{block.mds.svcnv.share-bb976e02.js → block.mds.svcnv.share-c0b9dfad.js} +1 -1
- package/dist/{block.mds2-7045e32c.js → block.mds2-9009f8d8.js} +1 -1
- package/dist/{block.svg-d8d76ba7.js → block.svg-86bbfcb0.js} +1 -1
- package/dist/{block.tk.aicheck-317d04bd.js → block.tk.aicheck-a5697794.js} +1 -1
- package/dist/{block.tk.ase-d1577ec1.js → block.tk.ase-ad1be47c.js} +1 -1
- package/dist/{block.tk.bam-3cdc13a0.js → block.tk.bam-14339d16.js} +1 -1
- package/dist/{block.tk.bedgraphdot-5304e06c.js → block.tk.bedgraphdot-efe19e56.js} +1 -1
- package/dist/{block.tk.bigwig.ui-0c96dce5.js → block.tk.bigwig.ui-a92f286b.js} +1 -1
- package/dist/{block.tk.hicstraw-39d89269.js → block.tk.hicstraw-57fbbe61.js} +1 -1
- package/dist/{block.tk.junction-b45b3a95.js → block.tk.junction-64c39cd5.js} +1 -1
- package/dist/{block.tk.junction.textmatrixui-6ec019e1.js → block.tk.junction.textmatrixui-09e5e02f.js} +1 -1
- package/dist/{block.tk.ld-5c54e58b.js → block.tk.ld-f681d099.js} +1 -1
- package/dist/{block.tk.menu-30a2c3a5.js → block.tk.menu-2563364c.js} +1 -1
- package/dist/{block.tk.pgv-7ff2dfaf.js → block.tk.pgv-9dfc00c0.js} +1 -1
- package/dist/{boxplot-7de25274.js → boxplot-a2e1ace0.js} +1 -1
- package/dist/brainImaging-21701238.js +1 -0
- package/dist/{brush-db0ed33a.js → brush-bb4566a3.js} +1 -1
- package/dist/{categorical-bc309399.js → categorical-a00f4ffc.js} +1 -1
- package/dist/{condition-f0eb2343.js → condition-2034db37.js} +1 -1
- package/dist/{controls-8d4972c8.js → controls-0467d2ec.js} +1 -1
- package/dist/{controls.btns-bad9e4cf.js → controls.btns-ad7b28a2.js} +1 -1
- package/dist/{controls.config-e0f394cb.js → controls.config-6cf816fb.js} +1 -1
- package/dist/{controls.divide-d8ac5a9b.js → controls.divide-3c0d52d7.js} +1 -1
- package/dist/{controls.overlay-3ac8773d.js → controls.overlay-3a55c2ec.js} +1 -1
- package/dist/{controls.term1-008f4be4.js → controls.term1-59f4cd60.js} +1 -1
- package/dist/cuminc-8d21132b.js +1 -0
- package/dist/{customdata.inputui-58cd9b32.js → customdata.inputui-40ba6d7f.js} +1 -1
- package/dist/{dataDownload-91da6dd6.js → dataDownload-bfa92dad.js} +1 -1
- package/dist/{databrowser.ui-c50862e4.js → databrowser.ui-4799f04d.js} +1 -1
- package/dist/{density-7c3f91eb.js → density-4c2b53f6.js} +1 -1
- package/dist/{dictionary-48a38837.js → dictionary-89e860ee.js} +1 -1
- package/dist/{drag-c354e2c6.js → drag-88d451b4.js} +1 -1
- package/dist/{e2pca-3bba91fa.js → e2pca-8a3f2566.js} +1 -1
- package/dist/{ep-144d8973.js → ep-5399c5cc.js} +1 -1
- package/dist/{fusion.parse-ae1253f4.js → fusion.parse-fc25e5bd.js} +1 -1
- package/dist/{geneExpClustering-96d09008.js → geneExpClustering-a916ebda.js} +1 -1
- package/dist/{geneExpression-d6494fd3.js → geneExpression-501e95c0.js} +1 -1
- package/dist/{geneExpression-9ca2da4f.js → geneExpression-9047481a.js} +1 -1
- package/dist/{geneExpression-be9b5da2.js → geneExpression-da4b50f0.js} +1 -1
- package/dist/{geneORA-85850143.js → geneORA-ffb2497e.js} +1 -1
- package/dist/{geneVariant-3df05e0c.js → geneVariant-7ab521d6.js} +1 -1
- package/dist/{geneVariant-3d674865.js → geneVariant-d79431a2.js} +1 -1
- package/dist/{genefusion.ui-3e2a3a73.js → genefusion.ui-3ce190c7.js} +1 -1
- package/dist/{geneset-3b761b2c.js → geneset-3522bcda.js} +1 -1
- package/dist/{genomeBrowser-2105a98f.js → genomeBrowser-9b72eb22.js} +1 -1
- package/dist/{genomeBrowser.controls-f9b9bf42.js → genomeBrowser.controls-bef8bf99.js} +1 -1
- package/dist/{groupsetting-4901d033.js → groupsetting-574ad150.js} +1 -1
- package/dist/{hierCluster-a7ff7f5a.js → hierCluster-3b14b2b3.js} +1 -1
- package/dist/{hierCluster.config-3d124abf.js → hierCluster.config-f8686a30.js} +1 -1
- package/dist/{hierCluster.interactivity-3463cc0b.js → hierCluster.interactivity-3b5f1e81.js} +1 -1
- package/dist/{hierCluster.renderers-668d0075.js → hierCluster.renderers-9f9a7cad.js} +1 -1
- package/dist/{html.legend-3e428f9e.js → html.legend-ef8066dd.js} +1 -1
- package/dist/{imagePlot-6d89200c.js → imagePlot-095b9a92.js} +1 -1
- package/dist/{lasso-393c1570.js → lasso-ef63631b.js} +1 -1
- package/dist/{launch.adhoc-9c59874e.js → launch.adhoc-1b356f97.js} +1 -1
- package/dist/{legacyDataset-26ead9cc.js → legacyDataset-056e9d4c.js} +1 -1
- package/dist/{log-4d74231e.js → log-ca1e2a74.js} +1 -1
- package/dist/{lollipop-59f65024.js → lollipop-6ad9ec3c.js} +1 -1
- package/dist/{maf-72e5b7da.js → maf-dfada1c8.js} +1 -1
- package/dist/{maftimeline-ed8aaae8.js → maftimeline-1b715a01.js} +1 -1
- package/dist/{matrix-3d09a31f.js → matrix-3fae58f8.js} +1 -1
- package/dist/matrix.cells-3620eb3a.js +1 -0
- package/dist/{matrix.cluster-acdfc6a7.js → matrix.cluster-15b8a865.js} +1 -1
- package/dist/{matrix.config-cd01ebbd.js → matrix.config-8247bea5.js} +1 -1
- package/dist/{matrix.controls-86eb8d5c.js → matrix.controls-dea65894.js} +1 -1
- package/dist/{matrix.data-e2d7ac16.js → matrix.data-121a1a8c.js} +1 -1
- package/dist/{matrix.dom-e5f91cc0.js → matrix.dom-83c5fa39.js} +1 -1
- package/dist/{matrix.groups-f1969b5c.js → matrix.groups-2e1202ef.js} +1 -1
- package/dist/{matrix.interactivity-92bc8332.js → matrix.interactivity-2b076155.js} +1 -1
- package/dist/{matrix.layout-29a8f334.js → matrix.layout-8dc54c05.js} +1 -1
- package/dist/{matrix.legend-8c28039e.js → matrix.legend-e0078739.js} +1 -1
- package/dist/matrix.renderers-0c8eddc9.js +1 -0
- package/dist/{matrix.serieses-e079f04a.js → matrix.serieses-2898da6b.js} +1 -1
- package/dist/{matrix.sort-e1f83454.js → matrix.sort-249d4a35.js} +1 -1
- package/dist/{matrix.sorterUi-2025f39d.js → matrix.sorterUi-d26208c8.js} +1 -1
- package/dist/{mavb-37fffd68.js → mavb-9a6fa2e9.js} +1 -1
- package/dist/{mds.fimo-68f0eaf5.js → mds.fimo-ce97371c.js} +1 -1
- package/dist/{mds.samplescatterplot-362f3591.js → mds.samplescatterplot-a54b9e93.js} +1 -1
- package/dist/{mds.survivalplot-f5bda05a.js → mds.survivalplot-c5093f73.js} +1 -1
- package/dist/{mdsjsonform-7f0b6cc7.js → mdsjsonform-09b4e1cb.js} +1 -1
- package/dist/metaboliteIntensity-eeb5ad12.js +1 -0
- package/dist/niceNumLabels-ddb76164.js +1 -0
- package/dist/{nodrag-777a34a5.js → nodrag-bed2488c.js} +1 -1
- package/dist/{numeric-2eb8c25b.js → numeric-d5536b1c.js} +1 -1
- package/dist/numeric.binary-d67da945.js +1 -0
- package/dist/numeric.continuous-9a0c88bc.js +1 -0
- package/dist/numeric.discrete-921f7097.js +1 -0
- package/dist/numeric.spline-649308d5.js +1 -0
- package/dist/{numeric.toggle-5316211b.js → numeric.toggle-52789fd2.js} +1 -1
- package/dist/{oncomatrix-cd9fa01b.js → oncomatrix-6950c48c.js} +1 -1
- package/dist/{parseData-1bfa9946.js → parseData-480d1ff3.js} +1 -1
- package/dist/{plot.2dvaf-1ed153c1.js → plot.2dvaf-1ecc4bbc.js} +1 -1
- package/dist/plot.app-c841507a.js +1 -0
- package/dist/{plot.barplot-61742e94.js → plot.barplot-24140b0f.js} +1 -1
- package/dist/{plot.boxplot-fe966ac3.js → plot.boxplot-87fe8ab2.js} +1 -1
- package/dist/{plot.brainImaging-d2c23bb7.js → plot.brainImaging-325ebded.js} +1 -1
- package/dist/{plot.disco-70d493f4.js → plot.disco-621d1b8e.js} +1 -1
- package/dist/{plot.dzi-14e6fdc4.js → plot.dzi-3a7e478e.js} +1 -1
- package/dist/{plot.ssgq-9d364d41.js → plot.ssgq-1949c207.js} +1 -1
- package/dist/{plot.vaf2cov-4d28015b.js → plot.vaf2cov-d03c6409.js} +1 -1
- package/dist/{profileBarchart-c104f8e2.js → profileBarchart-11755d7c.js} +1 -1
- package/dist/{profileHome-a555583d.js → profileHome-9c5e266b.js} +1 -1
- package/dist/{profilePlot-5ce5b6a0.js → profilePlot-8ee3034a.js} +1 -1
- package/dist/{profilePolar-610213d4.js → profilePolar-9fe70c32.js} +1 -1
- package/dist/{profileRadar-fddb18f7.js → profileRadar-0e744181.js} +1 -1
- package/dist/{profileRadarFacility-2c2db1dd.js → profileRadarFacility-102544c5.js} +1 -1
- package/dist/{recover-a08c8d01.js → recover-b1ec4fed.js} +1 -1
- package/dist/{regression.inputs-5718cf72.js → regression.inputs-ad548745.js} +1 -1
- package/dist/{regression.inputs.values.table-d587c1cf.js → regression.inputs.values.table-1618447a.js} +1 -1
- package/dist/{regression.results-748024be.js → regression.results-25008028.js} +1 -1
- package/dist/{renderPvalueTable-c435aefd.js → renderPvalueTable-46056189.js} +1 -1
- package/dist/sampleScatter-47dd82cb.js +1 -0
- package/dist/{sampleScatter.interactivity-e9c30652.js → sampleScatter.interactivity-cfa3451d.js} +1 -1
- package/dist/{sampleScatter.rendererThree-3e6c032e.js → sampleScatter.rendererThree-c5321d24.js} +2 -2
- package/dist/{sampleView-d6a91293.js → sampleView-30b97c7d.js} +1 -1
- package/dist/{samplelst-821ec148.js → samplelst-2bdc1b9d.js} +1 -1
- package/dist/{samplematrix-7aa0a780.js → samplematrix-4f0ec523.js} +1 -1
- package/dist/{scatter-2e2c76f4.js → scatter-8a337eeb.js} +1 -1
- package/dist/{selectGenomeWithTklst-51cd21a4.js → selectGenomeWithTklst-895106fb.js} +1 -1
- package/dist/{singleCellPlot-c7347a27.js → singleCellPlot-360eaec6.js} +1 -1
- package/dist/{singlecell-a668bb17.js → singlecell-29c1cbb1.js} +1 -1
- package/dist/{singlecell-7c851ef8.js → singlecell-75f8af89.js} +1 -1
- package/dist/{snplocus-fe6f4ba1.js → snplocus-0cafa73c.js} +1 -1
- package/dist/{snplst-751cea95.js → snplst-2284d5ce.js} +1 -1
- package/dist/{spliceevent.a53ss.diagram-b157f95d.js → spliceevent.a53ss.diagram-44ccabf9.js} +1 -1
- package/dist/{spliceevent.exonskip.diagram-071a3467.js → spliceevent.exonskip.diagram-c8d1bdf0.js} +1 -1
- package/dist/spliceevent.exonskip.getdefault-9fe16119.js +1 -0
- package/dist/{spliceevent.noeventdiagram-1c731f35.js → spliceevent.noeventdiagram-5e244090.js} +1 -1
- package/dist/{spliceevent.phrase-7a3bfb00.js → spliceevent.phrase-186eb050.js} +1 -1
- package/dist/{stattable-a7713026.js → stattable-886f7dad.js} +1 -1
- package/dist/{style.gdc-40ec2784.js → style.gdc-4ac9b96b.js} +1 -1
- package/dist/{summary-592d8f81.js → summary-ee2045a5.js} +1 -1
- package/dist/{sunburst-452df940.js → sunburst-bbff8818.js} +1 -1
- package/dist/survival-04e279f8.js +1 -0
- package/dist/{survival-450b6df4.js → survival-d7bd3c6b.js} +1 -1
- package/dist/{svg.download-56529955.js → svg.download-54c99186.js} +1 -1
- package/dist/{svg.legend-c82b153f.js → svg.legend-28652faa.js} +1 -1
- package/dist/{svgraph-3c5cd8d2.js → svgraph-a12d89da.js} +1 -1
- package/dist/{svmr-3dd531ef.js → svmr-248055c8.js} +1 -1
- package/dist/{table-d6c411fd.js → table-1dae543a.js} +1 -1
- package/dist/{table-bf604c50.js → table-b4a61573.js} +1 -1
- package/dist/{termInfo-96285f4a.js → termInfo-4c759483.js} +1 -1
- package/dist/{termsetting-9a7511e6.js → termsetting-636d2271.js} +1 -1
- package/dist/{tk-6a8e5bb0.js → tk-741d4674.js} +1 -1
- package/dist/{tp.ui-221efed6.js → tp.ui-23151bb1.js} +1 -1
- package/dist/{tvs.density-9fdae0cc.js → tvs.density-9fe0c7fd.js} +1 -1
- package/dist/{tvs.geneVariant-149e25b7.js → tvs.geneVariant-1b179327.js} +1 -1
- package/dist/tvs.numeric-b4cfc975.js +1 -0
- package/dist/{tvs.samplelst-a38e9c2b.js → tvs.samplelst-681358bc.js} +1 -1
- package/dist/{uiUtils-a6de7f14.js → uiUtils-74700a01.js} +1 -1
- package/dist/{variantBrowser-05375469.js → variantBrowser-910b4bcd.js} +1 -1
- package/dist/{vcf-58904308.js → vcf-16ba1e06.js} +1 -1
- package/dist/{violin-c1b78717.js → violin-a41b2e2b.js} +1 -1
- package/dist/{violin.interactivity-534d6993.js → violin.interactivity-bcf0ccc2.js} +1 -1
- package/dist/{violin.renderer-16540fb8.js → violin.renderer-149310eb.js} +1 -1
- package/dist/{violinRenderer-688abcb2.js → violinRenderer-71c9f3ab.js} +1 -1
- package/dist/{viridis-d3cf2713.js → viridis-81de7bcd.js} +1 -1
- package/dist/{y-2d48b9e4.js → y-76c7da8c.js} +1 -1
- package/dist/{zoom-2d4ede33.js → zoom-a40839cf.js} +1 -1
- package/package.json +7 -7
- package/dist/app-de19f41c.js +0 -1
- package/dist/block.lazyload-ebd949e4.js +0 -1
- package/dist/brainImaging-007edaa3.js +0 -1
- package/dist/cuminc-72257faf.js +0 -1
- package/dist/matrix.cells-a5157233.js +0 -1
- package/dist/matrix.renderers-3b8dfd04.js +0 -1
- package/dist/metaboliteIntensity-512257f3.js +0 -1
- package/dist/niceNumLabels-8fdc6507.js +0 -1
- package/dist/numeric.binary-0a3b17d2.js +0 -1
- package/dist/numeric.continuous-f77038de.js +0 -1
- package/dist/numeric.discrete-b977e88f.js +0 -1
- package/dist/numeric.spline-d64b1abe.js +0 -1
- package/dist/plot.app-91a1d78d.js +0 -1
- package/dist/sampleScatter-031f47de.js +0 -1
- package/dist/spliceevent.exonskip.getdefault-93feb627.js +0 -1
- package/dist/survival-6a4c4f12.js +0 -1
- package/dist/tvs.numeric-f9ce58bc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as t,az as e,l as r}from"./app-
|
|
1
|
+
import{aS as t,az as e,l as r}from"./app-71453429.js";import{a as o}from"./termsetting-636d2271.js";import{getDefaultProfilePlotSettings as a,loadFilterTerms as s,profilePlot as n}from"./profilePlot-8ee3034a.js";import{d as i}from"./axis-6cb4f314.js";import"path";import"./FilterRxComp-fc769f34.js";import"./table-1dae543a.js";import"./svg.download-54c99186.js";import"./controls-0467d2ec.js";import"./controls.btns-ad7b28a2.js";import"./controls.config-6cf816fb.js";import"./controls.overlay-3a55c2ec.js";import"./controls.term1-59f4cd60.js";import"./controls.divide-3c0d52d7.js";import"./recover-b1ec4fed.js";import"./FilterStateless-8f30f856.js";import"./app-fb676934.js";import"./termInfo-4c759483.js";let p=500;const c=400;class l extends n{constructor(){super();this.type="profileBarchart"}async init(t){await super.init(t);const e=t.plots.find((t=>t.id===this.id));this.componentNames=e.plotByComponent.map((t=>({value:t.component.name,label:t.component.name})));this.componentInput={label:"Component",type:"dropdown",chartType:"profileBarchart",options:this.componentNames,settingsKey:"component",callback:t=>this.setComponent(t)}}setComponent(t){this.settings.component=t;this.app.dispatch({type:"plot_edit",id:this.id,config:this.config})}async main(){await super.main();this.configComponent=this.config.plotByComponent.find((t=>t.component.name==this.settings.component))||this.config.plotByComponent[0];this.twLst=[];this.rowCount=0;for(const t of this.configComponent.groups)for(const e of t.rows){this.rowCount++;if(e.term1){this.twLst.push(e.term1.score);this.twLst.push(e.term1.maxScore)}if(e.term2){this.twLst.push(e.term2.score);this.twLst.push(e.term2.maxScore)}}await this.setControls([this.componentInput]);this.component=this.settings.component||this.componentNames[0].value;this.plot()}onMouseOut(t){if(t.target.tagName=="rect"&&t.target.getAttribute("fill-opacity")==.3){const e=t.target;e.setAttribute("fill-opacity",0)}}onMouseOver(t){if(t.target.tagName=="rect"&&t.target.getAttribute("fill-opacity")==0){const e=t.target;e.setAttribute("fill-opacity",.3)}}plot(){const t=this.config;this.dom.plotDiv.selectAll("*").remove();const e=this.configComponent.hasSubjectiveData;const o=1400;const a=this.rowCount*32+600;this.svg=this.dom.plotDiv.append("svg").attr("width",o).attr("height",a);const s=this.state.dslabel=="ProfileAbbrev"?`Score-based Results for the ${this.component} Component by Module and Domain Compared with End-User Impression`:`Objective and Subjective Score-Based Results for the ${this.component} Component by Module and Domain`;this.svg.append("text").attr("transform",`translate(50, 30)`).attr("font-weight","bold").text(s);const n=this.svg;const l=this.configComponent.component.color;this.svg.append("defs").append("pattern").attr("id",`${this.id}_diagonalHatch`).attr("patternUnits","userSpaceOnUse").attr("width",4).attr("height",4).append("path").attr("d","M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2").attr("stroke-width",1).attr("stroke","gray");let m;let d;let h=30;for(const[r,o]of t.columnNames.entries()){if(r==1&&!e)break;m=r%2==0?400:900;m+=10;d=70;n.append("text").attr("transform",`translate(${m}, ${d})`).attr("text-anchor","start").style("font-weight","bold").text(o);g(m,d+30);m+=p}d=70;for(const t of this.configComponent.groups){n.append("text").attr("transform",`translate(${50}, ${d+40})`).attr("text-anchor","start").text(`${t.label}`).style("font-weight","bold");d+=h+20;for(const r of t.rows){const t=n.append("g");t.append("rect").attr("transform",`translate(${20}, ${d-6})`).attr("x",0).attr("y",0).attr("width",e?1500:850).attr("height",30).attr("fill","#f8d335").attr("fill-opacity",0);m=400;if(r.term1)this.drawRect(m,d,r,"term1",t);if(r.term2)this.drawRect(m+p,d,r,"term2",t);d+=h}}u(410,120,50,d,"B");u(410,120,75,d,"A");this.legendG=this.svg.append("g").attr("transform",`translate(${50},${d+60})`);this.filterG=this.svg.append("g").attr("transform",`translate(${50},${d+180})`);this.legendG.append("text").attr("text-anchor","left").style("font-weight","bold").text("Overall Score").attr("transform",`translate(0, -5)`);this.addLegendItem("A","More than 75% of possible scorable items",1);this.addLegendItem("B","50-75% of possible scorable items",2);this.addLegendItem("C","Less than 50% of possible scorable items",3);this.addFilterLegend();if(this.state.dslabel=="ProfileAbbrev"){const t=this.legendG.append("g").attr("transform",`translate(420, 0)`);this.addEndUserImpressionNote(t)}if(!e)return;u(910,120,50,d,"B");u(910,120,75,d,"A");d+=40;m=600;const f=n.append("g");this.drawLegendRect(m,d,"and",l,f);m+=300;this.drawLegendRect(m,d,"or",l,f);function g(t,e){const o=r().domain([0,100]).range([0,c]);n.append("g").attr("transform",`translate(${t}, ${e})`).call(i(o))}function u(t,e,r,o,a){const s=t+r/100*c;n.append("line").style("stroke","#aaa").style("stroke-width",1).style("stroke-dasharray","5, 5").attr("x1",s).attr("y1",e).attr("x2",s).attr("y2",o);n.append("text").attr("transform",`translate(${s+.125*c}, ${o+20})`).attr("text-anchor","middle").text(a).style("font-weight","bold");if(r==50)n.append("text").attr("transform",`translate(${s-.25*c}, ${o+20})`).attr("text-anchor","middle").text("C").style("font-weight","bold")}}drawRect(t,e,r,o,a){const s=this.configComponent.hasSubjectiveData;const n=r[o];let i=false;if((r.name=="Total Module"||r.name=="End-user Impression*")&&!r.term2)i=true;const l=n.score.term.color;const m=this.getPercentage(n);const d=o=="term1"||o=="term2"&&!r.term1;const h=o=="term1"?this.getPercentage(r.term2):this.getPercentage(r.term1);const f=m?m/100*c:0;if(m){const r=a.append("rect").attr("transform",`translate(${t+10}, ${e})`).attr("pointer-events","none").attr("x",0).attr("y",0).attr("width",f).attr("height",20);if(!i&&(h||!s))r.attr("fill",l);else{const t=this.id+n.score.term.id;a.append("defs").append("pattern").attr("id",t).attr("patternUnits","userSpaceOnUse").attr("width",4).attr("height",4).append("path").attr("d","M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2").attr("stroke-width",1).attr("stroke",l);r.attr("fill",`url(#${t})`)}}const g=a.append("text").attr("pointer-events","none").attr("text-anchor","end").text(`${m||0}%`);if(f>0)g.attr("transform",`translate(${t+f+55}, ${e+15})`);else if(!h&&o=="term1")g.attr("transform",`translate(${t+35}, ${e+15})`);if(d)a.append("text").attr("transform",`translate(${o=="term1"?t:t-p}, ${e+15})`).attr("text-anchor","end").text(r.name).attr("pointer-events","none")}drawLegendRect(t,e,r,o,a){const s=a.append("g").attr("transform",`translate(${t}, ${e})`).append("rect").attr("x",0).attr("y",0).attr("width",20).attr("height",20);if(r=="and")s.attr("fill","gray");else s.attr("fill",`url(#${this.id}_diagonalHatch)`);const n=this.svg.append("text").attr("transform",`translate(${t+25}, ${e+15})`).attr("text-anchor","start").text("Objective ");n.append("tspan").attr("font-weight","bold").text(r);n.append("tspan").text(" Subjective data")}}async function m(e,r){try{const n=r.vocabApi.termdbConfig?.chartConfigByType?.profileBarchart;if(!n)throw"default config not found in termdbConfig.chartConfigByType.profileBarchart";const i=t(structuredClone(n),e);const p=a();i.settings={profileBarchart:p,controls:{isOpen:true}};const c=[];for(const t of i.plotByComponent){t.hasSubjectiveData=false;for(const e of t.groups)for(const r of e.rows){if(r.term1){r.term1.score.q=r.term1.maxScore.q={mode:"continuous"};c.push(r.term1.score);c.push(r.term1.maxScore)}if(r.term2){r.term2.score.q=r.term2.maxScore.q={mode:"continuous"};c.push(r.term2.score);c.push(r.term2.maxScore)}if(r.term1&&r.term2)t.hasSubjectiveData=true}}await o(c,r.vocabApi);await s(i,r);return i}catch(t){throw`${t} [profileBarchart getPlotConfig()]`}}const d=e(l);const h=d;function f(){return{}}export{h as componentInit,f as getDefaultProfileBarchartSettings,m as getPlotConfig,d as profileBarchartInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as e}from"./app-
|
|
1
|
+
import{q as e}from"./app-71453429.js";function t(t){const o=e(t.holder);o.append("img").attr("src","images/Button_Full_Version.png").attr("width","15%").on("click",(e=>a(o,"ProfileFull")));o.append("img").attr("src","images/Button_Abbreviated_Version.png").attr("width","15%").on("click",(e=>a(o,"ProfileAbbrev")))}async function a(t,a){t.selectAll("*").remove();const n=e(document.getElementById("aaa"));n.selectAll("*").remove();const i={holder:n,state:{nav:{header_mode:"hidden"},vocab:{dslabel:a,genome:"hg38"}}};const l=await import("./app-59194db0.js");const p=await l.appInit(i);const c=window.location.search;const d=new URLSearchParams(c);const s=d.get("isLoggedIn");const h=d.get("site");o(t,p,a,s,h);r(p,"profilePolar","Polar Graph",false,s,h)}function o(e,t,o,i,l){const p=e.append("div").style("display","inline-flex").style("gap","5px");p.append("button").text(o=="ProfileFull"?"Abbreviated PrOFILE":"Full PrOFILE").on("click",(t=>o=="ProfileFull"?a(e,"ProfileAbbrev"):a(e,"ProfileFull")));p.append("button").text("Polar Graph").on("click",(e=>r(t,"profilePolar","Polar Graph",c.node().checked,i,l)));p.append("button").text("Bar Graph").on("click",(e=>r(t,"profileBarchart","Bar Graph",c.node().checked,i,l)));if(i)p.append("button").text("Radar Graph 1").on("click",(e=>n(t,"profileRadarFacility","Radar Graph 1","plot1",c.node().checked,i,l)));if(i)p.append("button").text("Radar Graph 2").on("click",(e=>n(t,"profileRadar","Radar Graph 2","plot1",c.node().checked,i,l)));if(o=="ProfileFull"&&i)p.append("button").text("Radar Graph 3").on("click",(e=>n(t,"profileRadar","Radar Graph 3","plot2",c.node().checked,i,l)));p.append("label").attr("for","preservePlots").text("Preserve Plots");const c=p.append("input").attr("id","preservePlots").attr("type","checkbox")}async function r(e,t,a,o,r,n){if(!o)await i(e);await e.dispatch({type:"plot_create",config:{chartType:t,header:a,isLoggedIn:r,site:n}})}async function n(e,t,a,o,r,n,l){if(!r)await i(e);await e.dispatch({type:"plot_create",config:{chartType:t,plot:o,header:a,isLoggedIn:n,site:l}})}async function i(e){for(const t of e.getState().plots){await e.dispatch({type:"plot_delete",id:t.id})}}export{t as init};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./svg.download-56529955.js";import{q as e,M as i}from"./app-f91922b4.js";import{c as s}from"./FilterRxComp-0e75dd8d.js";import{controlsInit as a}from"./controls-8d4972c8.js";import{a as o}from"./termsetting-9a7511e6.js";import{l as n}from"./recover-a08c8d01.js";import"./table-d6c411fd.js";import"./controls.btns-bad9e4cf.js";import"./controls.config-e0f394cb.js";import"./controls.overlay-3ac8773d.js";import"path";import"./controls.term1-008f4be4.js";import"./controls.divide-d8ac5a9b.js";import"./FilterStateless-ad3df967.js";import"./app-bfce9bf5.js";import"./termInfo-96285f4a.js";const l=["Low income","Lower middle income","Upper middle income","High income"];const r=["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 h{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,isLoggedIn:e.isLoggedIn,site:e.site}}async init(t){const s=t.plots.find((t=>t.id===this.id));if(this.opts.header){const t=s.isLoggedIn?s.site?s.site:"Admin":"Public";this.opts.header.text(s.header?s.header:s.chartType+` / ${t}`)}const a=this.opts.holder.append("div");const o=a.append("div");const n=a.append("div");const l=n.insert("div").style("display","inline-block").style("font-size","0.8em");const r=n.insert("div").style("display","inline-block");const h=r.append("div");this.dom={controlsDiv:l,holder:r,plotDiv:h,holder2:o};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(s.site){if(Object.keys(this.sampleidmap).length==0)throw"You must login to view site info";const t=this.sampleidmap[s.site]?.id;if(!t)throw"Invalid site"}this.tip=new i({padding:"4px",offsetX:10,offsetY:15});document.addEventListener("scroll",(t=>this?.tip?.hide()))}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.settings.show2Plots){if(!this.plotAdded)await this.addPlot()}else{if(this.plotAdded)this.dom.holder2.selectAll("*").remove();this.plotAdded=false}}async addPlot(){this.plotAdded=true;const t=this.state;const e=await import("./plot.app-91a1d78d.js");const i={chartType:this.type};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=l.indexOf(t.value);const s=l.indexOf(e.value);if(i<s)return-1;return 1}));this.hospitalVolumes.sort(((t,e)=>{const i=r.indexOf(t.value);const s=r.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 o=this.type;this.dom.controlsDiv.selectAll("*").remove();let n=[];if(this.state.isLoggedIn&&this.state.site&&o!="profileRadarFacility"){const t={label:"Data",type:"radio",chartType:o,settingsKey:"isAggregate",options:[{label:this.state.site,value:false},{label:"Aggregate",value:true}]};n.push(t)}if(!this.state.isLoggedIn||!this.state.site||this.settings.isAggregate||o=="profileRadarFacility"){n.push(...[{label:"Region",type:"dropdown",chartType:o,options:this.regions,settingsKey:this.config.regionTW.term.id,callback:t=>this.setRegion(t)},{label:"Country",type:"dropdown",chartType:o,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:o,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:o,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:o,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:o,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:o,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:o,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:o,options:this.yearsOfImplementation,settingsKey:this.config.yearOfImplementationTW.term.id,callback:t=>this.setFilterValue(this.config.yearOfImplementationTW.term.id,t)}])}await this.loadSampleData(o,n);if(o!="profileRadarFacility")n.push({label:"Add plot",type:"checkbox",chartType:o,settingsKey:"show2Plots",boxLabel:"Yes"});n.unshift(...e);if(this.type=="profilePolar")n.push({label:"Show table",type:"checkbox",chartType:o,settingsKey:"showTable",boxLabel:"Yes"});this.components={controls:await a({app:this.app,id:this.id,holder:this.dom.controlsDiv,inputs:n})};if(this.state.isLoggedIn)this.components.controls.on(`downloadClick.${o}`,(()=>t(this.svg,this.getDownloadFilename(),this.dom.holder.node())));this.components.controls.on(`helpClick.${o}`,(()=>{let t;if(this.state.dslabel=="ProfileAbbrev"){if(o=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-abbr-profiledash.pdf";else if(o=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-abbr-profiledash.pdf";else if(o.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(o=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-full-profiledash.pdf";else if(o=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-full-profiledash.pdf";else if(o.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.isLoggedIn){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.isLoggedIn){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:n(parseInt(t))});this.sampleData=i.samples[Number(this.settings.site)]}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;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 a={type:"tvslst",in:true,join:"and",lst:i};const o=s([this.state.termfilter.filter,a]);return o}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]));this.filterG.attr("font-size","0.9em").append("text").attr("text-anchor","left").style("font-weight","bold").text(t?"Filters":"No filter applied").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.8em");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.8em");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 in consultation");t.append("text").attr("transform",`translate(0, 140)`).text("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 for this module.")}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.component?this.component:""}${this.settings[this.config.regionTW.term.id]}${this.settings[this.config.countryTW.term.id]}${this.settings[this.config.incomeTW.term.id]}${this.settings[this.config.typeTW.term.id]}${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 d(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 o(i,e.vocabApi);t.filterTWs=i}function p(){return{show2Plots:false,isAggregate:false}}export{p as getDefaultProfilePlotSettings,d as loadFilterTerms,h as profilePlot};
|
|
1
|
+
import{d as t}from"./svg.download-54c99186.js";import{q as e,M as i}from"./app-71453429.js";import{c as s}from"./FilterRxComp-fc769f34.js";import{controlsInit as a}from"./controls-0467d2ec.js";import{a as o}from"./termsetting-636d2271.js";import{l as n}from"./recover-b1ec4fed.js";import"./table-1dae543a.js";import"./controls.btns-ad7b28a2.js";import"./controls.config-6cf816fb.js";import"./controls.overlay-3a55c2ec.js";import"path";import"./controls.term1-59f4cd60.js";import"./controls.divide-3c0d52d7.js";import"./FilterStateless-8f30f856.js";import"./app-fb676934.js";import"./termInfo-4c759483.js";const l=["Low income","Lower middle income","Upper middle income","High income"];const r=["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 h{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,isLoggedIn:e.isLoggedIn,site:e.site}}async init(t){const s=t.plots.find((t=>t.id===this.id));if(this.opts.header){const t=s.isLoggedIn?s.site?s.site:"Admin":"Public";this.opts.header.text(s.header?s.header:s.chartType+` / ${t}`)}const a=this.opts.holder.append("div");const o=a.append("div");const n=a.append("div");const l=n.insert("div").style("display","inline-block").style("font-size","0.8em");const r=n.insert("div").style("display","inline-block");const h=r.append("div");this.dom={controlsDiv:l,holder:r,plotDiv:h,holder2:o};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(s.site){if(Object.keys(this.sampleidmap).length==0)throw"You must login to view site info";const t=this.sampleidmap[s.site]?.id;if(!t)throw"Invalid site"}this.tip=new i({padding:"4px",offsetX:10,offsetY:15});document.addEventListener("scroll",(t=>this?.tip?.hide()))}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.settings.show2Plots){if(!this.plotAdded)await this.addPlot()}else{if(this.plotAdded)this.dom.holder2.selectAll("*").remove();this.plotAdded=false}}async addPlot(){this.plotAdded=true;const t=this.state;const e=await import("./plot.app-c841507a.js");const i={chartType:this.type};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=l.indexOf(t.value);const s=l.indexOf(e.value);if(i<s)return-1;return 1}));this.hospitalVolumes.sort(((t,e)=>{const i=r.indexOf(t.value);const s=r.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 o=this.type;this.dom.controlsDiv.selectAll("*").remove();let n=[];if(this.state.isLoggedIn&&this.state.site&&o!="profileRadarFacility"){const t={label:"Data",type:"radio",chartType:o,settingsKey:"isAggregate",options:[{label:this.state.site,value:false},{label:"Aggregate",value:true}]};n.push(t)}if(!this.state.isLoggedIn||!this.state.site||this.settings.isAggregate||o=="profileRadarFacility"){n.push(...[{label:"Region",type:"dropdown",chartType:o,options:this.regions,settingsKey:this.config.regionTW.term.id,callback:t=>this.setRegion(t)},{label:"Country",type:"dropdown",chartType:o,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:o,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:o,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:o,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:o,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:o,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:o,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:o,options:this.yearsOfImplementation,settingsKey:this.config.yearOfImplementationTW.term.id,callback:t=>this.setFilterValue(this.config.yearOfImplementationTW.term.id,t)}])}await this.loadSampleData(o,n);if(o!="profileRadarFacility")n.push({label:"Add plot",type:"checkbox",chartType:o,settingsKey:"show2Plots",boxLabel:"Yes"});n.unshift(...e);if(this.type=="profilePolar")n.push({label:"Show table",type:"checkbox",chartType:o,settingsKey:"showTable",boxLabel:"Yes"});this.components={controls:await a({app:this.app,id:this.id,holder:this.dom.controlsDiv,inputs:n})};if(this.state.isLoggedIn)this.components.controls.on(`downloadClick.${o}`,(()=>t(this.svg,this.getDownloadFilename(),this.dom.holder.node())));this.components.controls.on(`helpClick.${o}`,(()=>{let t;if(this.state.dslabel=="ProfileAbbrev"){if(o=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-abbr-profiledash.pdf";else if(o=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-abbr-profiledash.pdf";else if(o.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(o=="profileBarchart")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/bar-graph-full-profiledash.pdf";else if(o=="profilePolar")t="https://global.stjude.org/content/dam/global/en-us/documents/no-index/polar-graph-full-profiledash.pdf";else if(o.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.isLoggedIn){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.isLoggedIn){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:n(parseInt(t))});this.sampleData=i.samples[Number(this.settings.site)]}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;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 a={type:"tvslst",in:true,join:"and",lst:i};const o=s([this.state.termfilter.filter,a]);return o}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]));this.filterG.attr("font-size","0.9em").append("text").attr("text-anchor","left").style("font-weight","bold").text(t?"Filters":"No filter applied").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.8em");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.8em");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 in consultation");t.append("text").attr("transform",`translate(0, 140)`).text("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 for this module.")}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.component?this.component:""}${this.settings[this.config.regionTW.term.id]}${this.settings[this.config.countryTW.term.id]}${this.settings[this.config.incomeTW.term.id]}${this.settings[this.config.typeTW.term.id]}${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 d(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 o(i,e.vocabApi);t.filterTWs=i}function p(){return{show2Plots:false,isAggregate:false}}export{p as getDefaultProfilePlotSettings,d as loadFilterTerms,h as profilePlot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as t,az as e}from"./app-
|
|
1
|
+
import{aS as t,az as e}from"./app-71453429.js";import{a as s}from"./termsetting-636d2271.js";import{getDefaultProfilePlotSettings as o,loadFilterTerms as r,profilePlot as a}from"./profilePlot-8ee3034a.js";import{r as i}from"./table-1dae543a.js";import{d as n}from"./arc-3d6751aa.js";import"path";import"./FilterRxComp-fc769f34.js";import"./svg.download-54c99186.js";import"./controls-0467d2ec.js";import"./controls.btns-ad7b28a2.js";import"./controls.config-6cf816fb.js";import"./controls.overlay-3a55c2ec.js";import"./controls.term1-59f4cd60.js";import"./controls.divide-3c0d52d7.js";import"./recover-b1ec4fed.js";import"./FilterStateless-8f30f856.js";import"./app-fb676934.js";import"./termInfo-4c759483.js";import"./constant-426a1483.js";import"./math-2fb199c6.js";class l extends a{constructor(){super();this.type="profilePolar";this.radius=250}async init(t){await super.init(t);const e=t.plots.find((t=>t.id===this.id));this.twLst=[];for(const[t,s]of e.terms.entries()){this.twLst.push(s.score);this.twLst.push(s.maxScore)}this.arcGenerator=n().innerRadius(0)}async main(){await super.main();await this.setControls();this.angle=Math.PI*2/this.config.terms.length;this.plot()}onMouseOut(t){if(t.target.tagName=="path"){const e=t.target;e.setAttribute("stroke","white");if(e.getAttribute("stroke-opacity")==0)e.setAttribute("stroke-opacity",1)}this.tip.hide()}onMouseOver(t){if(t.target.tagName=="path"){const e=t.target;e.setAttribute("stroke-opacity",0);const s=e.__data__;const o=this.tip.clear();const r=this.getPercentage(s);o.d.text(`${s.module} ${r}%`);o.show(t.clientX,t.clientY,true,true)}else this.onMouseOut(t)}plot(){const t=this.config;this.dom.plotDiv.selectAll("*").remove();const e=1100;const s=600;this.svg=this.dom.plotDiv.append("div").style("display","inline-block").append("svg").attr("width",e).attr("height",s);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, ${s-40})`).attr("font-weight","bold").text(t.title);const o=[];const r=[{label:"Color"},{label:"Module"},{label:"Score",align:"center"}];const a=this.radius;const n=300;const l=280;const c=this.svg.append("g").attr("transform",`translate(${n},${l})`);this.polarG=c;this.legendG=this.svg.append("g").attr("transform",`translate(${n+280}, ${l-200})`);this.filterG=this.svg.append("g").attr("transform",`translate(${n+280},${l-80})`);for(let t=0;t<=10;t++)h(t*10);const p=this.angle;let d=0;for(let e of t.terms){const t=e.module;e.i=d;const s=e.score.term.color;const r=this.getPercentage(e);o.push([{color:s,disabled:true},{value:t},{value:r}]);c.append("g").append("path").datum(e).attr("fill",s).attr("stroke","white").attr("d",this.arcGenerator({outerRadius:r/100*a,startAngle:d*p,endAngle:(d+1)*p})).on("click",(t=>this.onMouseOver(t)));d++}if(this.settings.showTable)i({rows:o,columns:r,div:this.dom.tableDiv,showLines:true,resize:true,maxHeight:"70vh"});h(50,"C");h(75,"B");h(100,"A");for(let t=0;t<=10;t++){const e=t*10;c.append("text").attr("transform",`translate(-10, ${-e/100*a+5})`).attr("text-anchor","end").style("font-size","0.8rem").text(`${e}%`).attr("pointer-events","none")}this.legendG.append("text").attr("text-anchor","left").style("font-weight","bold").text("Overall Score").attr("transform",`translate(0, -5)`);this.addLegendItem("A","More than 75% of possible scorable items",1);this.addLegendItem("B","50-75% of possible scorable items",2);this.addLegendItem("C","Less than 50% of possible scorable items",3);this.addFilterLegend();function h(t,e=null){const s=c.append("circle").attr("r",t/100*a).style("fill","none").style("opacity","0.5");if(t!=50)s.style("stroke","#aaa");if(e){if(t!=100)s.style("stroke-dasharray","5, 5").style("stroke-width","2").style("stroke","black");c.append("text").attr("transform",`translate(15, ${-(t/100-.125)*a+10})`).attr("text-anchor","middle").text(e).style("font-weight","bold").style("font-size","24px").attr("pointer-events","none")}}}}async function c(e,a){try{const i=a.vocabApi.termdbConfig?.chartConfigByType?.profilePolar;if(!i)throw"default config not found in termdbConfig.chartConfigByType.profilePolar";const n=t(structuredClone(i),e);const l=o();l.showTable=true;n.settings={profilePolar:l,controls:{isOpen:true}};const c=[];for(const t of n.terms){const e=t.score;const s=t.maxScore;e.q={mode:"continuous"};s.q={mode:"continuous"};c.push(e);c.push(s)}await s(c,a.vocabApi);await r(n,a);return n}catch(t){throw`${t} [profilePolar getPlotConfig()]`}}const p=e(l);const d=p;export{d as componentInit,c as getPlotConfig,p as profilePolarInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as t,az as e}from"./app-
|
|
1
|
+
import{aS as t,az as e}from"./app-71453429.js";import{a as s}from"./termsetting-636d2271.js";import{getDefaultProfilePlotSettings as r,loadFilterTerms as a,profilePlot as o}from"./profilePlot-8ee3034a.js";import{r as n}from"./table-1dae543a.js";import{l as i}from"./line-264f8f9e.js";import"path";import"./FilterRxComp-fc769f34.js";import"./svg.download-54c99186.js";import"./controls-0467d2ec.js";import"./controls.btns-ad7b28a2.js";import"./controls.config-6cf816fb.js";import"./controls.overlay-3a55c2ec.js";import"./controls.term1-59f4cd60.js";import"./controls.divide-3c0d52d7.js";import"./recover-b1ec4fed.js";import"./FilterStateless-8f30f856.js";import"./app-fb676934.js";import"./termInfo-4c759483.js";import"./constant-426a1483.js";class l extends o{constructor(){super();this.type="profileRadar";this.radius=250}async init(t){await super.init(t);t.plots.find((t=>t.id===this.id));this.lineGenerator=i()}async main(){await super.main();this.twLst=[];this.terms=this.config[this.config.plot].terms;for(const t of this.terms){this.rowCount++;this.twLst.push(t.term1.score);if(t.term1.maxScore.id)this.twLst.push(t.term1.maxScore);this.twLst.push(t.term2.score);if(t.term2.maxScore.id)this.twLst.push(t.term2.maxScore)}await this.setControls();this.angle=Math.PI*2/this.terms.length;this.plot()}plot(){const t=this.config;this.dom.plotDiv.selectAll("*").remove();if(this.data.lst.length==0)return;const e=1300;const s=650;this.svg=this.dom.plotDiv.append("div").style("display","inline-block").append("svg").attr("width",e).attr("height",s);this.tableDiv=this.dom.plotDiv.append("div").style("display","inline-block").style("vertical-align","top").style("margin-top","45px");const r=[];const a=[{label:"Module"},{label:t[t.plot].term1.abbrev},{label:t[t.plot].term2.abbrev}];const o=this.radius;const i=370;const l=290;this.svg.append("text").attr("transform",`translate(60, ${s-30})`).attr("font-weight","bold").text(t[t.plot].title);const p=this.svg.append("g").attr("transform",`translate(${i},${l})`);this.polarG=p;this.legendG=this.svg.append("g").attr("transform",`translate(${i+390},${l-200})`);this.filterG=this.svg.append("g").attr("transform",`translate(${i+390},${l})`);for(let t=0;t<=10;t++)this.addPoligon(t*10);let c=0;const d=[],h=[];for(let{module:t,term1:e,term2:s}of this.terms){const a=c*this.angle-Math.PI/2;this.addData("term1",a,c,d);this.addData("term2",a,c,h);r.push([{value:t},{value:this.getPercentage(e)},{value:this.getPercentage(s)}]);c++;const n=a>Math.PI/2&&a<=3/2*Math.PI;let i=o*1.1*Math.cos(a);let l=o*1.1*Math.sin(a)-10;const m=p.append("text").attr("x",`${i}px`).attr("y",`${l}px`);const f=t.split(" ");let g;f.forEach(((t,e)=>{if(t!="and"){l+=15;g=m.append("tspan").attr("x",`${i}px`).attr("y",`${l}px`).text(t+"")}else g.append("tspan").text(" and")}));if(n)m.attr("text-anchor","end")}if(this.settings.showTable)n({rows:r,columns:a,div:this.tableDiv,showLines:true,resize:true,maxHeight:"60vh"});d.push(d[0]);h.push(h[0]);const m="blue",f="gray";p.append("g").append("path").style("stroke",m).attr("fill","none").attr("stroke-width","2px").attr("d",this.lineGenerator(d));p.append("g").append("path").style("stroke",f).attr("fill","none").style("stroke-dasharray","5, 5").attr("stroke-width","2px").attr("d",this.lineGenerator(h));for(let t=0;t<=10;t++){const e=t*10;p.append("text").attr("transform",`translate(-10, ${-e/100*o+5})`).attr("text-anchor","end").style("font-size","0.8rem").text(`${e}%`).attr("pointer-events","none")}this.addFilterLegend();this.legendG.append("text").attr("text-anchor","left").style("font-weight","bold").text(`Legend`);let g=t[t.plot].term1.abbrev?`(${t[t.plot].term1.abbrev})`:"";const u=`${t[t.plot].term1.name} ${g}`;this.addLegendItem(u,m,0,"none");g=t[t.plot].term2.abbrev?`(${t[t.plot].term2.abbrev})`:"";const x=`${t[t.plot].term2.name} ${g}`;this.addLegendItem(x,f,1,"5, 5");if(this.state.dslabel=="ProfileAbbrev")this.addEndUserImpressionNote(this.legendG.append("g").attr("transform",`translate(0, -15)`))}addData(t,e,s,r){const a=this.terms[s];const o=this.getPercentage(a[t]);const n=o/100*this.radius;let i=n*Math.cos(e);let l=n*Math.sin(e);const p=t=="term1"?"blue":"#aaa";const c=this.polarG.append("g").attr("transform",`translate(${i}, ${l})`).append("circle").attr("r",4).attr("fill",p);c.datum({module:a.module,percentage:o}).on("click",(t=>this.onMouseOver(t)));r.push([i,l])}addPoligon(t){const e=[];for(let s=0;s<this.terms.length;s++){const r=s*this.angle-Math.PI/2;const a=t/100*this.radius;const o=a*Math.cos(r);const n=a*Math.sin(r);e.push([o,n])}e.push(e[0]);this.polarG.append("g").append("path").style("stroke","#aaa").attr("fill","none").attr("d",this.lineGenerator(e)).style("opacity","0.5")}addLegendItem(t,e,s,r){const a=25;const o=a+s*a;const n=35;this.legendG.append("path").attr("stroke",e).style("stroke-dasharray",r).attr("stroke-width","2px").attr("d",this.lineGenerator([[0,o-5],[n,o-5]]));this.legendG.append("g").attr("transform",`translate(${0}, ${o-5})`).append("circle").attr("r",4).attr("fill",e);const i=this.legendG.append("text").attr("font-size","0.9em").attr("transform",`translate(${n+5}, ${o})`).attr("text-anchor","left");i.append("tspan").text(t)}onMouseOver(t){if(t.target.tagName=="circle"){const e=t.target;const s=e.__data__;const r=this.tip.clear();const a=s.percentage;r.d.text(`${s.module} ${a}%`);r.show(t.clientX,t.clientY,true,true)}else this.onMouseOut(t)}onMouseOut(t){this.tip.hide()}}async function p(e,o){try{const n=o.vocabApi.termdbConfig?.chartConfigByType?.profileRadar;if(!n)throw"default config not found in termdbConfig.chartConfigByType.profileRadar";let i=t(structuredClone(n),e);const l=r();i.settings={profileRadar:l,controls:{isOpen:true}};const p=i[e.plot].terms;const c=[];for(const t of p){t.term1.score.q={mode:"continuous"};c.push(t.term1.score);if(t.term1.maxScore.id){t.term1.maxScore.q={mode:"continuous"};c.push(t.term1.maxScore)}t.term2.score.q={mode:"continuous"};c.push(t.term2.score);if(t.term2.maxScore.id){t.term2.maxScore.q={mode:"continuous"};c.push(t.term2.maxScore)}}await s(c,o.vocabApi);await a(i,o);return i}catch(t){throw`${t} [profileRadar getPlotConfig()]`}}const c=e(l);const d=c;export{d as componentInit,p as getPlotConfig,c as profileRadarInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aS as t,az as e}from"./app-
|
|
1
|
+
import{aS as t,az as e}from"./app-71453429.js";import{a as s}from"./termsetting-636d2271.js";import{r as a}from"./table-1dae543a.js";import{getDefaultProfilePlotSettings as o,loadFilterTerms as r,profilePlot as i}from"./profilePlot-8ee3034a.js";import{l as n}from"./line-264f8f9e.js";import"path";import"./FilterRxComp-fc769f34.js";import"./svg.download-54c99186.js";import"./controls-0467d2ec.js";import"./controls.btns-ad7b28a2.js";import"./controls.config-6cf816fb.js";import"./controls.overlay-3a55c2ec.js";import"./controls.term1-59f4cd60.js";import"./controls.divide-3c0d52d7.js";import"./recover-b1ec4fed.js";import"./FilterStateless-8f30f856.js";import"./app-fb676934.js";import"./termInfo-4c759483.js";import"./constant-426a1483.js";class l extends i{constructor(){super();this.type="profileRadarFacility";this.radius=250}async init(t){await super.init(t);t.plots.find((t=>t.id===this.id));this.lineGenerator=n()}async main(){await super.main();this.twLst=[];this.terms=this.config[this.config.plot].terms;for(const t of this.terms){this.rowCount++;this.twLst.push(t.score);this.twLst.push(t.maxScore)}await this.setControls();this.angle=Math.PI*2/this.terms.length;this.plot()}plot(){this.dom.plotDiv.selectAll("*").remove();if(this.data.lst.length==0)return;const t=1550;const e=650;this.svg=this.dom.plotDiv.append("div").style("display","inline-block").append("svg").attr("width",t).attr("height",e);this.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(110, ${e-30})`).attr("font-weight","bold").text(this.config[this.config.plot].title);const s=this.radius;const o=370;const r=300;const i=this.svg.append("g").attr("transform",`translate(${o},${r})`);this.polarG=i;this.legendG=this.svg.append("g").attr("transform",`translate(${o+420},${r-180})`);this.filterG=this.svg.append("g").attr("transform",`translate(${o+420},${r+10})`);const n=[];const l=[{label:"Module"},{label:`Facility`},{label:"Global"}];for(let t=0;t<=10;t++)this.addPoligon(t*10);let p=0;const c=[],h=[];for(const t of this.terms){const e=p*this.angle-Math.PI/2;this.addData(e,p,h,true);const a=[{value:t.module},{value:this.getPercentage(t)}];this.addData(e,p,c,false);a.push({value:this.getPercentage(t,true)});n.push(a);p++;const o=e>Math.PI/2&&e<=3/2*Math.PI;let r=s*1.1*Math.cos(e);let l=s*1.1*Math.sin(e)-10;const d=i.append("text").attr("x",`${r}px`).attr("y",`${l}px`);const f=t.module.split(" ");let g;f.forEach(((t,e)=>{if(t!="and"){l+=15;g=d.append("tspan").attr("x",`${r}px`).attr("y",`${l}px`).text(t+"")}else g.append("tspan").text(" and")}));if(o)d.attr("text-anchor","end")}if(this.settings.showTable)a({rows:n,columns:l,div:this.tableDiv,showLines:true,resize:true,maxHeight:"60vh"});c.push(c[0]);h.push(h[0]);const d="gray",f="blue";i.append("g").append("path").style("stroke",d).attr("fill","none").style("stroke-dasharray","5, 5").attr("stroke-width","2px").attr("d",this.lineGenerator(c));if(this.state.isLoggedIn){i.append("g").append("path").style("stroke",f).attr("fill","none").attr("stroke-width","2px").attr("d",this.lineGenerator(h))}for(let t=0;t<=10;t++){const e=t*10;i.append("text").attr("transform",`translate(-10, ${-e/100*s+5})`).attr("text-anchor","end").style("font-size","0.8rem").text(`${e}%`).attr("pointer-events","none")}if(this.state.dslabel=="ProfileAbbrev"){const t=this.legendG.append("g").attr("transform",`translate(0, -15)`);this.addEndUserImpressionNote(t)}this.addFilterLegend();this.legendG.append("text").attr("text-anchor","left").style("font-weight","bold").text("Legend");const g=this.sites.find((t=>t.value==this.settings.site)).label;this.addLegendItem(g,f,0,"none");this.addLegendItem(this.config[this.config.plot].score,d,1,"5, 5")}addData(t,e,s,a){const o=this.terms[e];const r=a?this.getPercentage(o):this.getPercentage(o,true);const i=r/100*this.radius;let n=i*Math.cos(t);let l=i*Math.sin(t);const p=a?"blue":"#aaa";const c=this.polarG.append("g").attr("transform",`translate(${n}, ${l})`).append("circle").attr("r",4).attr("fill",p).on("click",(t=>this.onMouseOver(t)));s.push([n,l]);c.datum({module:o.module,percentage:r})}addPoligon(t){const e=[];for(let s=0;s<this.terms.length;s++){const a=s*this.angle-Math.PI/2;const o=t/100*this.radius;const r=o*Math.cos(a);const i=o*Math.sin(a);e.push([r,i])}e.push(e[0]);this.polarG.append("g").append("path").style("stroke","#aaa").attr("fill","none").attr("d",this.lineGenerator(e)).style("opacity","0.5")}addLegendItem(t,e,s,a){const o=25;const r=o+s*o;const i=35;this.legendG.append("path").attr("stroke",e).style("stroke-dasharray",a).attr("stroke-width","2px").attr("d",this.lineGenerator([[0,r-5],[i,r-5]]));this.legendG.append("g").attr("transform",`translate(${0}, ${r-5})`).append("circle").attr("r",4).attr("fill",e);const n=this.legendG.append("text").attr("font-size","0.9em").attr("transform",`translate(${i+5}, ${r})`).attr("text-anchor","left");n.append("tspan").text(t)}onMouseOver(t){if(t.target.tagName=="circle"){const e=t.target;const s=e.__data__;const a=this.tip.clear();const o=s.percentage;a.d.text(`${s.module} ${o}%`);a.show(t.clientX,t.clientY,true,true)}else this.onMouseOut(t)}onMouseOut(t){this.tip.hide()}}async function p(e,a){try{const i=a.vocabApi.termdbConfig?.chartConfigByType?.profileRadarFacility;if(!i)throw"default config not found in termdbConfig.chartConfigByType.profileRadarFacility";let n=t(structuredClone(i),e);const l=o();n.settings={profileRadarFacility:l,controls:{isOpen:true}};const p=n[e.plot].terms;const c=[];for(const t of p){t.score.q=t.maxScore.q={mode:"continuous"};c.push(t.score);c.push(t.maxScore)}await s(c,a.vocabApi);await r(n,a);return n}catch(t){throw`${t} [profileRadarFacility getPlotConfig()]`}}const c=e(l);const h=c;export{h as componentInit,p as getPlotConfig,c as profileRadarFacilityInit};
|