@sjcrh/proteinpaint-client 2.76.2 → 2.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/{2dmaf-f240211f.js → 2dmaf-acb8cfdd.js} +1 -1
  2. package/dist/{AppHeader-c9432a24.js → AppHeader-315dbd3a.js} +1 -1
  3. package/dist/{ColorScale-b991fc9e.js → ColorScale-4b4ea8a2.js} +1 -1
  4. package/dist/{DEanalysis-bbfad00d.js → DEanalysis-28ddd620.js} +1 -1
  5. package/dist/{Disco-b7c9bf72.js → Disco-3c427131.js} +1 -1
  6. package/dist/{Disco.UI-a5296c36.js → Disco.UI-b071cf7a.js} +1 -1
  7. package/dist/{DragControls-ca3fa0cf.js → DragControls-7961799c.js} +1 -1
  8. package/dist/{DziViewer-28915c11.js → DziViewer-aa5b5706.js} +1 -1
  9. package/dist/{FilterRxComp-02e68f1b.js → FilterRxComp-e8de560c.js} +1 -1
  10. package/dist/FilterStateless-75514d37.js +1 -0
  11. package/dist/{HicApp-e713aa40.js → HicApp-674a148d.js} +1 -1
  12. package/dist/{OrbitControls-2466d420.js → OrbitControls-58ca2292.js} +1 -1
  13. package/dist/{WSIViewer-957695a8.js → WSIViewer-afe97e2e.js} +1 -1
  14. package/dist/{adSandbox-27d93bc0.js → adSandbox-791d704e.js} +1 -1
  15. package/dist/{app-6fb77603.js → app-3d14cbe4.js} +1 -1
  16. package/dist/app-8b5b982a.js +1 -0
  17. package/dist/{app-d215327f.js → app-bd9f016b.js} +1 -1
  18. package/dist/app.js +1 -1
  19. package/dist/{bam-d67e5315.js → bam-fa90bae8.js} +1 -1
  20. package/dist/{barchart-2898d229.js → barchart-e3dcfc5f.js} +1 -1
  21. package/dist/{barchart.events-426d737a.js → barchart.events-cecb7bf5.js} +1 -1
  22. package/dist/{bars.renderer-71935d34.js → bars.renderer-58e38632.js} +1 -1
  23. package/dist/{block-75d4ff92.js → block-944afb9f.js} +1 -1
  24. package/dist/block.lazyload-4c4e81ff.js +1 -0
  25. package/dist/{block.legend-93d85a6e.js → block.legend-3dbc41a8.js} +1 -1
  26. package/dist/{block.mds-84b9d1c1.js → block.mds-b3967ce5.js} +1 -1
  27. package/dist/{block.mds.cnv-a991ed79.js → block.mds.cnv-6de3115e.js} +1 -1
  28. package/dist/{block.mds.expressionrank-33b858de.js → block.mds.expressionrank-553613e8.js} +1 -1
  29. package/dist/{block.mds.expressionstat-3093599f.js → block.mds.expressionstat-2c396bb9.js} +1 -1
  30. package/dist/{block.mds.geneboxplot-b8391d18.js → block.mds.geneboxplot-552fe571.js} +1 -1
  31. package/dist/{block.mds.junction-69708c7f.js → block.mds.junction-1e25c13d.js} +1 -1
  32. package/dist/{block.mds.svcnv-322baea6.js → block.mds.svcnv-462d762d.js} +1 -1
  33. package/dist/{block.mds.svcnv.share-c5c38237.js → block.mds.svcnv.share-766e4b22.js} +1 -1
  34. package/dist/{block.mds2-de4811dd.js → block.mds2-6e04432d.js} +1 -1
  35. package/dist/{block.svg-ac9fec2d.js → block.svg-40b47da8.js} +1 -1
  36. package/dist/{block.tk.aicheck-ac4b8d4d.js → block.tk.aicheck-cc42cbaf.js} +1 -1
  37. package/dist/{block.tk.ase-6dc0f9f1.js → block.tk.ase-da848c5f.js} +1 -1
  38. package/dist/{block.tk.bam-8f68b41d.js → block.tk.bam-8053c97e.js} +1 -1
  39. package/dist/{block.tk.bedgraphdot-d8878860.js → block.tk.bedgraphdot-79cb0faf.js} +1 -1
  40. package/dist/{block.tk.bigwig.ui-f6ed051c.js → block.tk.bigwig.ui-a8decec7.js} +1 -1
  41. package/dist/{block.tk.hicstraw-725bdc8a.js → block.tk.hicstraw-3d1e9d41.js} +1 -1
  42. package/dist/{block.tk.junction-f8b0b51d.js → block.tk.junction-81eae755.js} +1 -1
  43. package/dist/{block.tk.junction.textmatrixui-252e7d7e.js → block.tk.junction.textmatrixui-4c45b69a.js} +1 -1
  44. package/dist/{block.tk.ld-11acf730.js → block.tk.ld-997fca31.js} +1 -1
  45. package/dist/{block.tk.menu-5e04436d.js → block.tk.menu-d3e7ccbb.js} +1 -1
  46. package/dist/{block.tk.pgv-fef17dc4.js → block.tk.pgv-ae1d1f59.js} +1 -1
  47. package/dist/{boxplot-4c9a5479.js → boxplot-fed0a86b.js} +1 -1
  48. package/dist/{brainImaging-7716bc66.js → brainImaging-b455fd0c.js} +1 -1
  49. package/dist/{brush-9faa7ae7.js → brush-06989a5e.js} +1 -1
  50. package/dist/{categorical-1dea48ba.js → categorical-82722704.js} +1 -1
  51. package/dist/{condition-ebac4f75.js → condition-f68cc8d1.js} +1 -1
  52. package/dist/{controls-268e40e6.js → controls-1d99916a.js} +1 -1
  53. package/dist/{controls.btns-5bf9e7d7.js → controls.btns-237b3154.js} +1 -1
  54. package/dist/{controls.config-2f0fa061.js → controls.config-00ce9f0b.js} +1 -1
  55. package/dist/{cuminc-8dffb765.js → cuminc-879690b0.js} +1 -1
  56. package/dist/{customdata.inputui-b229d3a0.js → customdata.inputui-c563c695.js} +1 -1
  57. package/dist/{dataDownload-452ae3cd.js → dataDownload-087ac205.js} +1 -1
  58. package/dist/databrowser.ui-9f98f6b3.js +1 -0
  59. package/dist/{density-09feb0c9.js → density-e0aff1d0.js} +1 -1
  60. package/dist/{dictionary-a132a3cc.js → dictionary-fe0ea1d6.js} +1 -1
  61. package/dist/{drag-2e9c80bb.js → drag-e11d6644.js} +1 -1
  62. package/dist/{e2pca-4f1648e3.js → e2pca-b3250d5c.js} +1 -1
  63. package/dist/{ep-1d4c58b4.js → ep-9ca01df0.js} +1 -1
  64. package/dist/{facet-fa4fe49c.js → facet-397afad5.js} +1 -1
  65. package/dist/{fusion.parse-7dfd6988.js → fusion.parse-e5312047.js} +1 -1
  66. package/dist/{geneExpClustering-ed9121b8.js → geneExpClustering-4383ff2c.js} +1 -1
  67. package/dist/{geneExpression-394672ff.js → geneExpression-2422f66b.js} +1 -1
  68. package/dist/{geneExpression-66208299.js → geneExpression-52678025.js} +1 -1
  69. package/dist/{geneExpression-c61e8f1c.js → geneExpression-cfb86b5d.js} +1 -1
  70. package/dist/{geneORA-9456872c.js → geneORA-81220ec0.js} +1 -1
  71. package/dist/{geneVariant-beaf9adb.js → geneVariant-18f9591a.js} +1 -1
  72. package/dist/{geneVariant-f17cda85.js → geneVariant-4d22b146.js} +1 -1
  73. package/dist/{genefusion.ui-9238ec7f.js → genefusion.ui-e38778dd.js} +1 -1
  74. package/dist/{genesearch-ffd88bf2.js → genesearch-0587c713.js} +1 -1
  75. package/dist/{geneset-0315daf8.js → geneset-604d0529.js} +1 -1
  76. package/dist/{genomeBrowser-608b924e.js → genomeBrowser-9f0e8a60.js} +1 -1
  77. package/dist/{genomeBrowser.controls-2601cab5.js → genomeBrowser.controls-204f007e.js} +1 -1
  78. package/dist/{groupsetting-e3a4ecd5.js → groupsetting-53dfd5e5.js} +1 -1
  79. package/dist/{gsea-0c0cf8de.js → gsea-a1b04406.js} +1 -1
  80. package/dist/{hierCluster-7ab62ca5.js → hierCluster-edaaacc5.js} +1 -1
  81. package/dist/{hierCluster.config-f4daaf92.js → hierCluster.config-a84f69a3.js} +1 -1
  82. package/dist/{hierCluster.interactivity-7f475259.js → hierCluster.interactivity-dd917fd3.js} +1 -1
  83. package/dist/{hierCluster.renderers-19b79639.js → hierCluster.renderers-4d33e96a.js} +1 -1
  84. package/dist/{html.legend-80b2b3ec.js → html.legend-6807e9ad.js} +1 -1
  85. package/dist/{imagePlot-1ef24562.js → imagePlot-f96cdc61.js} +1 -1
  86. package/dist/{lasso-1a02a545.js → lasso-845446b8.js} +1 -1
  87. package/dist/launch.adhoc-cb00917b.js +1 -0
  88. package/dist/leftlabel.sample-3a6037c2.js +1 -0
  89. package/dist/legacyDataset-c9bab1e6.js +1 -0
  90. package/dist/{log-c26b6cfd.js → log-0ea548ec.js} +1 -1
  91. package/dist/{lollipop-3aebe5d3.js → lollipop-75e11e9a.js} +1 -1
  92. package/dist/{maf-c439c851.js → maf-e4af10d7.js} +1 -1
  93. package/dist/{maftimeline-0da64e54.js → maftimeline-cc2e866c.js} +1 -1
  94. package/dist/{matrix-38cd47c3.js → matrix-8b3341c4.js} +1 -1
  95. package/dist/{matrix.cells-a018d731.js → matrix.cells-4dd055e7.js} +1 -1
  96. package/dist/{matrix.cluster-a6e713e8.js → matrix.cluster-7ab94fb5.js} +1 -1
  97. package/dist/{matrix.config-2c550b5d.js → matrix.config-b3b56456.js} +1 -1
  98. package/dist/{matrix.controls-42ad4912.js → matrix.controls-6e0e9692.js} +1 -1
  99. package/dist/{matrix.data-2b814c9f.js → matrix.data-baabaf57.js} +1 -1
  100. package/dist/{matrix.dom-1e0da5b3.js → matrix.dom-cb1f4872.js} +1 -1
  101. package/dist/{matrix.groups-824a7244.js → matrix.groups-9990aade.js} +1 -1
  102. package/dist/{matrix.interactivity-1cb56534.js → matrix.interactivity-3f3cf44d.js} +1 -1
  103. package/dist/{matrix.layout-47e44357.js → matrix.layout-50bc2ea5.js} +1 -1
  104. package/dist/{matrix.legend-9af0c757.js → matrix.legend-024e2d50.js} +1 -1
  105. package/dist/{matrix.renderers-337ce240.js → matrix.renderers-1aed44e5.js} +1 -1
  106. package/dist/{matrix.serieses-7b7184c9.js → matrix.serieses-dc18fcc2.js} +1 -1
  107. package/dist/{matrix.sort-1ac05842.js → matrix.sort-89b98e83.js} +1 -1
  108. package/dist/{matrix.sorterUi-1c60c145.js → matrix.sorterUi-0ad98ef0.js} +1 -1
  109. package/dist/{mavb-da8d1a0a.js → mavb-b2dd74f6.js} +1 -1
  110. package/dist/{mds.fimo-8604c3f8.js → mds.fimo-f19840cd.js} +1 -1
  111. package/dist/{mds.samplescatterplot-3f09ae0e.js → mds.samplescatterplot-254f1de6.js} +1 -1
  112. package/dist/{mds.survivalplot-1d8f2b7e.js → mds.survivalplot-f440db10.js} +1 -1
  113. package/dist/{metaboliteIntensity-bbb23c76.js → metaboliteIntensity-4d905d93.js} +1 -1
  114. package/dist/niceNumLabels-ef07b7ad.js +1 -0
  115. package/dist/{nodrag-b2737073.js → nodrag-f6c0801c.js} +1 -1
  116. package/dist/{notify-0cb8904f.js → notify-da3afe99.js} +1 -1
  117. package/dist/{numeric-24dacbee.js → numeric-1d0318e8.js} +1 -1
  118. package/dist/{numeric.binary-f382cc98.js → numeric.binary-88bf9e0d.js} +1 -1
  119. package/dist/numeric.continuous-d27197cf.js +1 -0
  120. package/dist/{numeric.discrete-ed10bbc1.js → numeric.discrete-b826f33b.js} +1 -1
  121. package/dist/{numeric.spline-a35cfbf0.js → numeric.spline-b3968b77.js} +1 -1
  122. package/dist/{numeric.toggle-2f98d6e5.js → numeric.toggle-ab8b79be.js} +1 -1
  123. package/dist/{oncomatrix-c0b2d635.js → oncomatrix-5f4326a8.js} +1 -1
  124. package/dist/{parseData-292648dd.js → parseData-62083461.js} +1 -1
  125. package/dist/{plot.2dvaf-6ae22dc1.js → plot.2dvaf-eccd8ef3.js} +1 -1
  126. package/dist/plot.app-4dc30ebc.js +1 -0
  127. package/dist/plot.barplot-331715f6.js +1 -0
  128. package/dist/{plot.boxplot-87ac2ce9.js → plot.boxplot-0c538ebe.js} +1 -1
  129. package/dist/{plot.brainImaging-32a484b6.js → plot.brainImaging-ee3a0272.js} +1 -1
  130. package/dist/{plot.disco-1fdfee3c.js → plot.disco-c9249cbd.js} +1 -1
  131. package/dist/{plot.dzi-e3d0f610.js → plot.dzi-dfd72ddf.js} +1 -1
  132. package/dist/{plot.ssgq-d33113d5.js → plot.ssgq-b5f68395.js} +1 -1
  133. package/dist/{plot.vaf2cov-9f4f1776.js → plot.vaf2cov-4081decd.js} +1 -1
  134. package/dist/{plot.wsi-dea124a7.js → plot.wsi-f6325d95.js} +1 -1
  135. package/dist/{profileBarchart-58f0a8c0.js → profileBarchart-f4da0483.js} +1 -1
  136. package/dist/{profileHome-7f404152.js → profileHome-11b7d146.js} +1 -1
  137. package/dist/{profilePlot-4db8ca78.js → profilePlot-5dd1fe71.js} +1 -1
  138. package/dist/{profilePolar-50b8e40e.js → profilePolar-996784ad.js} +1 -1
  139. package/dist/{profileRadar-fff0b004.js → profileRadar-79299186.js} +1 -1
  140. package/dist/{profileRadarFacility-d6d34c15.js → profileRadarFacility-00e31213.js} +1 -1
  141. package/dist/{profileSummary-04b8b15b.js → profileSummary-df75e6ff.js} +1 -1
  142. package/dist/{recover-299ffdb3.js → recover-4888c2a9.js} +1 -1
  143. package/dist/{regression.inputs-14df7c31.js → regression.inputs-e647b716.js} +1 -1
  144. package/dist/{regression.inputs.values.table-d79efa9e.js → regression.inputs.values.table-b283619d.js} +1 -1
  145. package/dist/{regression.results-4767144e.js → regression.results-f61b4a25.js} +1 -1
  146. package/dist/{renderPvalueTable-002cc8ff.js → renderPvalueTable-0ed37e90.js} +1 -1
  147. package/dist/sampleScatter-b96546e9.js +1 -0
  148. package/dist/{sampleScatter.rendererThree-ef289434.js → sampleScatter.rendererThree-aa51e3c8.js} +2 -2
  149. package/dist/{sampleView-1dff3fca.js → sampleView-e4819da2.js} +1 -1
  150. package/dist/{samplelst-d2db0f24.js → samplelst-9d9ff205.js} +1 -1
  151. package/dist/{samplematrix-0841387f.js → samplematrix-3556e5c0.js} +1 -1
  152. package/dist/{scatter-f8285107.js → scatter-ff17f653.js} +1 -1
  153. package/dist/select2Terms-eb437c2a.js +1 -0
  154. package/dist/{selectGenomeWithTklst-9af86d31.js → selectGenomeWithTklst-84f4ff79.js} +1 -1
  155. package/dist/shapes-21ebfec4.js +1 -0
  156. package/dist/{singleCellCellType-fd1606b8.js → singleCellCellType-a2ce9bfa.js} +1 -1
  157. package/dist/{singleCellGeneExpression-537f1157.js → singleCellGeneExpression-a2b45c7a.js} +1 -1
  158. package/dist/{singleCellPlot-eff5760b.js → singleCellPlot-e7e57b0f.js} +1 -1
  159. package/dist/{singlecell-38336cbc.js → singlecell-63cb06d8.js} +1 -1
  160. package/dist/{singlecell-87b4b9a9.js → singlecell-a5b8a39b.js} +1 -1
  161. package/dist/snp-41aa88d1.js +1 -0
  162. package/dist/{snp-b81ef740.js → snp-6e312b4c.js} +1 -1
  163. package/dist/snplocus-0653ba82.js +1 -0
  164. package/dist/{spliceevent.a53ss.diagram-5f8352eb.js → spliceevent.a53ss.diagram-aa2df5d7.js} +1 -1
  165. package/dist/{spliceevent.exonskip.diagram-0d30a735.js → spliceevent.exonskip.diagram-0b792984.js} +1 -1
  166. package/dist/spliceevent.exonskip.getdefault-af1943e3.js +1 -0
  167. package/dist/{spliceevent.noeventdiagram-df9ce4bc.js → spliceevent.noeventdiagram-e6e29a6e.js} +1 -1
  168. package/dist/{spliceevent.phrase-a8401d53.js → spliceevent.phrase-5f65a5f4.js} +1 -1
  169. package/dist/{stattable-46cde32c.js → stattable-775a5af5.js} +1 -1
  170. package/dist/{style.gdc-72d730f2.js → style.gdc-519a42d8.js} +1 -1
  171. package/dist/summary-5866c75f.js +1 -0
  172. package/dist/{sunburst-fe95832e.js → sunburst-f928bfd2.js} +1 -1
  173. package/dist/survival-10dd3d28.js +1 -0
  174. package/dist/{survival-52714cd3.js → survival-405514f6.js} +1 -1
  175. package/dist/{svg.download-f4aa48e4.js → svg.download-cd895635.js} +1 -1
  176. package/dist/{svg.legend-749348e0.js → svg.legend-812ea603.js} +1 -1
  177. package/dist/{svgraph-b46f1f92.js → svgraph-037fd7b6.js} +1 -1
  178. package/dist/{svmr-9a76c6d4.js → svmr-3bd143c3.js} +1 -1
  179. package/dist/{table-0daf2b89.js → table-be2a9975.js} +1 -1
  180. package/dist/{table-bf40249b.js → table-e013d8fc.js} +1 -1
  181. package/dist/{termInfo-491b10af.js → termInfo-e16f90f2.js} +1 -1
  182. package/dist/termdb.bins-a60aaa77.js +1 -0
  183. package/dist/{termsetting-492eefa7.js → termsetting-7467350f.js} +1 -1
  184. package/dist/tk-25ae65c4.js +1 -0
  185. package/dist/{toggleButtons-c4d6f260.js → toggleButtons-2144daab.js} +1 -1
  186. package/dist/{tp.ui-0a476325.js → tp.ui-38bc5890.js} +1 -1
  187. package/dist/{tvs.density-034b506d.js → tvs.density-060d3006.js} +1 -1
  188. package/dist/{tvs.geneVariant-c59c8b54.js → tvs.geneVariant-f99fe353.js} +1 -1
  189. package/dist/{tvs.numeric-aa1f892f.js → tvs.numeric-d9108473.js} +1 -1
  190. package/dist/{tvs.samplelst-515f27b9.js → tvs.samplelst-3b8ee998.js} +1 -1
  191. package/dist/{uiUtils-ea7dfea2.js → uiUtils-57f4b1ba.js} +1 -1
  192. package/dist/{variantBrowser-14d5c3f6.js → variantBrowser-56ebc7e1.js} +1 -1
  193. package/dist/{vcf-d357ce08.js → vcf-e43b533a.js} +1 -1
  194. package/dist/{violin-74d26b75.js → violin-1352dab2.js} +1 -1
  195. package/dist/{violin.interactivity-bf40ddde.js → violin.interactivity-2502dcd8.js} +1 -1
  196. package/dist/{violin.renderer-469fa0ff.js → violin.renderer-4273257d.js} +1 -1
  197. package/dist/{violinRenderer-14fa200d.js → violinRenderer-7f46e468.js} +1 -1
  198. package/dist/{viridis-cc59f478.js → viridis-87a8b605.js} +1 -1
  199. package/dist/{y-59cbff5e.js → y-cac91178.js} +1 -1
  200. package/dist/{zoom-f445cfef.js → zoom-001c2f01.js} +1 -1
  201. package/package.json +1 -1
  202. package/dist/FilterStateless-16a33070.js +0 -1
  203. package/dist/app-42f69951.js +0 -1
  204. package/dist/block.lazyload-d2951c91.js +0 -1
  205. package/dist/databrowser.ui-2197fc73.js +0 -1
  206. package/dist/downloadTextfile-5723af95.js +0 -1
  207. package/dist/launch.adhoc-e124c993.js +0 -1
  208. package/dist/leftlabel.sample-59f99ef5.js +0 -1
  209. package/dist/legacyDataset-fbaa5ebb.js +0 -1
  210. package/dist/niceNumLabels-29a7c6ca.js +0 -1
  211. package/dist/numeric.continuous-6feb34a7.js +0 -1
  212. package/dist/plot.app-2a805759.js +0 -1
  213. package/dist/plot.barplot-34841e70.js +0 -1
  214. package/dist/sampleScatter-55d9eb74.js +0 -1
  215. package/dist/select2Terms-d48d037e.js +0 -1
  216. package/dist/snp-f6123244.js +0 -1
  217. package/dist/snplocus-acafb1ba.js +0 -1
  218. package/dist/spliceevent.exonskip.getdefault-237c481c.js +0 -1
  219. package/dist/summary-a6c15c9e.js +0 -1
  220. package/dist/survival-57ff3c03.js +0 -1
  221. package/dist/termdb.bins-39d11f24.js +0 -1
  222. package/dist/tk-ac524564.js +0 -1
@@ -1 +1 @@
1
- import{by as f}from"./app-6fb77603.js";function e(f){var e=f.length;return function(a){return f[Math.max(0,Math.min(e-1,Math.floor(a*e)))]}}e(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));e(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));e(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));var a=e(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));export{a as p};
1
+ import{by as f}from"./app-3d14cbe4.js";function e(f){var e=f.length;return function(a){return f[Math.max(0,Math.min(e-1,Math.floor(a*e)))]}}e(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));e(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));e(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));var a=e(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));export{a as p};
@@ -1 +1 @@
1
- import{bB as n,_ as t}from"./app-6fb77603.js";function r(n){return function(){return n}}function e(n){return(n()-.5)*1e-6}const i=1664525;const f=1013904223;const u=4294967296;function o(){let n=1;return()=>(n=(i*n+f)%u)/u}var a=10,c=Math.PI*(3-Math.sqrt(5));function l(r){var e,i=1,f=.001,u=1-Math.pow(f,1/300),l=0,h=.6,s=new Map,y=n(p),g=t("tick","end"),v=o();if(r==null)r=[];function p(){x();g.call("tick",e);if(i<f){y.stop();g.call("end",e)}}function x(n){var t,f=r.length,o;if(n===undefined)n=1;for(var a=0;a<n;++a){i+=(l-i)*u;s.forEach((function(n){n(i)}));for(t=0;t<f;++t){o=r[t];if(o.fx==null)o.x+=o.vx*=h;else o.x=o.fx,o.vx=0;if(o.fy==null)o.y+=o.vy*=h;else o.y=o.fy,o.vy=0}}return e}function N(){for(var n=0,t=r.length,e;n<t;++n){e=r[n],e.index=n;if(e.fx!=null)e.x=e.fx;if(e.fy!=null)e.y=e.fy;if(isNaN(e.x)||isNaN(e.y)){var i=a*Math.sqrt(.5+n),f=n*c;e.x=i*Math.cos(f);e.y=i*Math.sin(f)}if(isNaN(e.vx)||isNaN(e.vy)){e.vx=e.vy=0}}}function d(n){if(n.initialize)n.initialize(r,v);return n}N();return e={tick:x,restart:function(){return y.restart(p),e},stop:function(){return y.stop(),e},nodes:function(n){return arguments.length?(r=n,N(),s.forEach(d),e):r},alpha:function(n){return arguments.length?(i=+n,e):i},alphaMin:function(n){return arguments.length?(f=+n,e):f},alphaDecay:function(n){return arguments.length?(u=+n,e):+u},alphaTarget:function(n){return arguments.length?(l=+n,e):l},velocityDecay:function(n){return arguments.length?(h=1-n,e):1-h},randomSource:function(n){return arguments.length?(v=n,s.forEach(d),e):v},force:function(n,t){return arguments.length>1?(t==null?s.delete(n):s.set(n,d(t)),e):s.get(n)},find:function(n,t,e){var i=0,f=r.length,u,o,a,c,l;if(e==null)e=Infinity;else e*=e;for(i=0;i<f;++i){c=r[i];u=n-c.x;o=t-c.y;a=u*u+o*o;if(a<e)l=c,e=a}return l},on:function(n,t){return arguments.length>1?(g.on(n,t),e):g.on(n)}}}function h(n){var t=r(.1),e,i,f;if(typeof n!=="function")n=r(n==null?0:+n);function u(n){for(var t=0,r=e.length,u;t<r;++t){u=e[t],u.vx+=(f[t]-u.x)*i[t]*n}}function o(){if(!e)return;var r,u=e.length;i=new Array(u);f=new Array(u);for(r=0;r<u;++r){i[r]=isNaN(f[r]=+n(e[r],r,e))?0:+t(e[r],r,e)}}u.initialize=function(n){e=n;o()};u.strength=function(n){return arguments.length?(t=typeof n==="function"?n:r(+n),o(),u):t};u.x=function(t){return arguments.length?(n=typeof t==="function"?t:r(+t),o(),u):n};return u}function s(n){var t=r(.1),e,i,f;if(typeof n!=="function")n=r(n==null?0:+n);function u(n){for(var t=0,r=e.length,u;t<r;++t){u=e[t],u.vy+=(f[t]-u.y)*i[t]*n}}function o(){if(!e)return;var r,u=e.length;i=new Array(u);f=new Array(u);for(r=0;r<u;++r){i[r]=isNaN(f[r]=+n(e[r],r,e))?0:+t(e[r],r,e)}}u.initialize=function(n){e=n;o()};u.strength=function(n){return arguments.length?(t=typeof n==="function"?n:r(+n),o(),u):t};u.y=function(t){return arguments.length?(n=typeof t==="function"?t:r(+t),o(),u):n};return u}export{r as c,e as j,l as s,h as x,s as y};
1
+ import{bB as n,_ as t}from"./app-3d14cbe4.js";function r(n){return function(){return n}}function e(n){return(n()-.5)*1e-6}const i=1664525;const f=1013904223;const u=4294967296;function o(){let n=1;return()=>(n=(i*n+f)%u)/u}var a=10,c=Math.PI*(3-Math.sqrt(5));function l(r){var e,i=1,f=.001,u=1-Math.pow(f,1/300),l=0,h=.6,s=new Map,y=n(p),g=t("tick","end"),v=o();if(r==null)r=[];function p(){x();g.call("tick",e);if(i<f){y.stop();g.call("end",e)}}function x(n){var t,f=r.length,o;if(n===undefined)n=1;for(var a=0;a<n;++a){i+=(l-i)*u;s.forEach((function(n){n(i)}));for(t=0;t<f;++t){o=r[t];if(o.fx==null)o.x+=o.vx*=h;else o.x=o.fx,o.vx=0;if(o.fy==null)o.y+=o.vy*=h;else o.y=o.fy,o.vy=0}}return e}function N(){for(var n=0,t=r.length,e;n<t;++n){e=r[n],e.index=n;if(e.fx!=null)e.x=e.fx;if(e.fy!=null)e.y=e.fy;if(isNaN(e.x)||isNaN(e.y)){var i=a*Math.sqrt(.5+n),f=n*c;e.x=i*Math.cos(f);e.y=i*Math.sin(f)}if(isNaN(e.vx)||isNaN(e.vy)){e.vx=e.vy=0}}}function d(n){if(n.initialize)n.initialize(r,v);return n}N();return e={tick:x,restart:function(){return y.restart(p),e},stop:function(){return y.stop(),e},nodes:function(n){return arguments.length?(r=n,N(),s.forEach(d),e):r},alpha:function(n){return arguments.length?(i=+n,e):i},alphaMin:function(n){return arguments.length?(f=+n,e):f},alphaDecay:function(n){return arguments.length?(u=+n,e):+u},alphaTarget:function(n){return arguments.length?(l=+n,e):l},velocityDecay:function(n){return arguments.length?(h=1-n,e):1-h},randomSource:function(n){return arguments.length?(v=n,s.forEach(d),e):v},force:function(n,t){return arguments.length>1?(t==null?s.delete(n):s.set(n,d(t)),e):s.get(n)},find:function(n,t,e){var i=0,f=r.length,u,o,a,c,l;if(e==null)e=Infinity;else e*=e;for(i=0;i<f;++i){c=r[i];u=n-c.x;o=t-c.y;a=u*u+o*o;if(a<e)l=c,e=a}return l},on:function(n,t){return arguments.length>1?(g.on(n,t),e):g.on(n)}}}function h(n){var t=r(.1),e,i,f;if(typeof n!=="function")n=r(n==null?0:+n);function u(n){for(var t=0,r=e.length,u;t<r;++t){u=e[t],u.vx+=(f[t]-u.x)*i[t]*n}}function o(){if(!e)return;var r,u=e.length;i=new Array(u);f=new Array(u);for(r=0;r<u;++r){i[r]=isNaN(f[r]=+n(e[r],r,e))?0:+t(e[r],r,e)}}u.initialize=function(n){e=n;o()};u.strength=function(n){return arguments.length?(t=typeof n==="function"?n:r(+n),o(),u):t};u.x=function(t){return arguments.length?(n=typeof t==="function"?t:r(+t),o(),u):n};return u}function s(n){var t=r(.1),e,i,f;if(typeof n!=="function")n=r(n==null?0:+n);function u(n){for(var t=0,r=e.length,u;t<r;++t){u=e[t],u.vy+=(f[t]-u.y)*i[t]*n}}function o(){if(!e)return;var r,u=e.length;i=new Array(u);f=new Array(u);for(r=0;r<u;++r){i[r]=isNaN(f[r]=+n(e[r],r,e))?0:+t(e[r],r,e)}}u.initialize=function(n){e=n;o()};u.strength=function(n){return arguments.length?(t=typeof n==="function"?n:r(+n),o(),u):t};u.y=function(t){return arguments.length?(n=typeof t==="function"?t:r(+t),o(),u):n};return u}export{r as c,e as j,l as s,h as x,s as y};
@@ -1 +1 @@
1
- import{_ as t,N as e,a6 as n,d as o,a0 as i}from"./app-6fb77603.js";import{p as u}from"./pointer-c7475677.js";import{d as r,y as a}from"./nodrag-b2737073.js";var h=1e-12;function s(t){return((t=Math.exp(t))+1/t)/2}function c(t){return((t=Math.exp(t))-1/t)/2}function f(t){return((t=Math.exp(2*t))-1)/(t+1)}var l=function t(e,n,o){function i(t,i){var u=t[0],r=t[1],a=t[2],l=i[0],m=i[1],p=i[2],v=l-u,y=m-r,d=v*v+y*y,g,z;if(d<h){z=Math.log(p/a)/e;g=function(t){return[u+t*v,r+t*y,a*Math.exp(e*t*z)]}}else{var _=Math.sqrt(d),M=(p*p-a*a+o*d)/(2*a*n*_),x=(p*p-a*a-o*d)/(2*p*n*_),w=Math.log(Math.sqrt(M*M+1)-M),b=Math.log(Math.sqrt(x*x+1)-x);z=(b-w)/e;g=function(t){var o=t*z,i=s(w),h=a/(n*_)*(i*f(e*o+w)-c(w));return[u+h*v,r+h*y,a*i/s(e*o+w)]}}g.duration=z*1e3*e/Math.SQRT2;return g}i.rho=function(e){var n=Math.max(.001,+e),o=n*n,i=o*o;return t(n,o,i)};return i}(Math.SQRT2,2,4);var m=t=>()=>t;function p(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:true,configurable:true},sourceEvent:{value:e,enumerable:true,configurable:true},target:{value:n,enumerable:true,configurable:true},transform:{value:o,enumerable:true,configurable:true},_:{value:i}})}function v(t){t.stopImmediatePropagation()}function y(t){t.preventDefault();t.stopImmediatePropagation()}function d(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function g(){var t=this;if(t instanceof SVGElement){t=t.ownerSVGElement||t;if(t.hasAttribute("viewBox")){t=t.viewBox.baseVal;return[[t.x,t.y],[t.x+t.width,t.y+t.height]]}return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}return[[0,0],[t.clientWidth,t.clientHeight]]}function z(){return this.__zoom||e}function _(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function M(){return navigator.maxTouchPoints||"ontouchstart"in this}function x(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],u=t.invertY(e[0][1])-n[0][1],r=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r))}function w(){var h=d,s=g,c=x,f=_,w=M,b=[0,Infinity],T=[[-Infinity,-Infinity],[Infinity,Infinity]],k=250,E=l,I=t("start","zoom","end"),q,V,Y,j=500,B=150,D=0,P=10;function S(t){t.property("__zoom",z).on("wheel.zoom",H,{passive:false}).on("mousedown.zoom",N).on("dblclick.zoom",O).filter(w).on("touchstart.zoom",W).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(t,e,n,o){var i=t.selection?t.selection():t;i.property("__zoom",z);if(t!==i){Q(t,e,n,o)}else{i.interrupt().each((function(){R(this,arguments).event(o).start().zoom(null,typeof e==="function"?e.apply(this,arguments):e).end()}))}};S.scaleBy=function(t,e,n,o){S.scaleTo(t,(function(){var t=this.__zoom.k,n=typeof e==="function"?e.apply(this,arguments):e;return t*n}),n,o)};S.scaleTo=function(t,e,n,o){S.transform(t,(function(){var t=s.apply(this,arguments),o=this.__zoom,i=n==null?G(t):typeof n==="function"?n.apply(this,arguments):n,u=o.invert(i),r=typeof e==="function"?e.apply(this,arguments):e;return c(K(X(o,r),i,u),t,T)}),n,o)};S.translateBy=function(t,e,n,o){S.transform(t,(function(){return c(this.__zoom.translate(typeof e==="function"?e.apply(this,arguments):e,typeof n==="function"?n.apply(this,arguments):n),s.apply(this,arguments),T)}),null,o)};S.translateTo=function(t,n,o,i,u){S.transform(t,(function(){var t=s.apply(this,arguments),u=this.__zoom,r=i==null?G(t):typeof i==="function"?i.apply(this,arguments):i;return c(e.translate(r[0],r[1]).scale(u.k).translate(typeof n==="function"?-n.apply(this,arguments):-n,typeof o==="function"?-o.apply(this,arguments):-o),t,T)}),i,u)};function X(t,e){e=Math.max(b[0],Math.min(b[1],e));return e===t.k?t:new n(e,t.x,t.y)}function K(t,e,o){var i=e[0]-o[0]*t.k,u=e[1]-o[1]*t.k;return i===t.x&&u===t.y?t:new n(t.k,i,u)}function G(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function Q(t,e,o,i){t.on("start.zoom",(function(){R(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){R(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,u=arguments,r=R(t,u).event(i),a=s.apply(t,u),h=o==null?G(a):typeof o==="function"?o.apply(t,u):o,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),f=t.__zoom,l=typeof e==="function"?e.apply(t,u):e,m=E(f.invert(h).concat(c/f.k),l.invert(h).concat(c/l.k));return function(t){if(t===1)t=l;else{var e=m(t),o=c/e[2];t=new n(o,h[0]-e[0]*o,h[1]-e[1]*o)}r.zoom(null,t)}}))}function R(t,e,n){return!n&&t.__zooming||new A(t,e)}function A(t,e){this.that=t;this.args=e;this.active=0;this.sourceEvent=null;this.extent=s.apply(t,e);this.taps=0}A.prototype={event:function(t){if(t)this.sourceEvent=t;return this},start:function(){if(++this.active===1){this.that.__zooming=this;this.emit("start")}return this},zoom:function(t,e){if(this.mouse&&t!=="mouse")this.mouse[1]=e.invert(this.mouse[0]);if(this.touch0&&t!=="touch")this.touch0[1]=e.invert(this.touch0[0]);if(this.touch1&&t!=="touch")this.touch1[1]=e.invert(this.touch1[0]);this.that.__zoom=e;this.emit("zoom");return this},end:function(){if(--this.active===0){delete this.that.__zooming;this.emit("end")}return this},emit:function(t){var e=o(this.that).datum();I.call(t,this.that,new p(t,{sourceEvent:this.sourceEvent,target:S,type:t,transform:this.that.__zoom,dispatch:I}),e)}};function H(t,...e){if(!h.apply(this,arguments))return;var n=R(this,e).event(t),o=this.__zoom,r=Math.max(b[0],Math.min(b[1],o.k*Math.pow(2,f.apply(this,arguments)))),a=u(t);if(n.wheel){if(n.mouse[0][0]!==a[0]||n.mouse[0][1]!==a[1]){n.mouse[1]=o.invert(n.mouse[0]=a)}clearTimeout(n.wheel)}else if(o.k===r)return;else{n.mouse=[a,o.invert(a)];i(this);n.start()}y(t);n.wheel=setTimeout(s,B);n.zoom("mouse",c(K(X(o,r),n.mouse[0],n.mouse[1]),n.extent,T));function s(){n.wheel=null;n.end()}}function N(t,...e){if(Y||!h.apply(this,arguments))return;var n=t.currentTarget,s=R(this,e,true).event(t),f=o(t.view).on("mousemove.zoom",d,true).on("mouseup.zoom",g,true),l=u(t,n),m=t.clientX,p=t.clientY;r(t.view);v(t);s.mouse=[l,this.__zoom.invert(l)];i(this);s.start();function d(t){y(t);if(!s.moved){var e=t.clientX-m,o=t.clientY-p;s.moved=e*e+o*o>D}s.event(t).zoom("mouse",c(K(s.that.__zoom,s.mouse[0]=u(t,n),s.mouse[1]),s.extent,T))}function g(t){f.on("mousemove.zoom mouseup.zoom",null);a(t.view,s.moved);y(t);s.event(t).end()}}function O(t,...e){if(!h.apply(this,arguments))return;var n=this.__zoom,i=u(t.changedTouches?t.changedTouches[0]:t,this),r=n.invert(i),a=n.k*(t.shiftKey?.5:2),f=c(K(X(n,a),i,r),s.apply(this,e),T);y(t);if(k>0)o(this).transition().duration(k).call(Q,f,i,t);else o(this).call(S.transform,f,i,t)}function W(t,...e){if(!h.apply(this,arguments))return;var n=t.touches,o=n.length,r=R(this,e,t.changedTouches.length===o).event(t),a,s,c,f;v(t);for(s=0;s<o;++s){c=n[s],f=u(c,this);f=[f,this.__zoom.invert(f),c.identifier];if(!r.touch0)r.touch0=f,a=true,r.taps=1+!!q;else if(!r.touch1&&r.touch0[2]!==f[2])r.touch1=f,r.taps=0}if(q)q=clearTimeout(q);if(a){if(r.taps<2)V=f[0],q=setTimeout((function(){q=null}),j);i(this);r.start()}}function C(t,...e){if(!this.__zooming)return;var n=R(this,e).event(t),o=t.changedTouches,i=o.length,r,a,h,s;y(t);for(r=0;r<i;++r){a=o[r],h=u(a,this);if(n.touch0&&n.touch0[2]===a.identifier)n.touch0[0]=h;else if(n.touch1&&n.touch1[2]===a.identifier)n.touch1[0]=h}a=n.that.__zoom;if(n.touch1){var f=n.touch0[0],l=n.touch0[1],m=n.touch1[0],p=n.touch1[1],v=(v=m[0]-f[0])*v+(v=m[1]-f[1])*v,d=(d=p[0]-l[0])*d+(d=p[1]-l[1])*d;a=X(a,Math.sqrt(v/d));h=[(f[0]+m[0])/2,(f[1]+m[1])/2];s=[(l[0]+p[0])/2,(l[1]+p[1])/2]}else if(n.touch0)h=n.touch0[0],s=n.touch0[1];else return;n.zoom("touch",c(K(a,h,s),n.extent,T))}function F(t,...e){if(!this.__zooming)return;var n=R(this,e).event(t),i=t.changedTouches,r=i.length,a,h;v(t);if(Y)clearTimeout(Y);Y=setTimeout((function(){Y=null}),j);for(a=0;a<r;++a){h=i[a];if(n.touch0&&n.touch0[2]===h.identifier)delete n.touch0;else if(n.touch1&&n.touch1[2]===h.identifier)delete n.touch1}if(n.touch1&&!n.touch0)n.touch0=n.touch1,delete n.touch1;if(n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else{n.end();if(n.taps===2){h=u(h,this);if(Math.hypot(V[0]-h[0],V[1]-h[1])<P){var s=o(this).on("dblclick.zoom");if(s)s.apply(this,arguments)}}}}S.wheelDelta=function(t){return arguments.length?(f=typeof t==="function"?t:m(+t),S):f};S.filter=function(t){return arguments.length?(h=typeof t==="function"?t:m(!!t),S):h};S.touchable=function(t){return arguments.length?(w=typeof t==="function"?t:m(!!t),S):w};S.extent=function(t){return arguments.length?(s=typeof t==="function"?t:m([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),S):s};S.scaleExtent=function(t){return arguments.length?(b[0]=+t[0],b[1]=+t[1],S):[b[0],b[1]]};S.translateExtent=function(t){return arguments.length?(T[0][0]=+t[0][0],T[1][0]=+t[1][0],T[0][1]=+t[0][1],T[1][1]=+t[1][1],S):[[T[0][0],T[0][1]],[T[1][0],T[1][1]]]};S.constrain=function(t){return arguments.length?(c=t,S):c};S.duration=function(t){return arguments.length?(k=+t,S):k};S.interpolate=function(t){return arguments.length?(E=t,S):E};S.on=function(){var t=I.on.apply(I,arguments);return t===I?S:t};S.clickDistance=function(t){return arguments.length?(D=(t=+t)*t,S):Math.sqrt(D)};S.tapDistance=function(t){return arguments.length?(P=+t,S):P};return S}export{w as d};
1
+ import{_ as t,N as e,a6 as n,d as o,a0 as i}from"./app-3d14cbe4.js";import{p as u}from"./pointer-c7475677.js";import{d as r,y as a}from"./nodrag-f6c0801c.js";var h=1e-12;function s(t){return((t=Math.exp(t))+1/t)/2}function c(t){return((t=Math.exp(t))-1/t)/2}function f(t){return((t=Math.exp(2*t))-1)/(t+1)}var l=function t(e,n,o){function i(t,i){var u=t[0],r=t[1],a=t[2],l=i[0],m=i[1],p=i[2],v=l-u,y=m-r,d=v*v+y*y,g,z;if(d<h){z=Math.log(p/a)/e;g=function(t){return[u+t*v,r+t*y,a*Math.exp(e*t*z)]}}else{var _=Math.sqrt(d),M=(p*p-a*a+o*d)/(2*a*n*_),x=(p*p-a*a-o*d)/(2*p*n*_),w=Math.log(Math.sqrt(M*M+1)-M),b=Math.log(Math.sqrt(x*x+1)-x);z=(b-w)/e;g=function(t){var o=t*z,i=s(w),h=a/(n*_)*(i*f(e*o+w)-c(w));return[u+h*v,r+h*y,a*i/s(e*o+w)]}}g.duration=z*1e3*e/Math.SQRT2;return g}i.rho=function(e){var n=Math.max(.001,+e),o=n*n,i=o*o;return t(n,o,i)};return i}(Math.SQRT2,2,4);var m=t=>()=>t;function p(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:true,configurable:true},sourceEvent:{value:e,enumerable:true,configurable:true},target:{value:n,enumerable:true,configurable:true},transform:{value:o,enumerable:true,configurable:true},_:{value:i}})}function v(t){t.stopImmediatePropagation()}function y(t){t.preventDefault();t.stopImmediatePropagation()}function d(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function g(){var t=this;if(t instanceof SVGElement){t=t.ownerSVGElement||t;if(t.hasAttribute("viewBox")){t=t.viewBox.baseVal;return[[t.x,t.y],[t.x+t.width,t.y+t.height]]}return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}return[[0,0],[t.clientWidth,t.clientHeight]]}function z(){return this.__zoom||e}function _(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function M(){return navigator.maxTouchPoints||"ontouchstart"in this}function x(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],u=t.invertY(e[0][1])-n[0][1],r=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r))}function w(){var h=d,s=g,c=x,f=_,w=M,b=[0,Infinity],T=[[-Infinity,-Infinity],[Infinity,Infinity]],k=250,E=l,I=t("start","zoom","end"),q,V,Y,j=500,B=150,D=0,P=10;function S(t){t.property("__zoom",z).on("wheel.zoom",H,{passive:false}).on("mousedown.zoom",N).on("dblclick.zoom",O).filter(w).on("touchstart.zoom",W).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(t,e,n,o){var i=t.selection?t.selection():t;i.property("__zoom",z);if(t!==i){Q(t,e,n,o)}else{i.interrupt().each((function(){R(this,arguments).event(o).start().zoom(null,typeof e==="function"?e.apply(this,arguments):e).end()}))}};S.scaleBy=function(t,e,n,o){S.scaleTo(t,(function(){var t=this.__zoom.k,n=typeof e==="function"?e.apply(this,arguments):e;return t*n}),n,o)};S.scaleTo=function(t,e,n,o){S.transform(t,(function(){var t=s.apply(this,arguments),o=this.__zoom,i=n==null?G(t):typeof n==="function"?n.apply(this,arguments):n,u=o.invert(i),r=typeof e==="function"?e.apply(this,arguments):e;return c(K(X(o,r),i,u),t,T)}),n,o)};S.translateBy=function(t,e,n,o){S.transform(t,(function(){return c(this.__zoom.translate(typeof e==="function"?e.apply(this,arguments):e,typeof n==="function"?n.apply(this,arguments):n),s.apply(this,arguments),T)}),null,o)};S.translateTo=function(t,n,o,i,u){S.transform(t,(function(){var t=s.apply(this,arguments),u=this.__zoom,r=i==null?G(t):typeof i==="function"?i.apply(this,arguments):i;return c(e.translate(r[0],r[1]).scale(u.k).translate(typeof n==="function"?-n.apply(this,arguments):-n,typeof o==="function"?-o.apply(this,arguments):-o),t,T)}),i,u)};function X(t,e){e=Math.max(b[0],Math.min(b[1],e));return e===t.k?t:new n(e,t.x,t.y)}function K(t,e,o){var i=e[0]-o[0]*t.k,u=e[1]-o[1]*t.k;return i===t.x&&u===t.y?t:new n(t.k,i,u)}function G(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function Q(t,e,o,i){t.on("start.zoom",(function(){R(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){R(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,u=arguments,r=R(t,u).event(i),a=s.apply(t,u),h=o==null?G(a):typeof o==="function"?o.apply(t,u):o,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),f=t.__zoom,l=typeof e==="function"?e.apply(t,u):e,m=E(f.invert(h).concat(c/f.k),l.invert(h).concat(c/l.k));return function(t){if(t===1)t=l;else{var e=m(t),o=c/e[2];t=new n(o,h[0]-e[0]*o,h[1]-e[1]*o)}r.zoom(null,t)}}))}function R(t,e,n){return!n&&t.__zooming||new A(t,e)}function A(t,e){this.that=t;this.args=e;this.active=0;this.sourceEvent=null;this.extent=s.apply(t,e);this.taps=0}A.prototype={event:function(t){if(t)this.sourceEvent=t;return this},start:function(){if(++this.active===1){this.that.__zooming=this;this.emit("start")}return this},zoom:function(t,e){if(this.mouse&&t!=="mouse")this.mouse[1]=e.invert(this.mouse[0]);if(this.touch0&&t!=="touch")this.touch0[1]=e.invert(this.touch0[0]);if(this.touch1&&t!=="touch")this.touch1[1]=e.invert(this.touch1[0]);this.that.__zoom=e;this.emit("zoom");return this},end:function(){if(--this.active===0){delete this.that.__zooming;this.emit("end")}return this},emit:function(t){var e=o(this.that).datum();I.call(t,this.that,new p(t,{sourceEvent:this.sourceEvent,target:S,type:t,transform:this.that.__zoom,dispatch:I}),e)}};function H(t,...e){if(!h.apply(this,arguments))return;var n=R(this,e).event(t),o=this.__zoom,r=Math.max(b[0],Math.min(b[1],o.k*Math.pow(2,f.apply(this,arguments)))),a=u(t);if(n.wheel){if(n.mouse[0][0]!==a[0]||n.mouse[0][1]!==a[1]){n.mouse[1]=o.invert(n.mouse[0]=a)}clearTimeout(n.wheel)}else if(o.k===r)return;else{n.mouse=[a,o.invert(a)];i(this);n.start()}y(t);n.wheel=setTimeout(s,B);n.zoom("mouse",c(K(X(o,r),n.mouse[0],n.mouse[1]),n.extent,T));function s(){n.wheel=null;n.end()}}function N(t,...e){if(Y||!h.apply(this,arguments))return;var n=t.currentTarget,s=R(this,e,true).event(t),f=o(t.view).on("mousemove.zoom",d,true).on("mouseup.zoom",g,true),l=u(t,n),m=t.clientX,p=t.clientY;r(t.view);v(t);s.mouse=[l,this.__zoom.invert(l)];i(this);s.start();function d(t){y(t);if(!s.moved){var e=t.clientX-m,o=t.clientY-p;s.moved=e*e+o*o>D}s.event(t).zoom("mouse",c(K(s.that.__zoom,s.mouse[0]=u(t,n),s.mouse[1]),s.extent,T))}function g(t){f.on("mousemove.zoom mouseup.zoom",null);a(t.view,s.moved);y(t);s.event(t).end()}}function O(t,...e){if(!h.apply(this,arguments))return;var n=this.__zoom,i=u(t.changedTouches?t.changedTouches[0]:t,this),r=n.invert(i),a=n.k*(t.shiftKey?.5:2),f=c(K(X(n,a),i,r),s.apply(this,e),T);y(t);if(k>0)o(this).transition().duration(k).call(Q,f,i,t);else o(this).call(S.transform,f,i,t)}function W(t,...e){if(!h.apply(this,arguments))return;var n=t.touches,o=n.length,r=R(this,e,t.changedTouches.length===o).event(t),a,s,c,f;v(t);for(s=0;s<o;++s){c=n[s],f=u(c,this);f=[f,this.__zoom.invert(f),c.identifier];if(!r.touch0)r.touch0=f,a=true,r.taps=1+!!q;else if(!r.touch1&&r.touch0[2]!==f[2])r.touch1=f,r.taps=0}if(q)q=clearTimeout(q);if(a){if(r.taps<2)V=f[0],q=setTimeout((function(){q=null}),j);i(this);r.start()}}function C(t,...e){if(!this.__zooming)return;var n=R(this,e).event(t),o=t.changedTouches,i=o.length,r,a,h,s;y(t);for(r=0;r<i;++r){a=o[r],h=u(a,this);if(n.touch0&&n.touch0[2]===a.identifier)n.touch0[0]=h;else if(n.touch1&&n.touch1[2]===a.identifier)n.touch1[0]=h}a=n.that.__zoom;if(n.touch1){var f=n.touch0[0],l=n.touch0[1],m=n.touch1[0],p=n.touch1[1],v=(v=m[0]-f[0])*v+(v=m[1]-f[1])*v,d=(d=p[0]-l[0])*d+(d=p[1]-l[1])*d;a=X(a,Math.sqrt(v/d));h=[(f[0]+m[0])/2,(f[1]+m[1])/2];s=[(l[0]+p[0])/2,(l[1]+p[1])/2]}else if(n.touch0)h=n.touch0[0],s=n.touch0[1];else return;n.zoom("touch",c(K(a,h,s),n.extent,T))}function F(t,...e){if(!this.__zooming)return;var n=R(this,e).event(t),i=t.changedTouches,r=i.length,a,h;v(t);if(Y)clearTimeout(Y);Y=setTimeout((function(){Y=null}),j);for(a=0;a<r;++a){h=i[a];if(n.touch0&&n.touch0[2]===h.identifier)delete n.touch0;else if(n.touch1&&n.touch1[2]===h.identifier)delete n.touch1}if(n.touch1&&!n.touch0)n.touch0=n.touch1,delete n.touch1;if(n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else{n.end();if(n.taps===2){h=u(h,this);if(Math.hypot(V[0]-h[0],V[1]-h[1])<P){var s=o(this).on("dblclick.zoom");if(s)s.apply(this,arguments)}}}}S.wheelDelta=function(t){return arguments.length?(f=typeof t==="function"?t:m(+t),S):f};S.filter=function(t){return arguments.length?(h=typeof t==="function"?t:m(!!t),S):h};S.touchable=function(t){return arguments.length?(w=typeof t==="function"?t:m(!!t),S):w};S.extent=function(t){return arguments.length?(s=typeof t==="function"?t:m([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),S):s};S.scaleExtent=function(t){return arguments.length?(b[0]=+t[0],b[1]=+t[1],S):[b[0],b[1]]};S.translateExtent=function(t){return arguments.length?(T[0][0]=+t[0][0],T[1][0]=+t[1][0],T[0][1]=+t[0][1],T[1][1]=+t[1][1],S):[[T[0][0],T[0][1]],[T[1][0],T[1][1]]]};S.constrain=function(t){return arguments.length?(c=t,S):c};S.duration=function(t){return arguments.length?(k=+t,S):k};S.interpolate=function(t){return arguments.length?(E=t,S):E};S.on=function(){var t=I.on.apply(I,arguments);return t===I?S:t};S.clickDistance=function(t){return arguments.length?(D=(t=+t)*t,S):Math.sqrt(D)};S.tapDistance=function(t){return arguments.length?(P=+t,S):P};return S}export{w as d};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-client",
3
- "version": "2.76.2",
3
+ "version": "2.77.0",
4
4
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
5
5
  "main": "dist/app.js",
6
6
  "module": "dist/app.js",
@@ -1 +0,0 @@
1
- import{i as t,X as i}from"./app-6fb77603.js";import{F as s,g as o}from"./FilterRxComp-02e68f1b.js";class e extends s{constructor(t){super(t);this.api={main:this.main.bind(this),getNormalRoot:()=>o(this.rawFilter),getPromise:t=>this.promises[t]};if(t.callbacks){this.events=["postInit","postRender","firstRender"];this.bus=new i(this.api,this.events,t.callbacks)}}async main(t,i={}){this.dom.controlsTip.hide();this.dom.treeTip.hide();const s="activeCohort"in i?i.activeCohort:this.activeCohort;const o=JSON.stringify(t);if(this.rawCopy==o&&JSON.stringify(this.activeCohort)==JSON.stringify(s))return;await super.main(o,i)}}const r=t(e);export{r as f};
@@ -1 +0,0 @@
1
- import{h as t,d as e,M as s,o as r,n as o,y as i}from"./app-6fb77603.js";import{r as a,s as n}from"./recover-299ffdb3.js";import{v as p}from"./FilterRxComp-02e68f1b.js";import{n as c}from"./sampleScatter-55d9eb74.js";import{summaryInit as l}from"./summary-a6c15c9e.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"./genesearch-ffd88bf2.js";import"./checkbox-96437f4d.js";import"./rehydrateFilter-12d118cb.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"./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"./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 m(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 import("./plot.app-2a805759.js");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(e,s){(typeof queueMicrotask==="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))}))}}class d{constructor(t){this.type="plot";u(this);this.initUi(t)}reactsTo(t){if(t.type.includes("cache_termq"))return true;if(t.type.endsWith("_group"))return true;if(t.type.startsWith("plot_"))return t.id===this.id;if(t.type.startsWith("filter"))return true;if(t.type.startsWith("cohort"))return true;if(t.type=="app_refresh")return true;if(t.type.endsWith("customTerm"))return true}getState(t){const e=t.plots.find((t=>t.id===this.id));if(!e){throw`No plot with id='${this.id}' found. Did you set this.id before this.api = getComponentApi(this)?`}return{config:e,groups:t.groups,_scope_:t._scope_}}async main(){this.dom.errdiv.style("display","none");if(!this.components)await this.setComponents(this.opts)}async setComponents(t){this.components={recover:await a({app:this.app,holder:this.dom.localRecoverDiv,getState:t=>this.getState(t),reactsTo:t=>t.id==this.id&&(t.type=="plot_edit"||t.type=="plot_nestedEdits")&&t._track_!="none",plot_id:this.id,maxHistoryLen:10})};const s=await m(`../plots/${t.chartType}.js`);this.components.chart=await s.componentInit({app:this.app,holder:this.dom.viz,header:this.dom.paneTitleDiv,id:this.id,plotDiv:e(this.dom.holder.app_div.node().parentNode)})}destroy(){this.dom.holder.app_div.selectAll("*").remove();this.dom.holder.app_div.remove();for(const t in this.dom){delete this.dom[t]}}}const j=t(d);function u(t){t.initUi=function(e){const r=e.holder;r.header.style("padding",0);try{t.dom={tip:new s({padding:"0px"}),holder:r,paneTitleDiv:r.header.append("div").style("display","inline-block").style("color","#555").style("padding-left","7px").style("vertical-align","sub"),localRecoverDiv:r.header.append("div").style("display","inline-block"),body:r.body.style("white-space","nowrap").style("overflow-x","auto"),errdiv:r.body.append("div").style("display","none").style("padding","5px").style("background-color","rgba(255,100,100,0.2)"),viz:r.body.append("div")}}catch(e){t.dom.errdiv.style("display","none").text(e)}}}class h{constructor(t){if(t.addLoginCallback){t.addLoginCallback((()=>this.api.dispatch({type:"app_refresh"})))}this.type="app";this.dom={holder:t.holder,topbar:t.holder.append("div"),errdiv:t.holder.append("div"),plotDiv:t.holder.append("div")};this.plotIdToSandboxId={}}validateOpts(t={}){if(!t.holder)throw`missing opts.holder in the MassApp constructor argument`;if(!t.callbacks)t.callbacks={};if(!t.state.vocab)t.state.vocab={};if(typeof t.state.vocab!="object")throw"opts.state.vocab{} is not an object";if(t.state.genome){t.state.vocab.genome=t.state.genome;delete t.state.genome}if(t.state.dslabel){t.state.vocab.dslabel=t.state.dslabel;delete t.state.dslabel}return t}async preApiFreeze(t){try{t.tip=new s({padding:"5px"});t.tip.d.on("keyup",(e=>{if(e.key=="Escape")t.tip.hide()}));t.printError=t=>this.printError(t);const e=this.opts.state.vocab;t.vocabApi=await p({app:t,state:{vocab:this.opts.state.vocab},fetchOpts:this.opts.fetchOpts,getDatasetAccessToken:this.opts.getDatasetAccessToken});t.hasWebGL=function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch(t){return false}};this.opts.state.vocab=t.vocabApi.vocab}catch(t){throw t}}async init(){try{const t="debounceInterval"in this.opts?this.opts.debounceInterval:0;if(this.opts.embeddedSessionState){Object.assign(this.opts.state,this.opts.embeddedSessionState)}this.store=await n({app:this.api,state:this.opts.state,debounceInterval:t});this.state=await this.store.copyState();this.components={};if(this.state.nav.header_mode!="hidden"){this.components.nav=await c({app:this.api,holder:this.dom.topbar,header_mode:this.state&&this.state.nav&&this.state.nav.header_mode,vocab:this.state.vocab,massSessionDuration:this.state.termdbConfig.massSessionDuration})}this.components.plots={};await this.api.dispatch()}catch(t){this.printError(t);throw t}}async main(){await this.api.vocabApi.main();const t={};let e;for(const s of this.state.plots){if(this.components.plots&&!(s.id in this.components.plots)){e=o(this.dom.plotDiv,{close:()=>{this.api.dispatch({type:"plot_delete",id:s.id})},plotId:s.id,beforePlotId:s.insertBefore||null,style:{width:"98.5%"}});if(s.chartType=="summary")t[s.id]=l(Object.assign({app:this.api,holder:e},s));else t[s.id]=j(Object.assign({app:this.api,holder:e},s))}}const s=Object.keys(t).length;if(s){await Promise.all(Object.values(t));for(const e in t){this.components.plots[e]=await t[e]}}for(const t in this.components.plots){if(!this.state.plots.find((e=>e.id===t))){this.components.plots[t].destroy();delete this.components.plots[t]}}}printError(t){i(this.dom.errdiv||this.opts.holder,"Error: "+(t.message||t));if(t.stack)console.log(t.stack);this.bus.emit("error")}}const f=r(h);export{f as appInit};
@@ -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{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 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{aM as t,aL as o,a8 as r}from"./app-6fb77603.js";import{s as n}from"./legacy-d3-polyfill-bdb2d792.js";function a(a){if(a.geneexpression){if(a.geneexpression.maf){try{a.geneexpression.maf.get=new Function(...a.geneexpression.maf.get)}catch(t){return"invalid Javascript for get() of expression.maf of "+a.label}}}if(a.cohort){if(a.cohort.raw&&a.cohort.tosampleannotation){if(!a.cohort.key4annotation){return"cohort.tosampleannotation in use by .key4annotation missing of "+a.label}if(!a.cohort.annotation){a.cohort.annotation={}}let t=0;for(const o of a.cohort.raw){const r=o[a.cohort.tosampleannotation.samplekey];if(r){const t={};for(const r in o){t[r]=o[r]}a.cohort.annotation[r]=t}else{t++}}if(t)return t+" rows has no sample name from sample annotation of "+a.label;delete a.cohort.tosampleannotation}if(a.cohort.levels){if(a.cohort.raw){const r=t(a.cohort.raw,a.cohort.levels);a.cohort.root=o()(r);a.cohort.root.sum((t=>t.value))}}if(a.cohort.raw){delete a.cohort.raw}a.cohort.suncolor=r(n)}if(a.snvindel_attributes){for(const t of a.snvindel_attributes){if(t.get){try{t.get=new Function(...t.get)}catch(o){return"invalid Javascript for getter of "+JSON.stringify(t)}}else if(t.lst){for(const o of t.lst){if(o.get){try{o.get=new Function(...o.get)}catch(t){return"invalid Javascript for getter of "+JSON.stringify(o)}}}}}}if(a.stratify){if(!Array.isArray(a.stratify)){return"stratify is not an array in "+a.label}for(const t of a.stratify){if(!t.label){return"stratify method lacks label in "+a.label}if(t.bycohort){if(!a.cohort){return"stratify method "+t.label+" using cohort but no cohort in "+a.label}}else{if(!t.attr1){return"stratify method "+t.label+" not using cohort but no attr1 in "+a.label}if(!t.attr1.label){return".attr1.label missing in "+t.label+" in "+a.label}if(!t.attr1.k){return".attr1.k missing in "+t.label+" in "+a.label}}}}if(a.url4variant){for(const t of a.url4variant){t.makelabel=new Function(...t.makelabel);t.makeurl=new Function(...t.makeurl)}}}export{a as validate_oldds};
@@ -1 +0,0 @@
1
- import{j as t}from"./termsetting-492eefa7.js";function n(n){const o=n.sort(((t,n)=>t-n));const s=Math.abs(o[0]-o[o.length-1]);const e=t(s);const r=s>=10?0:s>=1?1:e+2;return n.map((t=>Number(t.toFixed(r))))}export{n};
@@ -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{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{Z as t,U as a,ah as e,I as o,W as n,ag as i}from"./app-6fb77603.js";import{c as l}from"./axis-747c801e.js";function r(a,e,o,n){const i=t({x:n.left+200,y:n.top});i.body.style("padding","10px");i.header.html(o);a.sort(((t,a)=>a.size-t.size));s({lst:a,holder:i.body,barcolor:e,limit:Math.min(a.length,20)})}function s(t){t.holder.selectAll("*").remove();const r=t.holder.append("div").style("margin-bottom","10px");r.append("button").text("more").on("click",(()=>{t.limit=Math.min(t.lst.length,t.limit+10);s(t)}));r.append("button").text("less").on("click",(()=>{t.limit=Math.max(1,t.limit-10);s(t)}));r.append("button").text("screenshot").on("click",(()=>a(b.node(),"barplot")));let m=20,c=300,d=5,p=m+5,h=m/8,x=0,f=0;const b=t.holder.append("svg");const g=b.append("g");for(let a=0;a<t.limit;a++){let o=t.lst[a];f=Math.max(f,o.size);b.append("text").text(o.name).attr("font-size",m-2).attr("font-family",e).each((function(){x=Math.max(x,this.getBBox().width)})).remove()}b.attr("width",x+d+c+d).attr("height",p+d+t.limit*(m+h));g.attr("transform","translate("+(x+d)+","+p+")").call(l().scale(o().domain([0,f]).range([0,c])).tickFormat(n("d")));i({axis:g,showline:true,fontsize:m*.8,color:"black"});let y=p+d;const u=c/f;for(let a=0;a<t.limit;a++){const o=t.lst[a];b.append("text").text(o.name).attr("x",x).attr("y",y+m/2).attr("text-anchor","end").attr("font-size",m-2).attr("font-family",e).attr("dominant-baseline","central");b.append("rect").attr("x",x+d).attr("y",y).attr("width",u*o.size).attr("height",m-1).attr("fill",t.barcolor);y+=m+h}}export{r as default};
@@ -1 +0,0 @@
1
- import{h as t,M as e,a as s,d as a,y as o,J as i,b as n,K as r,I as l,r as c,L as p,N as d,O as h,B as m,z as f,n as u,P as g,Q as y}from"./app-6fb77603.js";import{c as b,f as v}from"./termsetting-492eefa7.js";import{controlsInit as x}from"./controls-268e40e6.js";import{d as S}from"./zoom-f445cfef.js";import{d as w}from"./lasso-1a02a545.js";import{c as C,g as j,r as T,a as k,b as D,d as A,e as _,f as L,h as M,o as O,i as W,j as z}from"./recover-299ffdb3.js";import{t as $}from"./downloadTextfile-5723af95.js";import{r as I}from"./table-0daf2b89.js";import{a as N,b as G,c as R}from"./FilterRxComp-02e68f1b.js";import{searchSampleInput as q}from"./sampleView-1dff3fca.js";import{s as V}from"./select2Terms-d48d037e.js";import{d as E}from"./svg.download-f4aa48e4.js";import{s as P}from"./sampleScatter.rendererThree-ef289434.js";import{a as F,b as H,c as U}from"./axis-747c801e.js";import{l as B}from"./line-264f8f9e.js";class K{constructor(t){this.type="search";J(this);X(this)}async init(t){this.dom={holder:this.opts.holder,holderNode:this.opts.holder.node(),tip:new e({padding:"5px"})};this.initUI()}reactsTo(t){return t.type.startsWith("search")||t.type.startsWith("cohort")}getState(t){return{cohortStr:t.activeCohort==-1||!t.termdbConfig.selectCohort?"":t.termdbConfig.selectCohort.values[t.activeCohort].keys.slice().sort().join(","),search:t.search,nav:t.nav}}async main(){this.dom.holder.style("display",this.state.search.isVisible&&this.state.nav.header_mode!="only_buttons"?"inline-block":"none")}async doSearch(t){if(!t){this.clear({hide:true});this.bus.emit("postSearch",[]);return}const e=await this.app.vocabApi.findTerm(t,this.state.cohortStr,this.opts.usecase,this.opts.targetType);if(!e.lst||e.lst.length==0){this.noResult()}else{this.showTerms(e)}this.bus.emit("postSearch",e)}}const Y=t(K);function J(t){t.initUI=()=>{t.dom.holder.style("display",t.search&&t.search.isVisible==false?"none":"inline-block");t.dom.input=t.dom.holder.style("text-align","center").append("input").attr("type","search").attr("class","tree_search").attr("placeholder","Search").style("width","180px").style("display","block").on("input",s.debounce(t.onInput,300));t.dom.resultDiv=t.dom.tip.d.style("border-left",t.opts.resultsHolder?"":"solid 1px rgb(133,182,225)").style("padding-left","5px")};t.noResult=()=>{t.clear();t.dom.resultDiv.append("div").text("No match").style("padding","3px 3px 3px 0px").style("opacity",.5)};t.showTerms=e=>{if(t.opts.disable_terms)e.lst.forEach((e=>{if(e.disabled)t.opts.disable_terms.push(e)}));t.clear({hide:!e.lst.length});if(e.lst.length){t.dom.resultDiv.append("table").selectAll().data(e.lst).enter().append("tr").each(t.showTerm)}};t.showTerm=function(e){const s=a(this);const o=s.append("td").text(e.name);if(e.type){o.style("cursor","pointer").attr("class","sja_menuoption").on("click",(()=>{t.app.dispatch({type:"plot_create",config:{chartType:e.type=="survival"?"survival":"summary",term:{term:e}}});t.clear({hide:true})}))}else{o.style("padding","5px 10px").style("opacity",.5)}s.append("td").text((e.__ancestorNames||[]).join(" > ")).style("opacity",.5).style("font-size",".7em")};t.clear=(e={})=>{t.dom.tip.clear();if(e.hide)t.dom.tip.hide();else t.dom.tip.showunder(t.dom.holderNode)}}function X(t){t.onInput=async()=>{const e=t.dom.input.property("value");try{await t.doSearch(e)}catch(e){t.clear();o(t.dom.resultDiv,"Error: "+(e.message||e));if(e.stack)console.log(e.stack)}}}function Z(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 import("./plot.app-2a805759.js");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 Promise.resolve().then((function(){return It}));case"../plots/sampleScatter.js":return Promise.resolve().then((function(){return Xt}));case"../plots/sampleScatter.renderer.js":return Promise.resolve().then((function(){return Wt}));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(e,s){(typeof queueMicrotask==="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))}))}}class Q{constructor(){this.type="sessionBtn";this.route="termdb";this.embedderOrigin=window.location.origin;this.hostURL=sessionStorage.getItem("hostURL")||this.embedderOrigin}async init(t){const s=new e({padding:"0px"});this.dom={button:this.opts.button,tip:s};this.dom.button.on("click",(()=>{this.dom.tip.clear();this.showMenu()}));this.dslabel=t.vocab.dslabel;this.savedSessions=JSON.parse(localStorage.getItem("savedMassSessions")||`{}`);this.requiredAuth=t.termdbConfig?.requiredAuth?.find((t=>t.route==this.route&&t.type=="jwt"))}async showMenu(){this.dom.tip.clear().d.style("padding",0);const t=[{label:`Open`,title:"Recover a saved session",callback:this.open},{label:`Save`,title:"Save the current view",callback:this.save},{label:`Share`,title:"Create a URL link to share this view",callback:this.getSessionUrl}];if(!this.serverCachedSessions)await this.setServerCachedSessions();if(Object.keys(this.savedSessions).length||Object.keys(this.serverCachedSessions).length){t.push({label:`Delete`,title:"Delete a saved session",callback:this.delete})}this.dom.tip.clear().d.selectAll(".sja_menuoption sja_sharp_border").data(t).enter().append("div").attr("class","sja_menuoption sja_sharp_border").attr("aria-label",(t=>t.title)).html((t=>t.label)).on("click",((t,e)=>{this.dom.tip.clear().d.style("padding","10px");this.showBackBtn();e.callback.call(this)}));this.dom.tip.showunder(this.dom.button.node())}async open(){const t=`sjpp-session-open-radio-`+Math.random().toString().slice(-6);this.dom.tip.d.append("div").style("display","none").style("padding","3px 9px").html(`\n\t\t\t<b>Open in</b>\n\t\t\t<label>\n\t\t\t\t<input type='radio' name='${t}' value='new' style='margin-right: 0; vertical-align: bottom'/>\n\t\t\t\t<span>a new tab</span>\n\t\t\t</label>\n\t\t\t<label style='margin-left: 5px'>\n\t\t\t\t<input type='radio' name='${t}' value='current' checked=checked style='margin-right: 0; vertical-align: bottom'/>\n\t\t\t\t<span>current tab</span>\n\t\t\t</label>\n\t\t`);const e=await this.listSessions({trClickHandler:async(e,s)=>{const{loc:a,id:o}=s;if(!o)return;if(a.includes("browser")){this.sessionName=o;const e=this.savedSessions[o];await tt(e,this.app);const s=this.dom.tip.d.node().querySelector(`[name="${t}"]:checked`).value;if(s=="current"){this.app.dispatch({type:"app_refresh",state:e})}else if(window.location.origin==this.hostURL){window.open(`/?mass-session-id=${o}&src=browser`)}else{if(e.embedder)i({state:e});else{const{protocol:t,host:s,search:a,origin:o,href:n}=window.location;const r={protocol:t,host:s,search:a,origin:o,href:n};i({state:Object.assign({embedder:r},e)})}}this.dom.tip.hide()}else if(a=="server"){const e=this.app.vocabApi.mayGetAuthHeaders(this.route);const s={id:o,route:this.route,dslabel:this.dslabel,embedder:window.location.hostname};const a=await n(`/massSession?`,{headers:e,body:s});if(!a.state)throw a.error||"unable to get the cached session from the server";await tt(a.state,this.app);this.savedSessions[o]=a.state;const r=this.dom.tip.d.node().querySelector(`[name="${t}"]:checked`).value;if(r=="current"){this.app.dispatch({type:"app_refresh",state:a.state})}else if(window.location.origin==this.hostURL){window.open(`/?mass-session-id=${o}&src=cred&dslabel=${this.dslabel}&route=${this.route}`)}else{i(a)}this.dom.tip.hide()}}});e.headtr.select("th").html("Open from");const s=e.tbody.insert("tr","tr");s.append("td").style("text-align","center").style("padding","3px 9px").html("Local file");const a=s.append("td").style("text-align","left").append("label");a.append("span").style("padding","3px 9px").style("text-decoration","underline").style("cursor","pointer").html("Choose File");a.append("input").attr("type","file").attr("placeholder","file name").style("opacity",0).style("width","0.1px").style("height","0.1px").style("position","absolute").on("change",(async()=>{const e=event.target.files.item(0);const s=await e.text();let a=e.name;if(this.savedSessions[a]){a=prompt(`Leave as-is to overwrite a session with the same name, or enter a different session name.`,a)}this.sessionName=a;const o=JSON.parse(s);await tt(o,this.app);this.savedSessions[a]=o;localStorage.setItem("savedMassSessions",JSON.stringify(this.savedSessions));const n=this.dom.tip.d.node().querySelector(`[name="${t}"]:checked`).value;if(n=="current"){this.app.dispatch({type:"app_refresh",state:o})}else if(window.location.origin==this.hostURL){window.open(`/?mass-session-id=${a}&src=browser`)}else{if(o.embedder)i({state:o});else{const{protocol:t,host:e,search:s,origin:a,href:n}=window.location;const r={protocol:t,host:e,search:s,origin:a,href:n};i({state:Object.assign({embedder:r},o)})}}this.dom.tip.hide()}))}async listSessions(t={}){const e=this.dom.tip.d.append("table").attr("class","sjpp-controls-table");const s=e.append("thead").append("tr");s.selectAll("th").data(["Cache Location","Session ID"]).enter().append("th").style("text-align",((t,e)=>e===0?"center":"left")).style("padding","3px 9px").html((t=>t));const a=Object.keys(this.savedSessions).map((t=>({loc:"browser",id:t})));if(!this.serverCachedSessions)await this.setServerCachedSessions();a.push(...this.serverCachedSessions.map((t=>({loc:"server",id:t}))));const o=e.append("tbody");const i=o.selectAll("tr").data(a).enter().append("tr").on("click",t.trClickHandler||null);i.selectAll("td").data((t=>[t,t])).enter().append("td").style("text-align",((t,e)=>e===0?"center":"left")).style("padding","3px 9px").style("cursor","pointer").html(((t,e)=>e===0?t.loc:t.id));if(!this.serverCachedSessions.length&&this.requiredAuth&&!this.app.vocabApi.hasVerifiedToken()){e.append("tbody").append("tr").selectAll("td").data(["server","requires sign-in"]).enter().append("td").style("text-align",((t,e)=>e===0?"center":"left")).style("padding","3px 9px").html((t=>t))}return{table:e,headtr:s,tbody:o,trs:i}}async setServerCachedSessions(){const t=this.app.getState();this.requiredAuth=t.termdbConfig?.requiredAuth?.find((t=>t.route==this.route&&t.type=="jwt"));if(!this.requiredAuth){this.serverCachedSessions=[];return}const e=this.app.vocabApi.mayGetAuthHeaders(this.route);const s={route:this.route,dslabel:this.dslabel,embedder:window.location.hostname};const a=await n("/sessionIds",{headers:e,body:s});this.serverCachedSessions=a.sessionIds||[]}async save(t){const e=this.dom.tip.d;const s=e.append("div");s.append("span").html("Save as");const a=Object.keys(this.savedSessions);if(!this.serverCachedSessions)await this.setServerCachedSessions();a.push(...this.serverCachedSessions.filter((t=>!a.includes(t))));const o=this.sessionName||"unnamed-session";const i=s.append("input").attr("type","text").attr("placeholder",o).style("width","220px").on("input",(()=>{n.selectAll("*").remove();const t=i.property("value");const e=a.filter((e=>e===t));const s=a.filter((e=>e.startsWith(t)));const o=a.filter((e=>e.includes(t)&&e!==t&&!s.includes(e)));n.selectAll("div").data([...e,...s,...o]).enter().append("div").attr("class","sja_menuoption").html((t=>t)).on("click",((t,e)=>{i.property("value",e);n.selectAll("*").remove()}))}));const n=e.append("div");const r=e.append("div");r.append("span").html("Save to&nbsp;");r.append("button").style("min-width","80px").html("Browser").attr("title",`Save the session in your current browser's cache. The session can be easily recovered, but not shared among your other devices`).on("click",(()=>{this.sessionName=i.property("value")||o;this.savedSessions[this.sessionName]=this.app.getState();localStorage.setItem("savedMassSessions",JSON.stringify(this.savedSessions));this.confirmAction(`Cached '<b>${this.sessionName}</b>' in browser`)}));r.append("button").style("min-width","80px").html("File").attr("title",`Save the session into a local file. The session can be easily recoved using the 'Open from local file' option.`).on("click",(()=>{const t=i.property("value")||o;this.savedSessions[t]=this.app.getState();this.download(t);this.confirmAction(`Downloaded '<b>${t}</b>'`)}));if(this.requiredAuth){const t=this.app.vocabApi.hasVerifiedToken()?"":"Requires sign-in. ";r.append("button").style("min-width","80px").html("Server").attr("title",`${t}Save the session into a remote server. The session can be easily shared across your different devices and recovered using the 'Open from server' option.`).property("disabled",!this.app.vocabApi.hasVerifiedToken()).on("click",(async()=>{if(!this.app.vocabApi.hasVerifiedToken()){alert("Requires sign-in");return}const t=i.property("value")||o;this.savedSessions[t]=this.app.getState();const e=await this.getSessionUrl(t);if(e.id!=t)throw`error saving ${t}`;this.confirmAction(`Saved '<b>${t}</b>' on the server`)}))}}download(t=""){const e=t||this.sessionName;const s=e?.endsWith(".txt")?"":".txt";const a=`${e}${s}`;$(a,JSON.stringify(this.savedSessions[e]))}async getSessionUrl(t=""){const e=this.app.vocabApi.mayGetAuthHeaders("termdb");const s=structuredClone(this.app.getState());const{protocol:a,host:o,search:r,origin:l,href:c}=window.location;s.embedder={protocol:a,host:o,search:r,origin:l,href:c};if(t){s.__sessionFor__={route:this.route,filename:t,dslabel:this.dslabel,embedder:window.location.hostname}}const p=await n("/massSession",{headers:e,method:"POST",body:JSON.stringify(s)});if(t){return p}else{const t=`${this.hostURL}/?mass-session-id=${p.id}&noheader=1`;this.dom.tip.showunder(this.dom.button.node());const e=this.dom.tip.d.append("div").style("margin","10px");e.append("div").style("margin-bottom","12px").html(`Click the link to recover this session. Bookmark or share this link.`);const a=e.append("a").attr("href",t).attr("target","_blank").html(p.id);if(this.hostURL!=window.location.origin){a.on("click",(t=>{t.preventDefault();i({state:s},window.location.origin);return false}))}e.append("div").html(`\n\t\t\t\t\t<br>\n\t\t\t\t\t<div style="max-width: 400px; font-size: 1em; opacity:.6">\n\t\t\t\t\t<span>NOTES</span>\n\t\t\t\t\t<ul>\n\t\t\t\t\t<li>A recovered session may hide data or views to users that are not authorized to access the saved datasets or features.</li>\n\t\t\t\t\t<li>This session will be saved for ${this.opts.massSessionDuration} days.</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</div>`);setTimeout((()=>{this.dom.button.property("disabled",false)}),1e3)}}async delete(){const t=await this.listSessions({trClickHandler:function(s){const o=this.lastChild.querySelector("input");const i=s.target==o?o.checked:!o.checked;a(this).style("text-decoration",i?"line-through":"");if(s.target!=o)o.checked=i;const n=t.table.node().querySelectorAll("input:checked");e.property("disabled",n.length?false:true)}});t.headtr.append("th").html("Delete");t.trs.each((function(t){a(this).append("td").style("text-align","center").append("input").attr("type","checkbox").attr("value",t.id)}));const e=this.dom.tip.d.append("div").style("text-align","center").append("button").html("Delete selected sessions").property("disabled",true).on("click",(async()=>{const e=t.table.node().querySelectorAll("input");const s=[];for(const t of e){if(a(t).property("checked")){const e=t.parentNode.parentNode.__data__;if(e.loc=="browser"){delete this.savedSessions[t.value]}else if(e.loc=="server"){delete this.serverCachedSessions[t.value];s.push(t.value)}else throw`unknown cache location=${e.loc}`}}localStorage.setItem("savedMassSessions",JSON.stringify(this.savedSessions));try{const t=this.app.vocabApi.mayGetAuthHeaders("termdb");const e={ids:s,route:this.route,dslabel:this.dslabel,embedder:window.location.hostname};const a=n(`/massSession?`,{method:"DELETE",headers:t,body:e})}catch(t){throw t}this.dom.tip.hide()}))}showBackBtn(){this.dom.tip.d.append("div").attr("class","sja_clbtext2").style("margin-bottom","10px").style("cursor","pointer").html(`&lt; Session Menu`).on("click",(()=>this.showMenu()))}confirmAction(t){this.dom.tip.clear().d.append("div").html(t).transition().delay(3e3).duration(1e3).style("opacity",0);setTimeout((()=>{this.dom.tip.hide()}),3500)}}async function tt(t,e){if(t.plots){const s=[];for(const a of t.plots){s.push((async()=>{const t=await Z(`../plots/${a.chartType}.js`);return await t.getPlotConfig(a,e)})())}try{await Promise.all(s)}catch(t){console.log(t);e.printError(t)}}}const et=t(Q);class st{constructor(t){this.type="about";this.app=t.app;this.holder=t.holder;this.features=t.features}init(){this.holder.append("div").style("padding","10px").html(this.features.html)}main(){const t=this.app.Inner.components.nav.Inner.tabs.findIndex((t=>t.subheader=="about"));const e=this.app.Inner.state.nav.activeTab==t;this.holder.style("display",e?"":"none")}}const at=t(st);let ot=0;const it="_MASS_AUTOID_"+Math.random().toString().slice(-6);let nt=(+new Date).toString().slice(-8);const rt=new e({padding:"0px",offsetX:0,offsetY:0});rt.d.style("z-index",5555);const lt={top:"CHARTS",mid:"NONE",btm:"",subheader:"charts"};const ct={top:"GROUPS",mid:"NONE",btm:"",subheader:"groups"};const pt={top:"FILTER",mid:"NONE",btm:"",subheader:"filter"};function dt(){return it+"_"+nt++}class ht{constructor(t){this.type="nav";this.instanceNum=ot++;this.activeTab=0;this.activeCohort=0;this.searching=false;this.samplecounts={};this.massSessionDuration=t.massSessionDuration;this.sessionDaysLeft=t.app.opts.sessionDaysLeft||null;this.sessionId=t.app.opts.sessionId||null;ut(this);ft(this)}async init(t){try{this.cohortFilter=N(t.termfilter.filter,"cohortFilter");this.initUI(t);this.initCohort(t);this.components=await r({search:Y({app:this.app,holder:this.dom.searchDiv,usecase:{target:"summary",detail:"term"},targetType:"Dictionary Variables"}),filter:G({app:this.app,vocabApi:this.app.vocabApi,holder:this.dom.subheader.filter.append("div"),hideLabel:this.opts.header_mode==="with_tabs",emptyLabel:"+Add new filter",callback:t=>{this.app.dispatch({type:"filter_replace",filter:t})}}),charts:C({app:this.app,holder:this.dom.subheader.charts,vocab:this.opts.vocab}),groups:j({app:this.app,holder:this.dom.subheader.groups,vocab:this.opts.vocab}),recover:T({app:this.app,holder:this.dom.recoverDiv,getState:t=>t,reactsTo:t=>t.type!="plot_edit",maxHistoryLen:5}),sessionBtn:et({app:this.app,button:this.dom.saveBtn,massSessionDuration:this.opts.massSessionDuration,sessionDaysLeft:this.app.opts.sessionDaysLeft||null}),about:t.termdbConfig.about?at({app:this.app,holder:this.dom.subheader.about,features:t.termdbConfig.about}):[]});this.mayShowMessage_sessionDaysLeft()}catch(t){throw t}}reactsTo(t){if(t.type.includes("cache_termq"))return true;if(t.type.startsWith("filter"))return true;if(t.type.startsWith("cohort"))return true;if(t.type.startsWith("tab"))return true;if(t.type=="plot_create")return true;if(t.type=="plot_delete")return true;if(t.type=="app_refresh")return true;if(t.type.endsWith("_customTerm"))return true;if(t.type.endsWith("_group"))return true}getState(t){return{searching:this.searching,nav:t.nav,activeCohort:t.activeCohort,termdbConfig:t.termdbConfig,filter:t.termfilter.filter,plots:t.plots,groups:t.groups}}async main(){if(this.state.termdbConfig.selectCohort&&this.state.termdbConfig.about){console.error("Cohort(s) and an About tab are defined. Only one can be used.");return}this.dom.tabDiv.style("display",this.state.nav.header_mode==="with_tabs"?"inline-block":"none");this.dom.tip.hide();this.activeTab=this.state.nav.activeTab;this.prevCohort=this.activeCohort;this.activeCohort=+this.state.activeCohort;this.filterUiRoot=N(this.state.filter,"filterUiRoot");this.cohortFilter=N(this.state.filter,"cohortFilter");if(this.cohortNames){this.activeCohortName=this.cohortNames[this.activeCohort];if(this.activeCohort!==-1)this.activeCohortLabel=this.state.termdbConfig.selectCohort.values[this.activeCohort].shortLabel}this.filterJSON=JSON.stringify(this.state.filter);this.cohortsData=await this.app.vocabApi.getCohortsData();if(this.state.termdbConfig.about)this.about=this.state.termdbConfig.about;if(this.state.nav.header_mode==="with_tabs"){if(!(this.activeCohortName in this.samplecounts)){const t=await this.app.vocabApi.getCohortSampleCount(this.activeCohortName);this.samplecounts[this.activeCohortName]=t}if(!(this.filterJSON in this.samplecounts)){if(!this.filterUiRoot||!this.filterUiRoot.lst.length){this.samplecounts[this.filterJSON]=this.samplecounts[this.activeCohortName]}else{const t=await this.app.vocabApi.getFilteredSampleCount(this.filterJSON);this.samplecounts[this.filterJSON]=t}}}this.updateUI()}}const mt=t(ht);function ft(t){t.initUI=s=>{const a=t.opts.holder.append("div").style("white-space","nowrap");let o=a.append("div").style("display","inline-block").style("float","right").style("font-size","1.1em").style("margin-top","50px").text(s.termdbConfig?.title?.text||"");const i=a.append("div").style("display","none").style("vertical-align","bottom");const n=a.append("div").style("vertical-align","top").style("margin","10px").style("display","inline-block");t.opts.holder.attr("class","sjpp-nav");t.dom={holder:t.opts.holder,header:a,tabDiv:i,controlsDiv:n,searchDiv:n.append("div").style("margin","10px"),sessionDiv:n.append("div").style("display","inline-block"),recoverDiv:n.append("div").style("display","inline-block"),helpDiv:n.append("div").style("display","none"),sessionElapsedMessageDiv:n.append("div").style("display","none"),subheaderDiv:t.opts.holder.append("div").style("display","block").style("padding-top","5px").style("border-bottom","1px solid #000"),messageDiv:t.opts.holder.append("div").style("margin","30px").style("display","none"),titleDiv:o,tip:new e({padding:"5px"})};if(s.nav.header_mode=="only_buttons"){t.dom.tabDiv.style("display","none");t.dom.recoverDiv.style("display","none");o.style("margin-top","95px").style("font-size","0.9em");if(s.termdbConfig.title?.link)o.on("click",(()=>window.open(s.termdbConfig.title.link,"_blank"))).on("mouseover",(()=>o.style("cursor","pointer")))}if(t.opts.header_mode==="with_cohortHtmlSelect"){t.dom.cohortStandaloneDiv=a.append("div").style("display","inline-block").style("margin","10px").style("vertical-align","top");t.dom.cohortStandaloneDiv.append("label").html("Cohort: ");t.dom.cohortSelect=t.dom.cohortStandaloneDiv.append("select").on("change",(function(){t.app.dispatch({type:"cohort_set",activeCohort:+this.value})}));t.dom.cohortSelect.selectAll("option").data(s.termdbConfig.selectCohort.values).enter().append("option").attr("value",((t,e)=>e)).property("selected",((t,e)=>e===s.activeCohort)).html((t=>t.shortLabel))}t.dom.subheader=Object.freeze({search:t.dom.subheaderDiv.append("div").style("display","none"),groups:t.dom.subheaderDiv.append("div").style("display","none"),charts:t.dom.subheaderDiv.append("div").style("display","none"),filter:t.dom.subheaderDiv.append("div").style("display","none"),cart:t.dom.subheaderDiv.append("div").style("display","none").html("<br/>Cart feature under construction - work in progress<br/>&nbsp;<br/>"),about:t.dom.subheaderDiv.append("div").style("display","none").attr("data-testid","sjpp-mass-about")});t.tabs=[lt,ct,pt];if(s.termdbConfig?.selectCohort||s.termdbConfig?.about){const e=s.termdbConfig?.about?.tab||{};const a=s.termdbConfig.selectCohort?"COHORT":e.topLabel||"";const o=e.midLabel||(e?"ABOUT":"");const i=e.btmLabel||"";const n={top:a.toUpperCase(),mid:o.toUpperCase(),btm:i,subheader:"about"};const r=s.termdbConfig?.selectCohort?0:e.order||0;t.tabs.splice(r,0,n)}const r=t.dom.tabDiv.append("table").style("border-collapse","collapse");r.selectAll("tr").data(["top","mid","btm"]).enter().append("tr").style("font-size",((t,e)=>e==1?"20px":"12px")).selectAll("td").data(((e,s)=>t.tabs.map(((t,a)=>({rowNum:s,key:e,colNum:a,label:t[e],subheader:t.subheader}))))).enter().append("td").style("display","none").style("width","100px").style("padding",(t=>t.rowNum===0?"12px 12px 3px 12px":"3px 12px")).style("text-align","center").style("border-left","1px solid #ccc").style("border-right","1px solid #ccc").style("color","#aaa").style("cursor","pointer").html((t=>t.label)).on("click",((e,s)=>{t.setTab(e,s)}));t.dom.trs=r.selectAll("tr");t.dom.tds=r.selectAll("td");t.subheaderKeys=t.tabs.map((t=>t.subheader));t.dom.saveBtn=t.dom.sessionDiv.append("button").style("margin","10px").text("Session ▼");if(t.sessionDaysLeft!=null){t.dom.fileBtn=t.dom.sessionDiv.append("button").style("margin","10px").text("Export Session").on("click",(e=>{t.getSessionFile(e)}))}const l=s.termdbConfig.helpPages;if(l){t.dom.helpBtn=t.dom.helpDiv.style("display","inline-block").append("button").style("margin","10px").html("Help &#9660;").on("click",(t=>{const e=t.target.getBoundingClientRect();const s=rt.clear().show(e.left-0,e.top+e.height+5).d.append("div");for(const t of l){s.append("div").style("margin","15px").append("a").attr("href",t.url).attr("target","_blank").text(t.label)}}))}};t.mayShowMessage_sessionDaysLeft=()=>{if(!Number.isFinite(t.sessionDaysLeft)){return}t.dom.sessionElapsedMessageDiv.style("display","block");t.dom.remainingDaysMessage=t.dom.sessionElapsedMessageDiv.append("div").style("display","block").style("opacity","0.65").html(`<u>${t.sessionDaysLeft} days</u> left until this session is removed. Click the "Save Session" button to create a new one.`)};t.updateUI=async(e=false)=>{if(!t.dom.subheaderDiv)return;if(t.activeTab&&t.state.termdbConfig.selectCohort&&t.activeCohort==-1){t.dom.subheaderDiv.style("display","none");t.dom.messageDiv.selectAll("text").remove();t.dom.messageDiv.style("display","").text('No cohort selected. Please select a cohort in the "COHORT" tab.')}else{let s="block";if(e){s=t.dom.subheaderDiv.style("display")=="none"?"block":"none"}if(t.dom.subheaderDiv)t.dom.subheaderDiv.style("display",s);if(t.dom.messageDiv)t.dom.messageDiv.style("display","none")}const s=t.state.termdbConfig.selectCohort;t.dom.searchDiv.style("display",s&&t.activeCohort==-1||t.state.nav.header_mode=="only_buttons"?"none":"inline-block");t.dom.header.style("border-bottom",t.state.nav.header_mode==="with_tabs"?"1px solid #000":"");t.dom.tds.style("display","").style("color",(e=>e.colNum==t.activeTab?"#000":"#aaa")).style("background-color",(e=>e.colNum==t.activeTab&&t.dom.subheaderDiv.style("display")!="none"?"#ececec":"transparent")).html((function(e,s){if(e.key=="top")return this.innerHTML;if(e.subheader=="groups"){if(e.key=="mid")return t.state.groups.length||"NONE";return""}if(e.subheader==="charts"){const s=t.state.plots.length;if(e.key=="mid")return!s?"NONE":s;else return""}else if(e.subheader==="about"){if(t.activeCohortName&&t.activeCohortName in t.samplecounts){const s={top:this.innerHTML,mid:t.activeCohortLabel,btm:t.samplecounts[t.activeCohortName]};return s[e.key]||""}else if(t.about){const s={top:t.about?.tab?.topLabel?t.about.tab.topLabel.toUpperCase():this.innerHTML,mid:t.about?.tab?.midLabel?t.about.tab.midLabel.toUpperCase():"ABOUT",btm:t.about?.tab?.btmLabel||this.innerHTML};return s[e.key]||""}else{return e.key==="mid"?"NONE":this.innerHTML}}else if(e.subheader==="filter"){const s=t.filterUiRoot?t.filterUiRoot:{lst:[]};if(s.lst.length===0){return e.key==="mid"?"NONE":t.samplecounts["undefined"]?`${t.samplecounts["undefined"]}`:""}else{const a=t.samplecounts[t.filterJSON]!=undefined?""+t.samplecounts[t.filterJSON]:"";return e.key==="mid"?s.lst.length:a}}else{return e.key==="mid"?this.innerHTML:"&nbsp;"}}));for(const e in t.dom.subheader){t.dom.subheader[e].style("display",t.tabs[t.activeTab].subheader===e?"block":"none")}t.renderCohortsTable();if(t.opts.header_mode==="with_cohort_select"){t.dom.cohortSelect.selectAll("option").property("value",appState.activeCohort)}};t.renderCohortsTable=()=>{if(!t.dom.cohortTable)return;t.dom.cohortTable.selectAll("*").remove();const e=[{label:"Feature"}];const s=[];const a=t.cohortsData;if("error"in a)throw a.error;for(const t of a.features)s.push([{value:t.name}]);for(const t of a.cohorts){e.push({label:t.cohort?`${t.name} (${t.cohort})`:t.name});for(const[e,o]of a.features.entries()){const i=a.cfeatures.find((e=>e.idfeature===o.idfeature&&e.cohort===t.cohort));if(i)s[e].push({value:i.value})}}I({rows:s,columns:e,div:t.dom.cohortTable,showLines:false,maxHeight:"60vh"});t.dom.cohortTable.select("table").style("border-collapse","collapse");t.dom.cohortTable.selectAll(`tbody > tr > td`).style("background-color","transparent");const o=t.state.termdbConfig.selectCohort;const i=o.values[t.activeCohort].keys;let n=`tbody > tr > td:nth-child(${t.activeCohort+2})`;const r=i.length>1;if(r){n="";for(const t of i){const e=a.cohorts.map((t=>t.cohort)).indexOf(t);if(n!=="")n+=",";n+=`tbody > tr > td:nth-child(${e+2})`}}const l=t.dom.cohortTable.selectAll(n);l.style("background-color","yellow");t.dom.cohortInputs.property("checked",((e,s)=>s===t.activeCohort))};t.initCohort=async e=>{const s=e.termdbConfig.selectCohort;if(!s)return;t.dom.tds.filter((t=>t.colNum===0)).style("display","");t.cohortNames=s.values.map((t=>t.keys.slice().sort().join(",")));if(s.title){t.dom.cohortTitle=t.dom.subheader.about.append("h2").style("margin-left","10px").text(s.title)}if(s.description){t.dom.cohortDescription=t.dom.subheader.about.append("div").style("margin-left","10px").html(s.description)}if(s.prompt){t.dom.cohortPrompt=t.dom.subheader.about.append("div").style("margin-left","10px").style("padding-top","30px").style("padding-bottom","10px").style("font-weight","bold").text(s.prompt)}t.dom.cohortOpts=t.dom.subheader.about.append("div").style("margin-bottom","30px").style("margin-left","10px");t.dom.cohortOpts.append("table").selectAll("tr").data(s.values).enter().append("tr").each((function(e,s){const o=a(this);const i=o.append("td");const n="sja-termdb-cohort-"+t.instanceNum;const r=n+"-"+s;i.append("input").attr("type","radio").attr("name",n).attr("id",r).attr("value",s).property("checked",s===t.activeCohort).style("margin-right","5px").style("margin-left","0px").on("click",(()=>{t.app.dispatch({type:"cohort_set",activeCohort:s})}));i.append("label").attr("for",r).attr("colspan",2).style("cursor","pointer").html((t=>t.label));o.selectAll("td").style("max-width","600px").style("padding-bottom","10px").style("padding-right","20px").style("vertical-align","top")}));t.dom.cohortInputs=t.dom.cohortOpts.selectAll("input");t.dom.cohortTable=t.dom.subheader.about.append("div");if(s.asterisk){t.dom.cohortAsterisk=t.dom.subheader.about.append("div").style("margin-left","10px").style("padding-top","20px").style("padding-bottom","20px").style("font-size","small").text(s.asterisk)}}}function ut(t){t.setTab=async(e,s)=>{if(s.colNum===t.activeTab&&!t.searching){t.prevCohort=t.activeCohort;await t.updateUI(true);if(t.bus)t.bus.emit("postRender");return}t.activeTab=s.colNum;t.searching=false;t.app.dispatch({type:"tab_set",activeTab:t.activeTab});const a=t.subheaderKeys.indexOf("charts");if(t.activeTab==a&&t.activeCohort!=-1&&!t.state.plots.length){t.app.dispatch({type:"plot_create",id:dt(),config:{chartType:"dictionary"}})}};t.getSessionFile=async e=>{const s=await n(`/massSession?id=${t.sessionId}`);const a=document.createElement("a");const o="data:application/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(s.state));a.setAttribute("href",o);a.download=`${t.sessionId}.json`;a.click();a.remove()}}function gt(t,e){return yt(t)||bt(t,e)||vt()}function yt(t){if(Array.isArray(t))return t}function bt(t,e){var s=[];var a=true;var o=false;var i=undefined;try{for(var n=t[Symbol.iterator](),r;!(a=(r=n.next()).done);a=true){s.push(r.value);if(e&&s.length===e)break}}catch(t){o=true;i=t}finally{try{if(!a&&n["return"]!=null)n["return"]()}finally{if(o)throw i}}return s}function vt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function xt(t,e,s,a){t=t.filter((function(t,a){var o=e(t,a),i=s(t,a);return o!=null&&isFinite(o)&&i!=null&&isFinite(i)}));if(a){t.sort((function(t,s){return e(t)-e(s)}))}var o=t.length,i=new Float64Array(o),n=new Float64Array(o);var r=0,l=0,c,p,d;for(var h=0;h<o;){d=t[h];i[h]=c=+e(d,h,t);n[h]=p=+s(d,h,t);++h;r+=(c-r)/h;l+=(p-l)/h}for(var m=0;m<o;++m){i[m]-=r;n[m]-=l}return[i,n,r,l]}function St(t,e,s,a){var o=0;for(var i=0,n=t.length;i<n;i++){var r=t[i],l=+e(r,i,t),c=+s(r,i,t);if(l!=null&&isFinite(l)&&c!=null&&isFinite(c)){a(l,c,o++)}}}function wt(t,e,s,a,o){var i=0,n=0;St(t,e,s,(function(t,e){var s=e-o(t),r=e-a;i+=s*s;n+=r*r}));return 1-i/n}function Ct(t){return Math.atan2(t[1][1]-t[0][1],t[1][0]-t[0][0])*180/Math.PI}function jt(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function Tt(t,e,s){var a=Math.log(e-t)*Math.LOG10E+1|0;var o=1*Math.pow(10,-a/2-1),i=1e4;var n=[l(t),l(e)],r=0;while(c(n)&&r<i){}return n;function l(t){return[t,s(t)]}function c(t){r++;var e=t.length;var s=false;for(var a=0;a<e-1;a++){var i=t[a],n=t[a+1],c=jt([i,n]),p=l(c[0]),d=Ct([i,c]),h=Ct([i,p]),m=Math.abs(d-h);if(m>o){t.splice(a+1,0,p);s=true}}return s}}function kt(t,e,s,a){var o=a-t*t,i=Math.abs(o)<1e-24?0:(s-t*e)/o,n=e-i*t;return[n,i]}function Dt(){var t=function t(e){return e[0]},e=function t(e){return e[1]},s;function a(a){var o=0,i=0,n=0,r=0,l=0,c=s?+s[0]:Infinity,p=s?+s[1]:-Infinity;St(a,t,e,(function(t,e){++o;i+=(t-i)/o;n+=(e-n)/o;r+=(t*e-r)/o;l+=(t*t-l)/o;if(!s){if(t<c)c=t;if(t>p)p=t}}));var d=kt(i,n,r,l),h=gt(d,2),m=h[0],f=h[1],u=function t(e){return f*e+m},g=[[c,u(c)],[p,u(p)]];g.a=f;g.b=m;g.predict=u;g.rSquared=wt(a,t,e,n,u);return g}a.domain=function(t){return arguments.length?(s=t,a):s};a.x=function(e){return arguments.length?(t=e,a):t};a.y=function(t){return arguments.length?(e=t,a):e};return a}function At(){var t=function t(e){return e[0]},e=function t(e){return e[1]},s;function a(a){var o=xt(a,t,e),i=gt(o,4),n=i[0],r=i[1],l=i[2],c=i[3],p=n.length;var d=0,h=0,m=0,f=0,u=0,g,y,b,v;for(g=0;g<p;){y=n[g];b=r[g++];v=y*y;d+=(v-d)/g;h+=(v*y-h)/g;m+=(v*v-m)/g;f+=(y*b-f)/g;u+=(v*b-u)/g}var x=0,S=0,w=s?+s[0]:Infinity,C=s?+s[1]:-Infinity;St(a,t,e,(function(t,e){S++;x+=(e-x)/S;if(!s){if(t<w)w=t;if(t>C)C=t}}));var j=m-d*d,T=d*j-h*h,k=(u*d-f*h)/T,D=(f*j-u*h)/T,A=-k*d,_=function t(e){e=e-l;return k*e*e+D*e+A+c};var L=Tt(w,C,_);L.a=k;L.b=D-2*k*l;L.c=A-D*l+k*l*l+c;L.predict=_;L.rSquared=wt(a,t,e,x,_);return L}a.domain=function(t){return arguments.length?(s=t,a):s};a.x=function(e){return arguments.length?(t=e,a):t};a.y=function(t){return arguments.length?(e=t,a):e};return a}function _t(){var t=function t(e){return e[0]},e=function t(e){return e[1]},s=3,a;function o(o){if(s===1){var i=Dt().x(t).y(e).domain(a)(o);i.coefficients=[i.b,i.a];delete i.a;delete i.b;return i}if(s===2){var n=At().x(t).y(e).domain(a)(o);n.coefficients=[n.c,n.b,n.a];delete n.a;delete n.b;delete n.c;return n}var r=xt(o,t,e),l=gt(r,4),c=l[0],p=l[1],d=l[2],h=l[3],m=c.length,f=[],u=[],g=s+1;var y=0,b=0,v=a?+a[0]:Infinity,x=a?+a[1]:-Infinity;St(o,t,e,(function(t,e){++b;y+=(e-y)/b;if(!a){if(t<v)v=t;if(t>x)x=t}}));var S,w,C,j,T;for(S=0;S<g;++S){for(C=0,j=0;C<m;++C){j+=Math.pow(c[C],S)*p[C]}f.push(j);T=new Float64Array(g);for(w=0;w<g;++w){for(C=0,j=0;C<m;++C){j+=Math.pow(c[C],S+w)}T[w]=j}u.push(T)}u.push(f);var k=Mt(u),D=function t(e){e-=d;var s=h+k[0]+k[1]*e+k[2]*e*e;for(S=3;S<g;++S){s+=k[S]*Math.pow(e,S)}return s},A=Tt(v,x,D);A.coefficients=Lt(g,k,-d,h);A.predict=D;A.rSquared=wt(o,t,e,y,D);return A}o.domain=function(t){return arguments.length?(a=t,o):a};o.x=function(e){return arguments.length?(t=e,o):t};o.y=function(t){return arguments.length?(e=t,o):e};o.order=function(t){return arguments.length?(s=t,o):s};return o}function Lt(t,e,s,a){var o=Array(t);var i,n,r,l;for(i=0;i<t;++i){o[i]=0}for(i=t-1;i>=0;--i){r=e[i];l=1;o[i]+=r;for(n=1;n<=i;++n){l*=(i+1-n)/n;o[i-n]+=r*Math.pow(s,n)*l}}o[0]+=a;return o}function Mt(t){var e=t.length-1,s=[];var a,o,i,n,r;for(a=0;a<e;++a){n=a;for(o=a+1;o<e;++o){if(Math.abs(t[a][o])>Math.abs(t[a][n])){n=o}}for(i=a;i<e+1;++i){r=t[i][a];t[i][a]=t[i][n];t[i][n]=r}for(o=a+1;o<e;++o){for(i=e;i>=a;i--){t[i][o]-=t[i][a]*t[a][o]/t[a][a]}}}for(o=e-1;o>=0;--o){r=0;for(i=o+1;i<e;++i){r+=t[i][o]*s[i]}s[o]=(t[e][o]-r)/t[o][o]}return s}function Ot(t){P(t);t.render=function(){const e=t.mainDiv.selectAll(":scope > div").data(t.charts,(t=>t?.id));e.exit().remove();e.each(t.renderChart);e.enter().append("div").style("vertical-align","top").each(t.renderChart)};t.renderChart=function(e){e.chartDiv=a(this);const o=t.settings;e.chartDiv.style("opacity",0).style("display","inline-block");e.chartDiv.on("mouseover",(s=>{if(!t.onClick)t.showTooltip(s,e)}));e.chartDiv.on("click",(s=>t.showTooltip(s,e)));e.svg=e.chartDiv.select("svg").empty()?e.chartDiv.append("svg"):e.chartDiv.select("svg");s(e,o);e.chartDiv.transition().duration(o.duration).style("opacity",1)};t.initAxes=function(e){if(e.data.samples.length==0)return;e.xAxisScale=l().domain([e.xMin,e.xMax]).range([t.axisOffset.x,t.settings.svgw+t.axisOffset.x]);e.axisBottom=F(e.xAxisScale);e.yAxisScale=l().domain([e.yMax,e.yMin]).range([t.axisOffset.y,t.settings.svgh+t.axisOffset.y]);e.zAxisScale=l().domain([e.zMin,e.zMax]).range([0,t.settings.svgd]);e.xScaleMin=e.xAxisScale(e.xMin);e.xScaleMax=e.xAxisScale(e.xMax);e.yScaleMin=e.xAxisScale(e.yMin);e.yScaleMax=e.yAxisScale(e.yMax);e.zScaleMin=e.xAxisScale(e.zMin);e.zScaleMax=e.zAxisScale(e.zMax);e.axisLeft=H(e.yAxisScale);const s=t.config.settings.sampleScatter.defaultColor;if(!t.config.startColor)t.config.startColor=t.config.stopColor={};if(!t.config.startColor[e.id]){t.config.startColor[e.id]=c(s).brighter().brighter().toString()}if(!t.config.stopColor[e.id]){t.config.stopColor[e.id]=c(s).darker().toString()}if(t.config.colorTW?.q.mode==="continuous"){const[s,a]=e.cohortSamples.filter((e=>!t.config.colorTW.term.values||!(e.category in t.config.colorTW.term.values))).reduce(((t,e)=>[e.category<t[0]?e.category:t[0],e.category>t[1]?e.category:t[1]]),[e.cohortSamples[0].category,e.cohortSamples[0].category]);e.colorGenerator=l().domain([s,a]).range([t.config.startColor[e.id],t.config.stopColor[e.id]])}};function s(e,s){const a=e.svg;let n=Math.min(20*40/e.colorLegend.size,25);if(n<12)n=12;let r=e.colorLegend.size*n;if(e.colorLegend.get("Ref")?.sampleCount>0)r+=60;const l=t.config.scaleDotTW?200:100;t.legendHeight=Math.max(r,e.shapeLegend.size*30)+l;const c=t.charts.length==1?s.svgw+800:s.svgw+(t.config.shapeTW?600:350);a.transition().duration(s.duration).attr("width",c).attr("height",Math.max(s.svgh+100,t.legendHeight));o(e);if(t.is3D)t.render3DSerie(e);else if(t.is2DLarge)t.render2DSerieLarge(e);else{i(e,s.duration);t.renderLegend(e,n)}}function o(e){const s=e.svg;let a,o,i;if(s.select(".sjpcb-scatter-mainG").size()==0){e.mainG=s.append("g").attr("class","sjpcb-scatter-mainG");a=s.append("g").attr("class","sjpcb-scatter-axis");o=s.append("g").attr("class","sjpcb-scatter-labelsG");e.xAxis=a.append("g").attr("class","sjpcb-scatter-x-axis");e.yAxis=a.append("g").attr("class","sjpcb-scatter-y-axis").attr("transform",`translate(${t.axisOffset.x}, 0)`);e.mainG.append("rect").attr("class","zoom").attr("x",t.axisOffset.x).attr("y",t.axisOffset.y-t.settings.size).attr("width",t.settings.svgw).attr("height",t.settings.svgh).attr("fill","white");e.serie=e.mainG.append("g").attr("class","sjpcb-scatter-series");e.regressionG=e.mainG.append("g").attr("class","sjpcb-scatter-lowess");const n=`${Date.now()}`;const r=`sjpp_clip_${n}`;t.defs=s.append("defs");i=t.defs.append("clipPath").attr("id",r).append("rect");const l=t.defs.append("linearGradient").attr("id",`linear-gradient-${e.id}`).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.startGradient[e.id]=l.append("stop").attr("offset","0%").attr("stop-color",t.config.startColor[e.id]);t.stopGradient[e.id]=l.append("stop").attr("offset","100%").attr("stop-color",t.config.stopColor[e.id]);e.mainG.attr("clip-path",`url(#${r})`);e.legendG=s.append("g").attr("class","sjpcb-scatter-legend")}else{e.mainG=s.select(".sjpcb-scatter-mainG");e.serie=e.mainG.select(".sjpcb-scatter-series");e.regressionG=e.mainG.select(".sjpcb-scatter-lowess");a=s.select(".sjpcb-scatter-axis");o=s.select(".sjpcb-scatter-labelsG");e.xAxis=a.select(".sjpcb-scatter-x-axis");e.yAxis=a.select(".sjpcb-scatter-y-axis");e.legendG=s.select(".sjpcb-scatter-legend");i=s.select(`defs > clipPath > rect`)}e.xAxis.attr("transform",`translate(0, ${t.settings.svgh+t.axisOffset.y})`);e.legendG.attr("transform",`translate(${t.settings.svgw+t.axisOffset.x+50}, 20)`);if(e.axisBottom){e.xAxis.call(e.axisBottom);e.yAxis.call(e.axisLeft)}const n=Math.sqrt(t.settings.size);if(t.settings.showAxes&&!(t.is2DLarge||t.is3D)){i.attr("x",t.axisOffset.x).attr("y",0).attr("width",t.settings.svgw+2*n).attr("height",t.settings.svgh+t.axisOffset.y);a.style("opacity",1);if(t.config.term){let s=t.config.term.term.name;if(!t.config.colorTW&&!t.config.shapeTW&&!t.config.term0)s=`${s}, n=${e.cohortSamples.length}`;o.selectAll("*").remove();o.append("text").attr("transform",`translate(${t.axisOffset.x+t.settings.svgw/2}, ${t.settings.svgh+t.axisOffset.y+40})`).attr("text-anchor","middle").text(s);if(t.config.term0&&!t.config.colorTW&&!t.config.shapeTW){const s=`${e.id}, n=${e.cohortSamples.length}`;o.append("text").attr("transform",`translate(${t.axisOffset.x+t.settings.svgw/2}, ${t.settings.svgh+t.axisOffset.y+65})`).attr("text-anchor","middle").text(s)}o.append("text").attr("transform",`translate(${t.axisOffset.x-50}, ${t.settings.svgh/2+t.axisOffset.y}) rotate(-90)`).attr("text-anchor","middle").text(t.config.term2.term.name)}}else{a.style("opacity",0);i.attr("x",t.axisOffset.x-n).attr("y",0).attr("width",t.settings.svgw+2*n).attr("height",t.settings.svgh+t.axisOffset.y+n)}}function i(e,s){if(t.canvas)t.canvas.remove();const a=e.serie;const o=e.data;const i=a.selectAll('path[name="serie"]').data(o.samples);i.exit().remove();i.transition().duration(s).attr("name","serie").attr("transform",(s=>t.transform(e,s))).attr("d",(s=>t.getShape(e,s))).attr("fill",(s=>t.getColor(s,e))).attr("stroke",(s=>t.getColor(s,e))).attr("stroke-width",(e=>t.getStrokeWidth(e))).style("fill-opacity",(e=>t.getOpacity(e)));i.enter().append("path").attr("name","serie").attr("transform",(s=>t.transform(e,s))).attr("d",(s=>t.getShape(e,s))).attr("fill",(s=>t.getColor(s,e))).attr("stroke",(s=>t.getColor(s,e))).attr("stroke-width",(e=>t.getStrokeWidth(e))).style("fill-opacity",(e=>t.getOpacity(e))).transition().duration(s);t.mayRenderRegression()}t.getStrokeWidth=function(e){const s=t.getOpacity(e);if(s<=.2)return 0;if(s==1.2)return 2;return 1};t.processData=async function(){for(const e of t.charts){t.initAxes(e);const s=t.config.settings.sampleScatter.regression;if(!s||s=="None")continue;let a;const o=[];await e.cohortSamples.forEach((t=>{const s=e.xAxisScale(t.x);const a=e.yAxisScale(t.y);o.push({x:s,y:a})}));let i;if(s=="Polynomial"){a=_t().x((t=>t.x)).y((t=>t.y)).order(3);i=a(o)}else if(s=="Lowess"){const e=[],s=[];for(const t of o){e.push(t.x);s.push(t.y)}i=await t.app.vocabApi.getLowessCurve({coords:{X:e,Y:s}})}else{throw`unsupported regression type='${s}'`}e.regressionCurve=i}};t.mayRenderRegression=async function(){for(const e of t.charts){e.regressionG?.selectAll("*").remove();if(e.regressionCurve){const t=B().x((t=>t[0])).y((t=>t[1]));const s=e.regressionG.append("path");s.attr("d",t(e.regressionCurve)).attr("stroke","blue").attr("fill","none").style("stroke-width","2")}}};t.getColor=function(e,s){if(t.config.colorTW?.q.mode=="continuous"&&"sampleId"in e){const t=s.colorGenerator(e.category);return t}if(e.category=="Default")return t.config.settings.sampleScatter.defaultColor;const a=s.colorLegend.get(e.category);return a.color};t.getOpacity=function(e){if("sampleId"in e){if(t.filterSampleStr){if(!e.sample?.toLowerCase().includes(t.filterSampleStr.toLowerCase()))return.2;else return 1.2}const s=e.hidden?.["category"]||e.hidden?.["shape"]?0:t.settings.opacity;return s}const s=t.settings.showRef?t.settings.opacity:0;return s};t.getShape=function(t,e,s=1){const a=t.shapeLegend.get(e.shape).shape%Vt.length;return Vt[a]};t.transform=function(e,s,a=1){const o=e.xAxisScale(s.x);const i=e.yAxisScale(s.y);const n=!("sampleId"in s);let r;if(!t.config.scaleDotTW||n){r="sampleId"in s?t.settings.size:t.settings.refSize}else{const a=t.settings.maxShapeSize-t.settings.minShapeSize;if(t.settings.scaleDotOrder=="Ascending")r=t.settings.minShapeSize+(s.scale-e.scaleMin)/(e.scaleMax-e.scaleMin)*a;else r=t.settings.maxShapeSize-(s.scale-e.scaleMin)/(e.scaleMax-e.scaleMin)*a}const l=`translate(${o},${i}) scale(${t.zoom*r*a/3})`;return l};t.lassoReset=e=>{const s=e.chartDiv.select(".sjpcb-scatter-mainG");if(e.lasso)e.lasso.items(s.select(".sjpcb-scatter-series").selectAll('path[name="serie"]')).targetArea(s).on("start",a).on("draw",o).on("end",i);function a(s){if(t.lassoOn){e.lasso.items().attr("transform",(s=>t.transform(e,s,1/2))).style("fill-opacity",(e=>t.getOpacity(e)!=0?.5:0)).classed("not_possible",true).classed("selected",false)}}function o(s){if(t.lassoOn){e.lasso.possibleItems().attr("transform",(s=>t.transform(e,s,1.2))).style("fill-opacity",(e=>t.getOpacity(e))).classed("not_possible",false).classed("possible",true);e.lasso.notPossibleItems().attr("transform",(s=>t.transform(e,s,1/2))).style("fill-opacity",(e=>t.getOpacity(e)!=0?.5:0)).classed("not_possible",true).classed("possible",false)}}function i(s){if(t.lassoOn){e.lasso.items().classed("not_possible",false).classed("possible",false);e.lasso.selectedItems().attr("transform",(s=>t.transform(e,s,1.3)));e.lasso.items().style("fill-opacity",(e=>t.getOpacity(e)));t.selectedItems=[];for(const s of e.lasso.selectedItems()){const e=s.__data__;if("sampleId"in e&&!(e.hidden["category"]||e.hidden["shape"]))t.selectedItems.push(s)}e.lasso.notSelectedItems().attr("transform",(s=>t.transform(e,s)));n(s.sourceEvent)}}function n(e){const s=t.selectedItems.map((t=>t.__data__));t.dom.tip.clear().hide();if(t.selectedItems.length==0)return;t.dom.tip.show(e.clientX,e.clientY);const a=t.dom.tip.d.append("div");a.append("div").attr("class","sja_menuoption sja_sharp_border").text(`List ${t.selectedItems.length} samples`).on("click",(e=>{t.dom.tip.hide();t.showTable({name:"Group "+(t.config.groups.length+1),items:s},e.clientX,e.clientY,true)}));a.append("div").attr("class","sja_menuoption sja_sharp_border").text("Add to a group").on("click",(async()=>{const e={name:"Group",items:s};const a=k([e]);const o=D(a);A(t.app,o,t.state.groups)}));a.append("div").attr("class","sja_menuoption sja_sharp_border").text("Add to a group and filter").on("click",(()=>{const e={name:"Group",items:s};const a=k([e]);const o=D(a);A(t.app,o,t.state.groups);t.addToFilter(a)}));if("sample"in s[0])a.append("div").attr("class","sja_menuoption sja_sharp_border").text("Show samples").on("click",(async e=>{const a=[];for(const t of s)a.push({sampleId:t.sampleId,sampleName:t.sample});t.app.dispatch({type:"plot_create",id:dt(),config:{chartType:"sampleView",samples:a}});t.dom.tip.hide()}))}if(t.lassoOn){s.on(".zoom",null);s.on("mousedown.drag",null);s.call(e.lasso)}};t.addGroup=async function(e){e.plotId=t.id;await t.app.vocabApi.addGroup(e);t.dom.tip.hide()};t.setTools=function(){if(!t.charts[0])return;const e=t.config.settings.controls.isOpen;const s=t.dom.toolsDiv.style("background-color","white");s.selectAll("*").remove();let a="block";if(e)a="inline-block";const o=s.insert("div").style("display",a).style("margin","20px").attr("name","sjpp-reset-btn");p["restart"](o,{handler:g,title:"Reset plot to defaults"});const i=s.insert("div").style("display",a).style("margin","20px").attr("name","sjpp-zoom-in-btn");p["zoomIn"](i,{handler:f,title:"Zoom in"});const n=s.insert("div").style("display",a).style("margin","20px").attr("name","sjpp-zoom-out-btn");p["zoomOut"](n,{handler:u,title:"Zoom out"});const r=s.insert("div").style("display",a).style("margin","20px");const l=s.insert("div").style("display",a).style("margin","20px");if(!(t.is2DLarge||t.is3D)){p["search"](r,{handler:e=>t.searchSample(e),title:"Search samples"});p["lasso"](l,{handler:y,enabled:t.lassoOn,title:"Select a group of samples"})}t.dom.groupDiv=s.insert("div").style("display",a).style("margin","20px");const c=t.charts[0].mainG;const h=S().scaleExtent([.5,t.config.scaleDotTW?4:10]).on("zoom",m).filter((t=>{if(t.type==="wheel")return t.ctrlKey;return true}));if(t.config.scaleDotTW&&t.zoom>4)g();c.call(h);for(const e of t.charts){e.lasso=w();t.lassoReset(e)}t.updateGroupsButton();t.settings;function m(e){for(const s of t.charts){const a=e.transform.rescaleX(s.xAxisScale);const o=e.transform.rescaleY(s.yAxisScale);s.xAxis.call(s.axisBottom.scale(a));s.yAxis.call(s.axisLeft.scale(o));s.serie.attr("transform",e.transform);t.zoom=e.transform.scale(1).k;const i=s.serie.selectAll('path[name="serie"');i.attr("transform",(e=>t.transform(s,e,1)));if(t.lassoOn)s.lasso.selectedItems().attr("transform",(e=>t.transform(s,e,1.2)));if(t.config.scaleDotTW)t.drawScaleDotLegend(s)}}function f(){for(const e of t.charts)if(t.is2DLarge)t.zoom=t.zoom+.25;else h.scaleBy(e.mainG.transition().duration(750),1.5)}function u(){for(const e of t.charts)if(t.is2DLarge)t.zoom=t.zoom-.25;else h.scaleBy(e.mainG.transition().duration(750),.5)}function g(){for(const e of t.charts)if(t.is2DLarge)t.zoom=1;else e.mainG.transition().duration(750).call(h.transform,d);t.render()}function y(){t.lassoOn=!t.lassoOn;for(const e of t.charts){if(t.lassoOn){e.mainG.on(".zoom",null);e.mainG.call(e.lasso)}else{e.mainG.on("mousedown.drag",null);e.lasso.items().classed("not_possible",false);e.lasso.items().classed("possible",false);e.lasso.items().attr("r",t.settings.size).style("fill-opacity",(e=>t.getOpacity(e)));e.mainG.call(h);t.selectedItems=null}}l.select("*").remove();p["lasso"](l,{handler:y,enabled:t.lassoOn})}};t.updateGroupsButton=function(){t.dom.groupDiv.selectAll("*").remove();t.dom.tip.hide();if(t.config.groups.length==0)return;t.dom.groupDiv.append("button").style("border","none").style("background","transparent").style("padding",0).append("div").style("font-size","1.1em").html(`&#931${t.config.groups.length+1};`).on("click",(e=>{if(t.config.groups.length==1)t.showGroupMenu(e,t.config.groups[0]);else t.showGroupsMenu(e)}))};t.renderLegend=function(e,s){const a=e.legendG;a.selectAll("*").remove();let o=0;let i=25;if(!t.config.colorTW&&!t.config.shapeTW&&!t.config.colorColumn){if(t.config.scaleDotTW){e.scaleG=a.append("g").attr("transform",`translate(${o+45},${t.legendHeight-150})`);t.drawScaleDotLegend(e)}return}let n;let r=Math.min(.8,20/e.colorLegend.size);if(r<.5)r=.5;const p=a.style("font-size",`${r}em`);let d=t.config.term0?`${e.id}, n=${e.cohortSamples.length}`:`${e.cohortSamples.length} ${t.config.sampleType?t.config.sampleType+"s":"samples"}`;if(t.filterSampleStr)d+=`, search = ${t.filterSampleStr}`;p.append("text").attr("x",0).attr("y",i).text(d).style("font-weight","bold");i+=s+10;if(t.config.colorTW||t.config.colorColumn){n=`${h(t.config.colorTW?.term?.name||t.config.colorColumn.name,t.config.shapeTW==undefined)}`;const r=e.colorLegend.get("Ref");if(t.config.colorTW?.term?.type=="geneVariant"&&t.config.colorTW?.q.type=="values")i=t.renderGeneVariantLegend(e,o,i,a,t.config.colorTW,"category",e.colorLegend);else{p.append("text").attr("id","legendTitle").attr("x",o).attr("y",i).text(n).style("font-weight","bold");i+=s;if(t.config.colorTW?.q?.mode==="continuous"){const a=150;const[o,n]=e.colorGenerator.domain();const r=l().domain([o,n]).range([0,a]);const c=(n-o)/4;const d=[o,o+c,o+2*c,o+3*c,n];const h=U(r).tickValues(d);p.append("g").attr("transform",`translate(0, 100)`).call(h);e.startRect=p.append("rect").attr("x",-25).attr("y",100).attr("width",20).attr("height",20).style("fill",t.config.startColor[e.id]).on("click",(s=>t.editColor(e,"startColor",e.startRect)));e.stopRect=p.append("rect").attr("x",a+5).attr("y",100).attr("width",20).attr("height",20).style("fill",t.config.stopColor[e.id]).on("click",(s=>t.editColor(e,"stopColor",e.stopRect)));p.append("rect").attr("x",0).attr("y",100).attr("width",a).attr("height",20).style("fill",`url(#linear-gradient-${e.id})`);i+=s}else{for(const[n,r]of e.colorLegend){if(n=="Ref")continue;const l=n;const c=t.config.colorTW?.q.hiddenValues?n in t.config.colorTW.q.hiddenValues:false;const[d,h]=m(p,r,l,o,i,c);if(!t.config.colorColumn){d.on("click",(s=>t.onLegendClick(e,a,"colorTW",n,s,r)));h.on("click",(s=>t.onLegendClick(e,a,"colorTW",n,s,r)))}i+=s}}}if(r?.sampleCount>0){i=i+s;const n=a.append("g");n.append("text").attr("x",o).attr("y",i).text("Reference").style("font-weight","bold");i=i+s;const l=a.append("g");l.append("path").attr("transform",(t=>`translate(${o-2}, ${i-5}) scale(0.5)`)).style("fill",r.color).attr("d",Vt[0]).style("stroke",c(r.color).darker());l.on("click",(s=>t.onLegendClick(e,a,"colorTW","Ref",s,r)));const p=a.append("g").append("text").attr("x",o+10).attr("y",i).text(`n=${r.sampleCount}`).style("text-decoration",!t.settings.showRef?"line-through":"none").attr("alignment-baseline","middle");p.on("click",(s=>t.onLegendClick(e,a,"colorTW","Ref",s,r)))}}if(t.config.scaleDotTW){e.scaleG=a.append("g").attr("transform",`translate(${o},${t.legendHeight-100})`);t.drawScaleDotLegend(e)}if(t.config.shapeTW){o=!t.config.colorTW?0:300;i=60;n=`${h(t.config.shapeTW.term.name)}`;if(t.config.shapeTW.term.type=="geneVariant"&&t.config.shapeTW.q.type=="values")t.renderGeneVariantLegend(e,o,i,a,t.config.shapeTW,"shape",e.shapeLegend);else{const r=a.append("g");r.append("text").attr("x",o).attr("y",i).text(n).style("font-weight","bold");i+=s;const l="gray";for(const[n,p]of e.shapeLegend){if(n=="Ref")continue;const d=p.shape%Vt.length;const h=Vt[d];const m=n;const f=p.sampleCount;const u=t.config.shapeTW.q.hiddenValues?n in t.config.shapeTW.q.hiddenValues:false;const g=r.append("g");g.append("path").attr("transform",(t=>`translate(${o}, ${i-5}) scale(0.5)`)).style("fill",l).attr("d",h).style("stroke",c(l).darker());g.append("text").attr("x",o+10).attr("y",i).text(`${m}, n=${f}`).style("text-decoration",u?"line-through":"none").attr("alignment-baseline","middle");i+=s;g.on("click",(s=>t.onLegendClick(e,a,"shapeTW",n,s,p)))}}}function h(t,e=false){if(t.length>25&&!e)t=t.slice(0,25)+"...";return t}function m(s,o,i,n,r,l=false){Math.min(5*40/e.colorLegend.size,5);const p=s.append("g");p.append("path").attr("d",Vt[0]).attr("transform",`translate(${n-2}, ${r-5}) scale(0.5)`).style("fill",o.color).style("stroke",c(o.color).darker());if(!t.config.colorColumn)p.on("click",(s=>t.onLegendClick(e,a,"colorTW",key,s,o)));const d=s.append("g");d.append("text").attr("name","sjpp-scatter-legend-label").attr("x",n+10).attr("y",r).text(`${i}, n=${o.sampleCount}`).style("text-decoration",l?"line-through":"none").attr("alignment-baseline","middle");return[p,d]}};t.drawScaleDotLegend=function(s){const o=s.scaleG;o.selectAll("*").remove();const i=70;const n=t.settings.minShapeSize/3;const r=t.settings.maxShapeSize/3;const l=t.settings.scaleDotOrder;const c=l=="Ascending";const p=o.append("g");p.append("text").text(t.config.scaleDotTW.term.name).style("font-weight","bold");const d=b(s.scaleMin).toString();const h=b(s.scaleMax).toString();const m=30;const f=40;const u=16;const g=u*n;const y=u*r;const v=g/2;const x=y/2;const S=o.append("g").attr("transform",`translate(${m},${f})`);const w=30;S.append("path").attr("d",Vt[0]).style("fill","#aaa").style("stroke","#aaa").attr("transform",`translate(${c?-v:-x}, ${c?-v:-x}) scale(${c?n:r})`);const C=o.append("g").attr("transform",`translate(${i+m},${f})`);C.append("path").attr("d",Vt[0]).style("fill","#aaa").style("stroke","#aaa").attr("transform",`translate(${c?-x:-v}, ${c?-x:-v}) scale(${c?r:n})`);S.append("text").attr("x",c?-v-w:-x-w).attr("y",5).style("font-size",".8em").attr("text-anchor","start").text(d);C.append("text").attr("x",c?y+5:g+5).attr("y",5).style("font-size",".8em").text(h);S.append("line").attr("x1",0).attr("y1",c?v:x).attr("x2",i).attr("y2",c?x:v).style("stroke","#aaa");S.append("line").attr("x1",0).attr("y1",c?-v:-x).attr("x2",i).attr("y2",c?-x:-v).style("stroke","#aaa");o.append("rect").attr("width",110*t.zoom).attr("height",50).attr("fill","transparent").on("click",(s=>{const o=new e({padding:"3px"});const i=o.d;i.append("label").text("Min:");const n=i.append("input").attr("type","number").attr("min","1").attr("max","100").style("width","50px").attr("value",t.settings.minShapeSize).on("change",(()=>{let e=parseFloat(n.node().value);if(e<Rt){e=Rt;n.node().value=Rt}t.config.settings.sampleScatter.minShapeSize=e;t.app.dispatch({type:"plot_edit",id:t.id,config:t.config})}));i.append("label").text("Max:");const r=i.append("input").attr("type","number").attr("min","1").attr("max","1000").style("width","50px").attr("value",t.settings.maxShapeSize).on("change",(()=>{let e=parseFloat(r.node().value);if(e>qt){e=qt;r.node().value=qt}t.config.settings.sampleScatter.maxShapeSize=e;t.app.dispatch({type:"plot_edit",id:t.id,config:t.config})}));const c=o.d.append("div");c.append("label").text("Order: ");const p=["Ascending","Descending"];c.selectAll("input").data(p).enter().append("div").style("display","inline-block").each(d);function d(e){const s=a(this);const o=s.append("input").attr("type","radio").attr("id",e).attr("value",e).property("checked",(t=>t==l));s.append("label").text(e).attr("for",e);o.on("change",(e=>{t.config.settings.sampleScatter.scaleDotOrder=e.target.value;c.selectAll("input").nodes().find((t=>t.value!=e.target.value)).checked=false;t.app.dispatch({type:"plot_edit",id:t.id,config:t.config})}))}o.showunder(s.target)}))};t.editColor=function(s,a,o){const i=t.config[a][s.id];const n=new e({padding:"3px"});const r=n.clear().d.append("Label").text("Color:").append("input").attr("type","color").attr("value",c(i).formatHex()).on("change",(()=>{const e=r.node().value;t.changeGradientColor(s,a,o,e);n.hide()}));n.showunder(o.node(),false)};t.changeGradientColor=function(e,s,a,o){const i=c(o).formatHex();t.config[s][e.id]=i;a.style("fill",i);e.colorGenerator=l().range([t.config.startColor[e.id],t.config.stopColor[e.id]]);t.startGradient[e.id].attr("stop-color",t.config.startColor[e.id]);t.stopGradient[e.id].attr("stop-color",t.config.stopColor[e.id]);t.app.dispatch({type:"plot_edit",id:t.id,config:t.config})};t.renderGeneVariantLegend=function(e,s,a,o,i,n,r){const l=125;const p=i.term.name.length>25?i.term.name.slice(0,25)+"...":i.term.name;let d=p;const f=o.append("g").style("font-size","0.9em");f.append("text").attr("id","legendTitle").attr("x",s).attr("y",a).text(d).style("font-weight","bold");s+=l;const u=e.cohortSamples[0]["cat_info"][n];for(const[p,d]of u.entries()){a+=25;const p=d.dt;const u=h[d.origin]?.label;const g=u?`${u[0]} ${m[p]}`:m[p];f.append("text").attr("x",s-l).attr("y",a).text(u?`${u} ${m[p]}`:m[p]).style("font-weight","bold");a+=25;for(const[p,d]of r){if(p=="Ref")continue;if(!p.includes(g))continue;const r=p.split(", ")[0];const h=f.append("g");if(n=="shape"){const t=d.shape%Vt.length;h.append("path").attr("transform",(t=>`translate(${s-l-2}, ${a-8}) scale(0.5)`)).style("fill","gray").attr("d",Vt[t]).style("stroke",c("gray").darker())}else{h.append("path").attr("d",Vt[0]).attr("transform",`translate(${-2}, ${a-8}) scale(0.5)`).style("fill",d.color).style("stroke",c(d.color).darker());h.on("click",(s=>t.onLegendClick(e,o,"colorTW",p,s,d)))}const m=i.q.hiddenValues?p in i.q.hiddenValues:false;f.append("g").append("text").attr("x",s-l+10).attr("y",a).attr("name","sjpp-scatter-legend-label").style("text-decoration",m?"line-through":"none").text(r+(p.includes(g)?`, n=${d.sampleCount}`:"")).on("click",(s=>t.onLegendClick(e,f,n=="shape"?"shapeTW":"colorTW",p,s,d)));a+=25}}return a}}var Wt=Object.freeze({__proto__:null,setRenderers:Ot});function zt(t){t.showTooltip=function(e,s){const a=e.type=="click";t.onClick=a;if(a)t.searchMenu?.hide();if(!(e.target.tagName=="path"&&e.target.getAttribute("name")=="serie")){if(t.onClick&&a){t.onClick=false;t.dom.tooltip.hide();return}if(!a){t.dom.tooltip.hide()}return}const o=e.target.__data__;const i="sample"in o;let n=10;n=n/t.zoom;const r=s.data.samples.filter((e=>{const a=$t(e.x,e.y,o.x,o.y,s);if(!("sampleId"in e)&&(!t.settings.showRef||t.settings.refSize==0))return false;return t.getOpacity(e)>0&&a<n}));r.sort(((e,s)=>{if(!("sampleId"in e))return 1;if(t.config.term){if(e.x<s.x)return-1;if(e.x>s.x)return 1;if(e.y<s.y)return-1;return 1}if(t.config.colorTW){if(t.config.colorTW.term.type=="categorical"){if(e.category.includes(f.WT.label)||e.category.includes(f.Blank.label))return 1}else{if(e.category<s.category)return-1;else if(e.category>s.category)return 1}}if(e.shape.includes(f.WT.label)||e.shape.includes(f.Blank.label))return 1;return-1}));if(r.length==0)return;const l=[];const p=t.config.term?true:false;const d=t=>`${t.x.toPrecision(2)},${t.y.toPrecision(2)}`;for(const t of r){const e=d(t);let s=l.find((t=>t.id==e));if(!s){s={id:e,parentId:null,samples:[t],level:1,category:null,children:[]};l.push(s);if(p){const a=j("x",t);const o={id:a,parentId:e,samples:[t],level:2,category:"X",children:[],value:a};l.push(o);s.children.push(o);const i=j("y",t);const n={id:`${i}${a}`,parent:o,parentId:a,samples:[t],level:3,category:"Y",children:[],value:i};o.children.push(n);l.push(n);s.xnode=o;s.ynode=n}}else{s.samples.push(t);if(p){s.xnode.samples.push(t);s.ynode.samples.push(t)}}}let h=p?4:2;let m=p?["y","x",""]:[""];if(t.config.colorTW)C("category",t.config.colorTW);if(t.config.shapeTW)C("shape",t.config.shapeTW,t.config.colorTW);if(t.config.scaleDotTW)C("scale",t.config.scaleDotTW,t.config.shapeTW);t.dom.tooltip.clear();const u=t.dom.tooltip.d.style("padding","5px");const g=t.state.termdbConfig.queries?.singleSampleGenomeQuantification;const y=t.state.termdbConfig.queries?.singleSampleMutation;if(r.length>1)u.append("div").style("color","#aaa").style("padding","3px").style("font-weight","bold").html(`${r.length} Samples`);const b=u.append("div").style("max-height","400px").style("overflow","scroll");if(r.length>3)b.attr("class","sjpp_show_scrollbar");const v=b.append("table").style("width","100%");const x=l.filter((t=>p?t.level==1:t.level==2));if(p)for(const t of x){if(r.length>1)v.append("tr").append("td").attr("colspan",3).style("border-top","1px solid #aaa");for(const e of t.children){w(e)}}else for(const t of x){if(r.length>1)v.append("tr").append("td").attr("colspan",3).style("border-top","1px solid #aaa");w(t)}t.dom.tooltip.show(e.clientX,e.clientY,true,false);function S(e){const s=e=="category"?t.config.colorTW:e=="shape"?t.config.shapeTW:e=="scale"?t.config.scaleDotTW:e=="X"&&t.config.term?t.config.term:e=="Y"&&t.config.term2?t.config.term2:null;return s}function w(e){const o=S(e.category);e.added=true;let n;const l=e.samples[0];if(l.category!="Ref"){let n=v.append("tr");const p=o!=null&&(o==t.config.colorTW||o==t.config.shapeTW);let d=o?o.term.name:e.category;if(r.length>1&&!i)d=d+` (${e.samples.length})`;n.append("td").style("color","#aaa").text(d);const h=n.append("td");if(p){const i=o==t.config.colorTW?t.getColor(l,s):t.config.colorTW?"gray":t.settings.defaultColor;const r=o==t.config.colorTW?s.shapeLegend.get("Ref").shape%Vt.length:s.shapeLegend.get(l.shape).shape%Vt.length;const p=Vt[r];let m="black";const u=c("white").toString();if(o?.term.type=="geneVariant"&&o.q.type=="values"){for(const t in f){const s=f[t];if(e.value.includes(s.label)){if(c(s.color).toString()!=u)m=s.color;break}}if(a){n.append("td").append("button").text("Lollipop").on("click",(async e=>{await t.openLollipop(d);t.dom.tip.hide()}))}}let g=e.value.toString().length;const y=g*9+60;const b=h.append("svg").attr("width",y).attr("height","25px");const v=b.append("g").attr("transform","translate(10, 14)");v.append("path").attr("d",p).attr("fill",i).attr("stroke","#aaa").attr("transform","translate(0, -2) scale(0.5)");const x=v.append("text").attr("x",12).attr("y",6).attr("font-size","0.9em");x.append("tspan").text(e.value).attr("fill",m)}else h.style("padding","2px").text(`${e.value}`)}for(const t of e.children)if(!t.added)w(t);if(e.children.length==0&&i){for(const s of e.samples){if("info"in s)for(const[t,e]of Object.entries(s.info)){n=v.append("tr");n.append("td").style("color","#aaa").text(t);n.append("td").text(e)}n=v.append("tr");n.append("td").style("color","#aaa").text("Sample");n.append("td").style("padding","2px").text(s.sample);if("sampleId"in s&&a){n.append("td").append("button").text("Sample view").on("click",(e=>t.openSampleView(s)));if(y)n.append("td").append("button").text("Disco").on("click",(async e=>t.openDiscoPlot(s)));if(g)n.append("td").append("button").text("Met Array").on("click",(async e=>t.openMetArray(s)))}}}}function C(t,e,s){for(const a of r){const o=j(t,a,e);let i="";for(const t of m)i+=j(t,a,s);const n=o+i;let r=l.find((t=>t.id==n&&t.parentId==i));let c=l.find((t=>t.id==i));if(!r){r={id:n,parentId:i,samples:[],level:h,category:t,children:[],value:o};l.push(r)}r.samples.push(a);if(c)c.children.push(r)}h++;m.unshift(t)}function j(t,e,s){if(t=="")return"";let a=e[t];if(s?.term.type=="geneVariant"&&s.q.type=="values"){const s=a.split(", ")[0];for(const o in f){const i=f[o];if(s==i.label){const s=e.cat_info[t].find((t=>t.class==i.key)).mname;if(s)a=`${s} ${a}`}}}if(typeof a=="number"&&a%1!=0)a=a.toPrecision(2);return a}};t.openSampleView=function(e){t.dom.tooltip.hide();t.onClick=false;t.app.dispatch({type:"plot_create",id:dt(),config:{chartType:"sampleView",sample:{sampleId:e.sampleId,sampleName:e.sample}}});t.dom.tip.hide()};t.openMetArray=async function(e){t.dom.tooltip.hide();t.onClick=false;e.sample_id=e.sample;for(const s in t.state.termdbConfig.queries.singleSampleGenomeQuantification){const a=u(t.opts.plotDiv);a.header.text(e.sample_id);const o=await import("./plot.ssgq-d33113d5.js");await o.plotSingleSampleGenomeQuantification(t.state.termdbConfig,t.state.vocab.dslabel,s,e,a.body.append("div").style("margin","20px"),t.app.opts.genome)}t.dom.tip.hide()};t.openDiscoPlot=async function(e){t.dom.tooltip.hide();t.onClick=false;e.sample_id=e.sample;const s=u(t.opts.plotDiv);s.header.text(e.sample_id);const a=await import("./plot.disco-1fdfee3c.js");a.default(t.state.termdbConfig,t.state.vocab.dslabel,e,s.body,t.app.opts.genome)};t.openLollipop=async function(e){t.dom.tooltip.hide();t.onClick=false;const s=u(t.opts.plotDiv||select(t.opts.holder.node().parentNode));s.header.text(e);const a={holder:s.body.append("div").style("margin","20px"),genome:t.app.opts.genome,nobox:true,query:e,tklst:[{type:"mds3",dslabel:t.app.opts.state.vocab.dslabel,filter0:t.state.termfilter.filter0,filterObj:structuredClone(t.state.termfilter.filter)}]};const o=await import("./app-6fb77603.js").then((function(t){return t.c3}));await o.default(a)};t.onLegendClick=function(s,a,o,i,n,r){const l=t.config[o];const p=l.q.hiddenValues?i in l.q.hiddenValues:false;const d=new e({padding:"0px"});const h=d.d.append("div");h.append("div").attr("class","sja_menuoption sja_sharp_border").text(p?"Show":"Hide").on("click",(()=>{t.hideCategory(a,l,i,!p);d.hide();const e={};e[o]=l;t.app.dispatch({type:"plot_edit",id:t.id,config:e})}));h.append("div").attr("class","sja_menuoption sja_sharp_border").text("Show only").on("click",(()=>{const e=o=="colorTW"?s.colorLegend:s.shapeLegend;for(const s of e.keys())t.hideCategory(a,l,s,l.term.type=="geneVariant"&&l.q.type=="values"?!s.startsWith(i):s!=i);d.hide();const n={};n[o]=l;t.app.dispatch({type:"plot_edit",id:t.id,config:n})}));h.append("div").attr("class","sja_menuoption sja_sharp_border").text("Show all").on("click",(()=>{d.hide();const e=o=="colorTW"?s.colorLegend:s.shapeLegend;for(const s of e.keys())t.hideCategory(a,l,s,false);const i={};i[o]=l;t.app.dispatch({type:"plot_edit",id:t.id,config:i})}));if(r.color){const e=c(r.color).formatHex();const s=h.append("div").attr("class","sja_sharp_border").style("padding","0px 10px").text("Color:").append("input").attr("type","color").attr("value",e).on("change",(()=>{t.changeColor(i,s.node().value);d.hide()}))}d.showunder(n.target)};t.hideCategory=function(e,s,a,o){if(a=="Ref"){t.settings.showRef=!o;t.app.dispatch({type:"plot_edit",id:t.id,config:{settings:{sampleScatter:t.settings}}})}if(!s.q.hiddenValues)s.q.hiddenValues={};const i=!(s.term.type=="geneVariant"&&s.q.type=="values")&&s.term.values[a]?s.term.values[a]:{key:a,label:a};const n=e.selectAll(`text[name="sjpp-scatter-legend-label"]`).nodes();const r=n.find((t=>a.startsWith(t.innerHTML)))?.parentElement;if(r)r.style["text-decoration"]=o?"line-through":"none";if(!o)delete s.q.hiddenValues[a];else s.q.hiddenValues[a]=i};t.changeColor=async function(e,s){const a=t.config.colorTW;if(!(a.term.type=="geneVariant"&&a.q.type=="values")&&a.term.values[e])a.term.values[e].color=s;else{if(!a.term.values)a.term.values={};a.term.values[e]={key:e,label:e,color:s}}await t.app.dispatch({type:"plot_edit",id:t.id,config:{colorTW:a}})};t.searchSample=async function(s){if(!this.searchMenu){this.searchMenu=new e({padding:"3px"});this.samplesData=await this.app.vocabApi.getSamplesByName({filter:t.state.termfilter.filter});const s=t=>{};q(this.searchMenu.d,this.samplesData,s,(e=>t.filterSamples(e)))}this.searchMenu.show(s.clientX,s.clientY,false)};t.filterSamples=function(e){this.filterSampleStr=e;t.render()};t.getCategoryInfo=function(t,e){if(!(e in t))return"";return t[e]};t.addToFilter=function(e){const s=N(t.state.termfilter.filter,"filterUiRoot");const a=R([s,D(e)]);a.tag="filterUiRoot";t.app.dispatch({type:"filter_replace",filter:a})};t.showTable=function(e,s,a,o){let i=[];const n=[];const r=e.items[0];if("sample"in r)n.push(f("Sample","label"));if(t.config.colorTW)n.push(f(t.config.colorTW.term.name,"label"));if(t.config.shapeTW)n.push(f(t.config.shapeTW.term.name,"label"));let l=false;for(const s of e.items){const e=[];if("sample"in s)e.push(f(s.sample));if(t.config.colorTW)e.push(f(t.getCategoryInfo(s,"category")));if(t.config.shapeTW)e.push(f(t.getCategoryInfo(s,"shape")));if("info"in s){l=true;const t=[];for(const[e,a]of Object.entries(s.info))t.push(`${e}: ${a}`);e.push(f(t.join(", ")))}i.push(e)}if(l)n.push(f("Info","label"));t.dom.tip.clear();const c=t.dom.tip.d.append("div").style("padding","5px");const p=c.append("div").style("margin-top","5px");const d=p.append("div").html("&nbsp;"+e.name).style("font-size","0.9rem").on("click",(()=>{const s=d.select("input").empty();if(!s)return;d.html("");const a=d.append("input").attr("value",e.name).on("change",(async()=>{const s=a.node().value;if(s)t.renameGroup(e,s);else a.node().value=e.name;d.html("&nbsp;"+e.name)}));a.node().focus();a.node().select()}));const h=c.append("div");const m=[];if(o){const e={text:"Add to a group",callback:e=>{const s=[];for(const a of e)s.push(t.selectedItems[a].__data__);const a={name:`Group ${t.config.groups.length+1}`,items:s,index:t.config.groups.length};const o=D(k([a]));A(t.app,o,t.state.groups)}};m.push(e)}else{const i={text:"Delete samples",callback:i=>{e.items=e.items.filter(((t,e,s)=>!(e in i)));t.showTable(e,s,a,o)}};m.push(i)}I({rows:i,columns:n,div:h,showLines:true,maxWidth:n.length*"15"+"vw",maxHeight:"35vh",buttons:m,selectAll:true});t.dom.tip.show(s,a,false,false);function f(t,e="value"){let s={};s[e]=t;return s}};t.showGroupMenu=function(e,s){t.dom.tip.clear();t.dom.tip.show(e.clientX,e.clientY,false,true);const a=t.dom.tip.d.append("div");const o=t.config.name?t.config.name:"Summary scatter";const i=k([s],o+" groups");const n=a.append("div").attr("name","sjpp-group-input-div").html("&nbsp;"+s.name).style("font-size","0.9rem").on("click",(()=>{const e=n.select("input").empty();if(!e)return;n.html("");const a=n.append("input").attr("value",s.name).on("change",(async()=>{const e=a.node().value;if(e)t.renameGroup(s,e);else a.node().value=s.name;n.html("&nbsp;"+s.name)}));a.node().focus();a.node().select()}));a.append("div").attr("class","sja_menuoption sja_sharp_border").text(`Edit ${s.items.length} samples`).on("click",(a=>{t.dom.tip.hide();t.showTable(s,e.clientX,e.clientY,false)}));t.addCommonMenuItems(a,i);a.append("div").attr("class","sja_menuoption sja_sharp_border").text(`Delete group`).on("click",(async e=>{await t.app.vocabApi.deleteGroup(s.name);t.dom.tip.hide()}));a.append("div").attr("class","sja_menuoption sja_sharp_border").text("Add to filter").on("click",(()=>{t.addToFilter(i);t.app.dispatch({type:"plot_edit",id:t.id,config:{groups:t.config.groups}})}));a.append("div").attr("class","sja_menuoption sja_sharp_border").text(s.showOnly?"Show All":"Show Only").on("click",(()=>{s.showOnly=!s.showOnly;t.app.dispatch({type:"plot_edit",id:t.id,config:{groups:t.config.groups}})}))};t.renameGroup=async function(e,s){const a=t.config.groups.findIndex((t=>t.name==s));if(a!=-1)alert(`Group named ${s} already exists`);else await t.app.dispatch({type:"rename_group",index:e.index,newName:s})};t.addCommonMenuItems=function(e,s){_(t.dom.tip,e,s,t.app,t.id,t.state);if(t.state.supportedChartTypes.includes("survival"))L("survival",e,"Compare survival",t.dom.tip,s,t.id,this);if(t.state.supportedChartTypes.includes("cuminc"))L("cuminc",e,"Compare cumulative incidence",t.dom.tip,s,t.id,this);const a=e.append("div").attr("class","sja_menuoption sja_sharp_border").html("Summarize");a.insert("div").html("›").style("float","right");a.on("click",(async e=>{M(a,(e=>{O(e,s,t.app,t.id)}),t.app,t.dom.tip)}))};t.showGroupsMenu=function(e){t.dom.tip.clear();t.dom.tip.show(e.clientX,e.clientY,false,true);const s=t.dom.tip.d.append("div");const a=t.config.name?t.config.name:"Summary scatter";const o=k(t.config.groups,a+" groups");let i=s.append("div");for(const[a,o]of t.config.groups.entries()){i=s.append("div").attr("class","sja_menuoption sja_sharp_border");i.insert("div").style("display","inline-block").text(` ${o.name}: ${o.items.length} `);i.append("div").style("display","inline-block").style("float","right").html("&nbsp;&nbsp;›");i.on("click",(s=>{t.dom.tip.clear().hide();t.showGroupMenu(e,o)}))}t.addCommonMenuItems(s,o);i=s.append("div").attr("class","sja_menuoption sja_sharp_border").text("Delete groups").on("click",(async e=>{for(const e of t.config.groups)await t.app.vocabApi.deleteGroup(e.name);t.app.dispatch({type:"plot_edit",id:t.id,config:{groups:[]}})}))}}function $t(t,e,s,a,o){const i=o.xAxisScale(s)-o.xAxisScale(t);const n=o.yAxisScale(a)-o.yAxisScale(e);const r=Math.sqrt(Math.pow(i,2)+Math.pow(n,2));return r}var It=Object.freeze({__proto__:null,setInteractivity:zt});const Nt={filledCircle:"M 8,8 m 8,0 a 8,8 0 1,0 -16,0 a 8,8 0 1,0 16,0",emptyVerticalRectangle:"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1",emptyCircle:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16",emptyShield:"M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56",filledTriangle:"M7.022 1.566a1.13 1.13 0 0 1 1.96 0l6.857 11.667c.457.778-.092 1.767-.98 1.767H1.144c-.889 0-1.437-.99-.98-1.767z",emptyTriangle:"M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.15.15 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.2.2 0 0 1-.054.06.1.1 0 0 1-.066.017H1.146a.1.1 0 0 1-.066-.017.2.2 0 0 1-.054-.06.18.18 0 0 1 .002-.183L7.884 2.073a.15.15 0 0 1 .054-.057m1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767z",filledShield:"M5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56",filledDiamond:"M6.95.435c.58-.58 1.52-.58 2.1 0l6.515 6.516c.58.58.58 1.519 0 2.098L9.05 15.565c-.58.58-1.519.58-2.098 0L.435 9.05a1.48 1.48 0 0 1 0-2.098z",largeCross:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z",emptyDiamond:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z",plusIcon:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2",filledEgg:"M14 10a6 6 0 0 1-12 0C2 5.686 5 0 8 0s6 5.686 6 10",filledPentagon:"M7.685.256a.5.5 0 0 1 .63 0l7.421 6.03a.5.5 0 0 1 .162.538l-2.788 8.827a.5.5 0 0 1-.476.349H3.366a.5.5 0 0 1-.476-.35L.102 6.825a.5.5 0 0 1 .162-.538l7.42-6.03Z",emptyEgg:"M8 15a5 5 0 0 1-5-5c0-1.956.69-4.286 1.742-6.12.524-.913 1.112-1.658 1.704-2.164C7.044 1.206 7.572 1 8 1s.956.206 1.554.716c.592.506 1.18 1.251 1.704 2.164C12.31 5.714 13 8.044 13 10a5 5 0 0 1-5 5m0 1a6 6 0 0 0 6-6c0-4.314-3-10-6-10S2 5.686 2 10a6 6 0 0 0 6 6",emptyPentagon:"M7.685 1.545a.5.5 0 0 1 .63 0l6.263 5.088a.5.5 0 0 1 .161.539l-2.362 7.479a.5.5 0 0 1-.476.349H4.099a.5.5 0 0 1-.476-.35L1.26 7.173a.5.5 0 0 1 .161-.54l6.263-5.087Zm8.213 5.28a.5.5 0 0 0-.162-.54L8.316.257a.5.5 0 0 0-.631 0L.264 6.286a.5.5 0 0 0-.162.538l2.788 8.827a.5.5 0 0 0 .476.349h9.268a.5.5 0 0 0 .476-.35l2.788-8.826Z",filledDiamondSuit:"M2.45 7.4 7.2 1.067a1 1 0 0 1 1.6 0L13.55 7.4a1 1 0 0 1 0 1.2L8.8 14.933a1 1 0 0 1-1.6 0L2.45 8.6a1 1 0 0 1 0-1.2",emptySquare:"M6.95.435c.58-.58 1.52-.58 2.1 0l6.515 6.516c.58.58.58 1.519 0 2.098L9.05 15.565c-.58.58-1.519.58-2.098 0L.435 9.05a1.48 1.48 0 0 1 0-2.098zm1.4.7a.495.495 0 0 0-.7 0L1.134 7.65a.495.495 0 0 0 0 .7l6.516 6.516a.495.495 0 0 0 .7 0l6.516-6.516a.495.495 0 0 0 0-.7L8.35 1.134z",emptyDiamondSuit:"M8.384 1.226a.463.463 0 0 0-.768 0l-4.56 6.468a.54.54 0 0 0 0 .612l4.56 6.469a.463.463 0 0 0 .768 0l4.56-6.469a.54.54 0 0 0 0-.612zM6.848.613a1.39 1.39 0 0 1 2.304 0l4.56 6.468a1.61 1.61 0 0 1 0 1.838l-4.56 6.468a1.39 1.39 0 0 1-2.304 0L2.288 8.92a1.61 1.61 0 0 1 0-1.838z",crossShape:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708",filledSquare:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2z"};const Gt=Object.values(Nt);const Rt=.2;const qt=4;const Vt=Gt;class Et{constructor(){this.type="sampleScatter";this.lassoOn=false;this.zoom=1;this.startGradient={};this.stopGradient={}}async init(t){const s=this.opts.holder.insert("div").style("display","inline-block");const o=s.insert("div").style("display","inline-block").attr("class","pp-termdb-plot-controls");this.mainDiv=this.opts.holder.insert("div").style("display","inline-block").style("vertical-align","top");const i=80;this.axisOffset={x:i,y:30};this.dom={header:this.opts.header,loadingDiv:this.opts.holder.append("div").style("position","absolute").style("left","45%").style("top","60%"),tip:new e({padding:"0px"}),tooltip:new e({padding:"2px",offsetX:10,offsetY:0}),controlsHolder:o,toolsDiv:s.insert("div")};this.settings={};if(this.dom.header)this.dom.header.html("Scatter Plot");zt(this);Ot(this);document.addEventListener("scroll",(t=>this?.dom?.tooltip?.hide()));a(".sjpp-output-sandbox-content").on("scroll",(t=>this.dom.tooltip.hide()))}getState(t){const e=t.plots.find((t=>t.id===this.id));if(!e){throw`No plot with id='${this.id}' found. Did you set this.id before this.api = getComponentApi(this)?`}const s=W(t);return{config:e,termfilter:t.termfilter,supportedChartTypes:t.termdbConfig.supportedChartTypes[s],matrixplots:t.termdbConfig.matrixplots,vocab:t.vocab,termdbConfig:t.termdbConfig,groups:z(t)}}getDataRequestOpts(){const t=this.config;const e=[];if(t.term)e.push(t.term);if(t.term2)e.push(t.term2);const s={name:t.name,colorTW:t.colorTW,filter:this.getFilter(),coordTWs:e};if(this.state.termfilter.filter0)s.filter0=this.state.termfilter.filter0;if(t.colorColumn)s.colorColumn=t.colorColumn;if(t.shapeTW)s.shapeTW=t.shapeTW;if(t.scaleDotTW){if(!t.scaleDotTW.q)t.scaleDotTW.q={};t.scaleDotTW.q.mode="continuous";s.scaleDotTW=t.scaleDotTW}if(t.term0)s.divideByTW=t.term0;return s}async main(){this.config=structuredClone(this.state.config);if(this.config.settings.sampleScatter.regression!=="None"&&this.config.term0){if(this.charts)for(const t of this.charts)t.chartDiv.selectAll("*").remove();this.dom.loadingDiv.style("display","block").html("Processing data...")}if(this.dom.header)this.dom.header.html(this.config.name+` <span style="opacity:.6;font-size:.7em;margin-left:10px;">SCATTER PLOT</span>`);g(this.settings,this.config.settings.sampleScatter);const t=this.getDataRequestOpts();if(t.coordTWs.length==1)return;const e=await this.app.vocabApi.getScatterData(t);if(e.error)throw e.error;this.charts=[];let s=0;for(const[t,a]of Object.entries(e)){if(!Array.isArray(a.samples))throw"data.samples[] not array";if(a.isLast)this.createChart(t,a,s);else this.createChart(t,a,0)}this.initRanges();this.is3D=this.config.term&&this.config.term0?.q.mode=="continuous";if(!this.config.colorColumn)await this.setControls();await this.processData();this.render();this.dom.loadingDiv.style("display","none");if(!this.is3D)this.setTools();this.dom.tip.hide()}createChart(t,e,s){const a=e.samples.filter((t=>"sampleId"in t));if(a.length>1e4)this.is2DLarge=true;const o=new Map(e.colorLegend);const i=new Map(e.shapeLegend);this.charts.splice(s,0,{id:t,data:e,cohortSamples:a,colorLegend:o,shapeLegend:i})}initRanges(){if(this.charts.length>1){const t=[];for(const e of this.charts)t.push(...e.data.samples);const e=t[0];const[s,a,o,i,n,r,l,c]=t.reduce(((t,e)=>[e.x<t[0]?e.x:t[0],e.x>t[1]?e.x:t[1],e.y<t[2]?e.y:t[2],e.y>t[3]?e.y:t[3],e.z<t[4]?e.z:t[4],e.z>t[5]?e.z:t[5],"scale"in e?e.scale<t[6]?e.scale:t[6]:Number.POSITIVE_INFINITY,"scale"in e?e.scale>t[7]?e.scale:t[7]:Number.NEGATIVE_INFINITY]),[e.x,e.x,e.y,e.y,e.z,e.z,e.scale,e.scale]);for(const t of this.charts){t.xMin=s;t.xMax=a;t.yMin=o;t.yMax=i;t.zMin=n;t.zMax=r;t.scaleMin=l;t.scaleMax=c}}else for(const t of this.charts){if(t.data.samples.length==0)return;const e=t.data.samples[0];const[s,a,o,i,n,r,l,c]=t.data.samples.reduce(((t,e)=>[e.x<t[0]?e.x:t[0],e.x>t[1]?e.x:t[1],e.y<t[2]?e.y:t[2],e.y>t[3]?e.y:t[3],e.z<t[4]?e.z:t[4],e.z>t[5]?e.z:t[5],"scale"in e?e.scale<t[6]?e.scale:t[6]:Number.POSITIVE_INFINITY,"scale"in e?e.scale>t[7]?e.scale:t[7]:Number.NEGATIVE_INFINITY]),[e.x,e.x,e.y,e.y,e.z,e.z,e.scale,e.scale]);t.xMin=s;t.xMax=a;t.yMin=o;t.yMax=i;t.zMin=n;t.zMax=r;t.scaleMin=l;t.scaleMax=c}}async setControls(){this.dom.controlsHolder.selectAll("*").remove();const t=this.charts[0]?.data.samples.find((t=>!("sampleId"in t)))||false;const e={type:"term",configKey:"scaleDotTW",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"numeric"},title:"Scale sample by term value",label:"Scale by",vocabApi:this.app.vocabApi,numericEditMenuVersion:["continuous"]};const s={type:"term",configKey:"shapeTW",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"shapeTW"},title:"Categories to assign a shape",label:"Shape",vocabApi:this.app.vocabApi};const a={label:"Sample size",type:"number",chartType:"sampleScatter",settingsKey:"size",title:"Sample size, represents the factor used to scale the sample",min:0};const o=(qt-Rt)/10;const i={label:"Min size",type:"number",chartType:"sampleScatter",settingsKey:"minShapeSize",title:"Minimum sample size",min:Rt,max:qt,step:o};const n={label:"Max size",type:"number",chartType:"sampleScatter",settingsKey:"maxShapeSize",title:"Maximum sample size",min:Rt,max:qt,step:o};const r={label:"Scale order",type:"radio",chartType:"sampleScatter",settingsKey:"scaleDotOrder",options:[{label:"Ascending",value:"Ascending"},{label:"Descending",value:"Descending"}]};const l={label:"Reference size",type:"number",chartType:"sampleScatter",settingsKey:"refSize",title:"It represents the area of the reference symbol in square pixels",min:0};const c={boxLabel:"Visible",label:"Show axes",type:"checkbox",chartType:"sampleScatter",settingsKey:"showAxes",title:`Option to show/hide plot axes`};const p=[{type:"term",configKey:"colorTW",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"colorTW"},title:"Categories to color the samples",label:"Color",vocabApi:this.app.vocabApi,numericEditMenuVersion:["continuous","discrete"]},{label:"Opacity",type:"number",chartType:"sampleScatter",settingsKey:"opacity",title:"It represents the opacity of the elements",min:0,max:1,step:.1},{label:"Chart width",type:"number",chartType:"sampleScatter",settingsKey:"svgw"},{label:"Chart height",type:"number",chartType:"sampleScatter",settingsKey:"svgh"}];if(this.config.sampleCategory){const t=Object.values(this.config.sampleCategory.tw.term.values).map((t=>({label:t.label||t.key,value:t.key})));if(this.config.sampleCategory.order)t.sort(((t,e)=>{const s=this.config.sampleCategory.order.indexOf(t.value);const a=this.config.sampleCategory.order.indexOf(e.value);if(s<a)return-1;return 1}));if(!this.settings.sampleCategory)this.settings.sampleCategory=this.config.sampleCategory.defaultValue||"";t.push({label:"All",value:""});const e={label:"Sample type",type:"dropdown",chartType:"sampleScatter",settingsKey:"sampleCategory",options:t};p.push(e)}if(!this.is2DLarge){p.unshift({type:"term",configKey:"term0",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"term0"},title:"Categories to divide by",label:this.config.term0?.q?.mode=="continuous"?"Z":"Divide by",vocabApi:this.app.vocabApi,numericEditMenuVersion:this.app.hasWebGL?.()?["discrete","continuous"]:["discrete"],processInput:t=>{if(t?.term.type=="integer"||t?.term.type=="float")t.q={mode:"continuous"}}})}else{p.push({label:"Sample size",type:"number",chartType:"sampleScatter",settingsKey:"threeSize",title:"Sample size",min:0,max:1,step:.001}),p.push({label:"Field of Vision",type:"number",chartType:"sampleScatter",settingsKey:"threeFOV",title:"Field of Vision",min:50,max:90,step:1})}if(this.config.term){p.unshift(...[{type:"term",configKey:"term",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"numeric"},title:"X coordinate to plot the samples",label:"X",vocabApi:this.app.vocabApi,menuOptions:"!remove",numericEditMenuVersion:["continuous"]},{type:"term",configKey:"term2",chartType:"sampleScatter",usecase:{target:"sampleScatter",detail:"numeric"},title:"Y coordinate to plot the samples",label:"Y",vocabApi:this.app.vocabApi,menuOptions:"!remove",numericEditMenuVersion:["continuous"]}]);if(!this.is3D){p.splice(4,0,s);p.splice(5,0,e);if(this.config.scaleDotTW){p.splice(6,0,i);p.splice(7,0,n);p.splice(8,0,r);if(t)p.splice(9,0,l)}else{p.splice(6,0,a);if(t)p.splice(7,0,l)}p.push({label:"Show regression",type:"dropdown",chartType:"sampleScatter",settingsKey:"regression",options:[{label:"None",value:"None"},{label:"Lowess",value:"Lowess"},{label:"Polynomial",value:"Polynomial"}]})}else{p.push({label:"Chart depth",type:"number",chartType:"sampleScatter",settingsKey:"svgd"});p.push({label:"Field of vision",title:"Camera field of view, in degrees",type:"number",chartType:"sampleScatter",settingsKey:"fov"})}p.push(c);p.push({label:"Default color",type:"color",chartType:"sampleScatter",settingsKey:"defaultColor"})}else if(!this.is2DLarge){p.splice(2,0,s);p.splice(3,0,e);if(this.config.scaleDotTW){p.splice(4,0,i);p.splice(5,0,n);p.splice(6,0,r);if(t)p.splice(7,0,l)}else{p.splice(4,0,a);if(t)p.splice(5,0,l)}p.push(c)}this.components={controls:await x({app:this.app,id:this.id,holder:this.dom.controlsHolder,inputs:p})};this.components.controls.on("downloadClick.scatter",(()=>{if(this.is2DLarge||this.is3D){const t=this.canvas.toDataURL("image/png");Ft(t)}else for(const t of this.charts)E(t.svg,"scatter.svg",this.opts.holder.node())}))}getFilter(){const t={type:"tvslst",in:true,join:"and",lst:[]};const e="sampleCategory"in this.settings?this.settings.sampleCategory:this.config.sampleCategory?.defaultValue;if(e){const s=this.config.sampleCategory.tw;t.lst.push({type:"tvs",tvs:{term:s.term,values:[{key:e}]}})}const s=[this.state.termfilter.filter,t];if(this.config.filter)s.push(this.config.filter);const a=R(s);return a}}function Pt(t,e,s=null){let a={chartType:"sampleScatter",name:e.name,filter:s};if(e.sampleCategory)a.sampleCategory={tw:structuredClone(e.sampleCategory.tw),order:e.sampleCategory.order,defaultValue:e.sampleCategory.defaultValue};if(e.sampleType)a.sampleType=e.sampleType;if(e.colorTW)a.colorTW=structuredClone(e.colorTW);else if(e.colorColumn)a.colorColumn=structuredClone(e.colorColumn);if("shapeTW"in e)a.shapeTW=structuredClone(e.shapeTW);if(e.settings)a.settings=structuredClone(e.settings);t.dispatch({type:"plot_create",config:a})}function Ft(t){const e=document.createElement("a");e.setAttribute("download","image");document.body.appendChild(e);e.click();e.remove();e.href=t;e.click();e.remove()}async function Ht(t,e){try{if(t.colorTW)await v(t.colorTW,e.vocabApi);if(t.shapeTW)await v(t.shapeTW,e.vocabApi);if(t.term)await v(t.term,e.vocabApi);if(t.term2)await v(t.term2,e.vocabApi);if(t.term0)await v(t.term0,e.vocabApi);if(t.scaleDotTW)await v(t.scaleDotTW,e.vocabApi);if(t.sampleCategory)await v(t.sampleCategory.tw,e.vocabApi);let s=Yt();if(t.settings)g(s,t.settings);if(!t.term&&!t.term2)s.showAxes=false;const a={groups:[],settings:{controls:{isOpen:false},sampleScatter:s},startColor:{},stopColor:{}};const o=g(a,t);if(o.term0?.q?.mode=="continuous"&&!e.hasWebGL())throw"Can not load Z/Divide by term in continuous mode as WebGL is not supported";return o}catch(t){console.log(t);throw`${t} [sampleScatter getPlotConfig()]`}}const Ut=t(Et);const Bt=Ut;function Kt(t,e){const s=t.append("div");if(e.state.termdbConfig.scatterplots)for(const t of e.state.termdbConfig.scatterplots){s.append("div").attr("class","sja_menuoption sja_sharp_border").text(t.name).on("click",(()=>{Pt(e.app,t);e.dom.tip.hide()}))}s.append("div");if(!e.state.termdbConfig.hiddenChartTypes?.includes("dynamicScatter")){const t=(t,s)=>{e.app.dispatch({type:"plot_create",config:{chartType:"sampleScatter",term:{term:t,q:{mode:"continuous"}},term2:{term:s,q:{mode:"continuous"}},name:`${t.name} vs ${s.name}`}})};V(e.dom.tip,e.app,"sampleScatter","numeric",t)}}function Yt(){return{size:1,minShapeSize:.5,maxShapeSize:4,scaleDotOrder:"Ascending",refSize:.8,svgw:500,svgh:500,svgd:500,axisTitleFontSize:16,showAxes:true,showRef:true,opacity:.8,defaultColor:y,regression:"None",fov:50,threeSize:.002,threeFOV:70}}async function Jt(t,e,s){const a={holder:t,state:{vocab:e.vocab,plots:[{chartType:"sampleScatter",subfolder:"plots",name:s.name,colorTW:s.colorTW,sampleType:s.sampleType,sampleCategory:{tw:structuredClone(s.sampleCategory.tw),order:s.sampleCategory.order,defaultValue:s.sampleCategory.defaultValue}}]}};const o=await import("./plot.app-2a805759.js");await o.appInit(a)}var Xt=Object.freeze({__proto__:null,minShapeSize:Rt,maxShapeSize:qt,shapes:Vt,openScatterPlot:Pt,downloadImage:Ft,getPlotConfig:Ht,scatterInit:Ut,componentInit:Bt,makeChartBtnMenu:Kt,getDefaultScatterSettings:Yt,renderScatter:Jt});export{It as a,Xt as b,Yt as g,mt as n,Wt as s};
@@ -1 +0,0 @@
1
- import{h as t}from"./recover-299ffdb3.js";import{M as e}from"./app-6fb77603.js";function s(s,n,p,a,d){const i=new e({padding:"5px"});const l=s.d.append("div").style("padding","5px");l.append("div").html("Select variables to plot").style("font-size","0.9rem");let o,r;const c=l.append("div").style("padding-top","5px").html("&nbsp;X&nbsp;&nbsp;");const b=c.append("div").attr("class","sja_filter_tag_btn add_term_btn").text("+").on("click",(t=>{v(b,(t=>o=t),a)}));const f=l.append("div").html("&nbsp;Y&nbsp;&nbsp;");const m=f.append("div").attr("class","sja_filter_tag_btn add_term_btn").text("+").on("click",(t=>{v(m,(t=>r=t),a)}));const u=l.append("div").style("float","right").style("padding","5px").insert("button").text("Submit").property("disabled",true).on("click",(()=>{d(o,r);s.hide()}));function v(e,a,d){const l={tree:{usecase:{detail:d,target:p}}};const c=[];if(o)c.push(o);if(r)c.push(r);t(e,(t=>{a(t);i.hide();e.selectAll("*").remove();e.text(t.name);if(o!=null&&r!=null)u.property("disabled",false)}),n,s,l,false,false,c)}}export{s};
@@ -1 +0,0 @@
1
- import{_ as s}from"./tslib.es6-c3c2d88f.js";import{M as t}from"./app-6fb77603.js";import{a as o}from"./genesearch-ffd88bf2.js";class r{init(s){this.callback=s.callback;const r=o({tip:new t({padding:"0px"}),genome:s.genomeObj,row:s.holder,searchOnly:"snp",allowVariant:true,callback:()=>this.selectSnp(r)})}selectSnp(t){return s(this,void 0,void 0,(function*(){const{chr:s,ref:o,alt:r,fromWhat:a}=t;if(!s||!o||!r||!a)throw"missing chr, ref, alt, or fromWhat of snp";let e,i;if(!t.start&&!t.stop){if(t.pos){e=t.pos-1;i=t.pos}else{throw"missing coordinate of snp"}}else{e=t.start;i=t.stop}const n={id:a,chr:s,start:e,stop:i,name:a,ref:o,alt:typeof r=="string"?[r]:r,type:"snp"};this.callback(n)}))}}export{r as SearchHandler};
@@ -1 +0,0 @@
1
- import{_ as t}from"./tslib.es6-c3c2d88f.js";import{mayRestrictAncestry as e,makeSnpSelect as i}from"./snplst-6865d7c7.js";import{f as r}from"./FilterStateless-16a33070.js";import{g as n}from"./FilterRxComp-02e68f1b.js";import"./termsetting-492eefa7.js";import"./app-6fb77603.js";import{a as s}from"./genesearch-ffd88bf2.js";import"./snplst.sampleSum-e47d05f0.js";import"./table-0daf2b89.js";import"./partjson.esm-b3f1fc21.js";import"./termdb.bins-39d11f24.js";import"path";const a="Variants in a locus";function o(e){return{getPillName(){return e.term.name},getPillStatus(){if(!e.term||!e.q)return;if(!e.term.snps)throw`Missing term.snps [snplocs.ts getPillStatus()]`;let t=`${e.q.chr}:${e.q.start}-${e.q.stop}, ${e.term.snps.length} variant${e.term.snps.length>1?"s":""}`;if(e.term.reachedVariantLimit){t+='<span style="margin-left: 6px; background:#aaa; font-size:1em;font-style: normal; border-radius: 7px;color:white;padding:0px 5px;">&#9888;<span>'}return{text:t}},validateQ(t){d(t)},showEditMenu(i){return t(this,void 0,void 0,(function*(){yield l(e,i)}))}}}function l(r,o){var l;return t(this,void 0,void 0,(function*(){const d=o.append("div").style("margin","15px");const c=yield e(r,d);const u=s({genome:r.opts.genomeObj,tip:r.dom.tip2,row:d.append("div").style("margin-top","20px"),defaultCoord:r.q&&r.q.chr?{chr:r.q.chr,start:r.q.start,stop:r.q.stop}:undefined});d.select(".sja_genesearchinput").style("margin","0px");d.append("span").style("margin","5px 0px").style("display","inline-block").style("opacity",.4).style("font-size",".7em").html('"Gene": Gene name (e.g. AKT1)</br>"Position": chr:start-stop (e.g. chr1:5000-6000)</br>"dbSNP": dbSNP accession (e.g. rs1042522)');yield f(r,(l=r.q)===null||l===void 0?void 0:l.variant_filter,d);const[v,h,y]=i(d.append("div").attr("class","sjpp-snp-select").style("margin-top","15px"),r,"snplocus");if(r.usecase.target=="dataDownload")d.select(".sjpp-snp-select").style("display","none");const g=d.append("div").style("margin-top","15px");g.append("button").style("margin-top","15px").text("Submit").on("click",(e=>t(this,void 0,void 0,(function*(){if(!u.chr)return window.alert("Invalid coordinate");e.target.disabled=true;e.target.innerHTML="Validating input...";if(r.term);else{r.term={id:m()}}if(!r.q)r.q={};r.term.type="snplocus";r.q.chr=u.chr;r.q.start=u.start;r.q.stop=u.stop;r.term.name=a;delete r.term.snps;r.q.variant_filter=n(r.variantFilter.active);yield p(r);{const t=Number(v.property("value"));r.q.AFcutoff=t<0||t>=100?5:t}r.q.alleleType=h.property("selectedIndex");r.q.geneticModel=y.property("selectedIndex");if(c){r.q.restrictAncestry=c.node().options[c.property("selectedIndex")].__ancestry_obj}r.runCallback()}))));g.append("span").style("padding-left","15px").style("opacity",.8).style("font-size",".8em").text(r.usecase.target=="dataDownload"?"":"Variants will be treated individually in separate regression models")}))}function p(e){return t(this,void 0,void 0,(function*(){const t=yield e.vocabApi.validateSnps(e.q);if(t.error)throw t.error;e.q.cacheid=t.cacheid;e.term.snps=t.snps;e.term.reachedVariantLimit=t.reachedVariantLimit}))}function d(t){const e=t.q;if(!Number.isFinite(e.AFcutoff))throw"AFcutoff is not number";if(e.AFcutoff<0||e.AFcutoff>100)throw"AFcutoff is not within 0 to 100";if(![0,1].includes(e.alleleType))throw"alleleType value is not one of 0/1";if(![0,1,2,3].includes(e.geneticModel))throw"geneticModel value is not one of 0/1";if(!e.chr)throw"chr missing";if(!Number.isInteger(e.start))throw"start coordinate is not integer";if(!Number.isInteger(e.stop))throw"stop coordinate is not integer";if(e.start<0)throw"start < 0";if(e.stop<=e.start)throw"stop <= start"}function c(e,i){return t(this,void 0,void 0,(function*(){try{d(e)}catch(t){throw"snplocus validateQ(): "+t}if(!e.term.name)e.term.name=a;if(e.id==undefined||e.id==""){if(e.term.id==undefined||e.term.id==""){e.term.id=m()}e.id=e.term.id}else{if(e.term.id==undefined||e.term.id==""){e.term.id=e.id}}yield p({term:e.term,q:e.q,vocabApi:i})}))}function m(){return"snplocus"+Math.random()}function f(e,i,n,s){return t(this,void 0,void 0,(function*(){if(!e.variantFilter){e.variantFilter=yield e.vocabApi.get_variantFilter()}if(!e.variantFilter.terms){return}if(!e.variantFilter.opts)throw"variantFilter.opts{} missing";if(!e.variantFilter.filter)throw".filter missing from variantFilter{}";if(!Array.isArray(e.variantFilter.terms)||e.variantFilter.terms.length==0)throw"variantFilter.terms[] is not non-empty array";if(i){e.variantFilter.active=JSON.parse(JSON.stringify(i))}else{e.variantFilter.active=JSON.parse(JSON.stringify(e.variantFilter.filter))}const a=n.append("div").style("margin-top","15px");a.append("span").text("VARIANT FILTERS").style("font-size",".8em").style("opacity",.5);const o=a.append("div");r({joinWith:e.variantFilter.opts.joinWith,emptyLabel:"+Variant Filter",holder:o,vocab:{terms:e.variantFilter.terms},callback:i=>t(this,void 0,void 0,(function*(){e.variantFilter.active=i;if(s)yield s()}))}).main(e.variantFilter.active)}))}export{c as fillTW,o as getHandler};