@jbrowse/plugin-variants 3.7.0 → 4.0.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 (539) hide show
  1. package/esm/ChordVariantDisplay/components/ChordVariantDisplay.d.ts +11 -0
  2. package/esm/ChordVariantDisplay/components/ChordVariantDisplay.js +16 -0
  3. package/esm/ChordVariantDisplay/components/DisplayError.d.ts +9 -0
  4. package/esm/ChordVariantDisplay/components/DisplayError.js +7 -0
  5. package/esm/ChordVariantDisplay/components/Loading.d.ts +8 -0
  6. package/esm/ChordVariantDisplay/components/Loading.js +28 -0
  7. package/esm/ChordVariantDisplay/index.js +4 -4
  8. package/esm/ChordVariantDisplay/models/configSchema.d.ts +4 -5
  9. package/esm/ChordVariantDisplay/models/configSchema.js +10 -5
  10. package/esm/ChordVariantDisplay/models/renderReaction.d.ts +30 -0
  11. package/esm/ChordVariantDisplay/models/renderReaction.js +48 -0
  12. package/esm/ChordVariantDisplay/models/renderSvg.d.ts +6 -0
  13. package/esm/ChordVariantDisplay/models/renderSvg.js +12 -0
  14. package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +535 -46
  15. package/esm/ChordVariantDisplay/models/stateModelFactory.js +146 -8
  16. package/esm/LinearVariantDisplay/configSchema.d.ts +5 -5
  17. package/esm/LinearVariantDisplay/configSchema.js +2 -2
  18. package/esm/LinearVariantDisplay/index.js +6 -4
  19. package/esm/LinearVariantDisplay/model.d.ts +1086 -103
  20. package/esm/LinearVariantDisplay/model.js +10 -26
  21. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -1
  22. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +8 -18
  23. package/esm/MultiLinearVariantDisplay/configSchema.d.ts +6 -44
  24. package/esm/MultiLinearVariantDisplay/configSchema.js +2 -2
  25. package/esm/MultiLinearVariantDisplay/index.js +4 -3
  26. package/esm/MultiLinearVariantDisplay/model.d.ts +1031 -125
  27. package/esm/MultiLinearVariantDisplay/model.js +3 -23
  28. package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +1 -1
  29. package/esm/MultiLinearVariantDisplay/renderSvg.js +4 -4
  30. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +8 -2
  31. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +26 -23
  32. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -1
  33. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +9 -20
  34. package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +6 -6
  35. package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +1 -1
  36. package/esm/MultiLinearVariantMatrixDisplay/index.js +5 -4
  37. package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +1110 -131
  38. package/esm/MultiLinearVariantMatrixDisplay/model.js +22 -48
  39. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -1
  40. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -3
  41. package/esm/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.d.ts +4 -35
  42. package/esm/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.js +19 -33
  43. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +12 -1
  44. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +48 -22
  45. package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +1 -1
  46. package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
  47. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -2
  48. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +155 -135
  49. package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -14
  50. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +3 -60
  51. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +9 -18
  52. package/esm/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.d.ts +7 -6
  53. package/esm/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.js +30 -26
  54. package/esm/MultiLinearVariantRenderer/configSchema.d.ts +1 -1
  55. package/esm/MultiLinearVariantRenderer/index.js +4 -4
  56. package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +14 -11
  57. package/esm/MultiLinearVariantRenderer/makeImageData.js +127 -110
  58. package/esm/MultiLinearVariantRenderer/types.d.ts +3 -20
  59. package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +1 -1
  60. package/esm/SplitVcfTabixAdapter/configSchema.d.ts +2 -2
  61. package/esm/SplitVcfTabixAdapter/index.d.ts +1 -1
  62. package/esm/SplitVcfTabixAdapter/index.js +3 -3
  63. package/esm/StructuralVariantChordRenderer/Chord.d.ts +1 -1
  64. package/esm/StructuralVariantChordRenderer/Chord.js +41 -58
  65. package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
  66. package/esm/StructuralVariantChordRenderer/ReactComponent.js +3 -3
  67. package/esm/StructuralVariantChordRenderer/configSchema.d.ts +2 -2
  68. package/esm/StructuralVariantChordRenderer/index.js +3 -3
  69. package/esm/Tooltip.js +2 -2
  70. package/esm/VariantFeatureWidget/AltFormatter.js +1 -1
  71. package/esm/VariantFeatureWidget/Formatter.js +2 -2
  72. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakpointSplitViewChoiceDialog.d.ts +1 -0
  73. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakpointSplitViewChoiceDialog.js +1 -0
  74. package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.d.ts +1 -1
  75. package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.js +8 -23
  76. package/esm/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.js +1 -1
  77. package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
  78. package/esm/VariantFeatureWidget/VariantFeatureWidget.js +16 -29
  79. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +5 -2
  80. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +68 -59
  81. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.js +13 -2
  82. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +1 -1
  83. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +72 -30
  84. package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +2 -2
  85. package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +49 -26
  86. package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +3 -5
  87. package/esm/VariantFeatureWidget/configSchema.d.ts +1 -1
  88. package/esm/VariantFeatureWidget/index.js +3 -3
  89. package/esm/VariantFeatureWidget/stateModelFactory.d.ts +39 -39
  90. package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
  91. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -7
  92. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +3 -14
  93. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +4 -2
  94. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +2 -5
  95. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +2 -2
  96. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +34 -19
  97. package/esm/VariantRPC/MultiVariantGetSources.js +2 -6
  98. package/esm/VariantRPC/executeClusterGenotypeMatrix.d.ts +22 -0
  99. package/esm/VariantRPC/executeClusterGenotypeMatrix.js +19 -0
  100. package/esm/VariantRPC/getGenotypeMatrix.d.ts +18 -3
  101. package/esm/VariantRPC/getGenotypeMatrix.js +23 -40
  102. package/esm/VariantRPC/types.d.ts +10 -24
  103. package/esm/VariantTrack/configSchema.d.ts +16 -11
  104. package/esm/VariantTrack/index.js +13 -2
  105. package/esm/VariantTrack/saveTrackFormats/vcf.d.ts +4 -0
  106. package/esm/VariantTrack/saveTrackFormats/vcf.js +15 -0
  107. package/esm/VcfAdapter/VcfAdapter.d.ts +6 -3
  108. package/esm/VcfAdapter/VcfAdapter.js +36 -24
  109. package/esm/VcfAdapter/configSchema.d.ts +2 -2
  110. package/esm/VcfAdapter/index.js +3 -2
  111. package/esm/VcfExtensionPoints/index.d.ts +2 -0
  112. package/esm/{extensionPoints.js → VcfExtensionPoints/index.js} +1 -1
  113. package/esm/VcfFeature/index.js +20 -8
  114. package/esm/VcfFeature/util.d.ts +0 -1
  115. package/esm/VcfFeature/util.js +70 -188
  116. package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +2 -0
  117. package/esm/VcfTabixAdapter/VcfTabixAdapter.js +28 -3
  118. package/esm/VcfTabixAdapter/configSchema.d.ts +5 -5
  119. package/esm/VcfTabixAdapter/configSchema.js +1 -1
  120. package/esm/VcfTabixAdapter/index.d.ts +1 -1
  121. package/esm/VcfTabixAdapter/index.js +4 -3
  122. package/esm/d3-hierarchy2/accessors.d.ts +2 -0
  123. package/esm/d3-hierarchy2/accessors.js +8 -0
  124. package/esm/d3-hierarchy2/array.d.ts +2 -0
  125. package/esm/d3-hierarchy2/array.js +15 -0
  126. package/esm/d3-hierarchy2/cluster.d.ts +8 -0
  127. package/esm/d3-hierarchy2/cluster.js +63 -0
  128. package/esm/d3-hierarchy2/constant.d.ts +2 -0
  129. package/esm/d3-hierarchy2/constant.js +8 -0
  130. package/esm/d3-hierarchy2/hierarchy/ancestors.d.ts +1 -0
  131. package/esm/d3-hierarchy2/hierarchy/ancestors.js +7 -0
  132. package/esm/d3-hierarchy2/hierarchy/count.d.ts +1 -0
  133. package/esm/d3-hierarchy2/hierarchy/count.js +12 -0
  134. package/esm/d3-hierarchy2/hierarchy/descendants.d.ts +1 -0
  135. package/esm/d3-hierarchy2/hierarchy/descendants.js +3 -0
  136. package/esm/d3-hierarchy2/hierarchy/each.d.ts +1 -0
  137. package/esm/d3-hierarchy2/hierarchy/each.js +7 -0
  138. package/esm/d3-hierarchy2/hierarchy/eachAfter.d.ts +1 -0
  139. package/esm/d3-hierarchy2/hierarchy/eachAfter.js +15 -0
  140. package/esm/d3-hierarchy2/hierarchy/eachBefore.d.ts +1 -0
  141. package/esm/d3-hierarchy2/hierarchy/eachBefore.js +12 -0
  142. package/esm/d3-hierarchy2/hierarchy/find.d.ts +1 -0
  143. package/esm/d3-hierarchy2/hierarchy/find.js +8 -0
  144. package/esm/d3-hierarchy2/hierarchy/index.d.ts +3 -0
  145. package/esm/d3-hierarchy2/hierarchy/index.js +78 -0
  146. package/esm/d3-hierarchy2/hierarchy/iterator.d.ts +1 -0
  147. package/esm/d3-hierarchy2/hierarchy/iterator.js +14 -0
  148. package/esm/d3-hierarchy2/hierarchy/leaves.d.ts +1 -0
  149. package/esm/d3-hierarchy2/hierarchy/leaves.js +9 -0
  150. package/esm/d3-hierarchy2/hierarchy/links.d.ts +1 -0
  151. package/esm/d3-hierarchy2/hierarchy/links.js +9 -0
  152. package/esm/d3-hierarchy2/hierarchy/path.d.ts +1 -0
  153. package/esm/d3-hierarchy2/hierarchy/path.js +26 -0
  154. package/esm/d3-hierarchy2/hierarchy/sort.d.ts +1 -0
  155. package/esm/d3-hierarchy2/hierarchy/sort.js +7 -0
  156. package/esm/d3-hierarchy2/hierarchy/sum.d.ts +1 -0
  157. package/esm/d3-hierarchy2/hierarchy/sum.js +8 -0
  158. package/esm/d3-hierarchy2/index.d.ts +15 -0
  159. package/esm/d3-hierarchy2/index.js +15 -0
  160. package/esm/d3-hierarchy2/lcg.d.ts +1 -0
  161. package/esm/d3-hierarchy2/lcg.js +7 -0
  162. package/esm/d3-hierarchy2/pack/enclose.d.ts +10 -0
  163. package/esm/d3-hierarchy2/pack/enclose.js +84 -0
  164. package/esm/d3-hierarchy2/pack/index.d.ts +7 -0
  165. package/esm/d3-hierarchy2/pack/index.js +68 -0
  166. package/esm/d3-hierarchy2/pack/siblings.d.ts +2 -0
  167. package/esm/d3-hierarchy2/pack/siblings.js +94 -0
  168. package/esm/d3-hierarchy2/partition.d.ts +6 -0
  169. package/esm/d3-hierarchy2/partition.js +42 -0
  170. package/esm/d3-hierarchy2/stratify.d.ts +9 -0
  171. package/esm/d3-hierarchy2/stratify.js +115 -0
  172. package/esm/d3-hierarchy2/tree.d.ts +8 -0
  173. package/esm/d3-hierarchy2/tree.js +153 -0
  174. package/esm/d3-hierarchy2/treemap/binary.d.ts +1 -0
  175. package/esm/d3-hierarchy2/treemap/binary.js +36 -0
  176. package/esm/d3-hierarchy2/treemap/dice.d.ts +1 -0
  177. package/esm/d3-hierarchy2/treemap/dice.js +7 -0
  178. package/esm/d3-hierarchy2/treemap/index.d.ts +17 -0
  179. package/esm/d3-hierarchy2/treemap/index.js +72 -0
  180. package/esm/d3-hierarchy2/treemap/resquarify.d.ts +5 -0
  181. package/esm/d3-hierarchy2/treemap/resquarify.js +28 -0
  182. package/esm/d3-hierarchy2/treemap/round.d.ts +1 -0
  183. package/esm/d3-hierarchy2/treemap/round.js +6 -0
  184. package/esm/d3-hierarchy2/treemap/slice.d.ts +1 -0
  185. package/esm/d3-hierarchy2/treemap/slice.js +7 -0
  186. package/esm/d3-hierarchy2/treemap/sliceDice.d.ts +1 -0
  187. package/esm/d3-hierarchy2/treemap/sliceDice.js +5 -0
  188. package/esm/d3-hierarchy2/treemap/squarify.d.ts +11 -0
  189. package/esm/d3-hierarchy2/treemap/squarify.js +46 -0
  190. package/esm/index.d.ts +1 -1
  191. package/esm/index.js +19 -22
  192. package/esm/shared/MultiVariantBaseModel.d.ts +1103 -117
  193. package/esm/shared/MultiVariantBaseModel.js +231 -65
  194. package/esm/shared/SharedVariantConfigSchema.d.ts +2 -40
  195. package/esm/shared/SharedVariantConfigSchema.js +1 -46
  196. package/esm/shared/components/AddFiltersDialog.d.ts +2 -3
  197. package/esm/shared/components/AddFiltersDialog.js +20 -28
  198. package/esm/shared/components/{ui/SetColorDialog.d.ts → BaseSetColorDialog.d.ts} +2 -1
  199. package/esm/shared/components/BaseSetColorDialog.js +61 -0
  200. package/esm/shared/components/ClearTreeWarningDialog.d.ts +4 -0
  201. package/esm/shared/components/ClearTreeWarningDialog.js +9 -0
  202. package/esm/shared/components/MAFFilterDialog.d.ts +2 -3
  203. package/esm/shared/components/MAFFilterDialog.js +4 -8
  204. package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +1 -1
  205. package/esm/shared/components/MultiVariantBaseDisplayComponent.js +8 -17
  206. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +1 -1
  207. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.js +3 -3
  208. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +1 -1
  209. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +9 -14
  210. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +1 -1
  211. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +11 -15
  212. package/esm/shared/components/MultiVariantClusterDialog/types.d.ts +3 -2
  213. package/esm/shared/components/MultiVariantColorLegend.d.ts +1 -1
  214. package/esm/shared/components/MultiVariantColorLegend.js +22 -12
  215. package/esm/shared/components/MultiVariantCrosshairs.d.ts +4 -2
  216. package/esm/shared/components/MultiVariantCrosshairs.js +31 -23
  217. package/esm/shared/components/MultiVariantLegendBar.d.ts +4 -4
  218. package/esm/shared/components/MultiVariantLegendBar.js +24 -22
  219. package/esm/shared/components/MultiVariantLegendBarWrapper.d.ts +7 -0
  220. package/esm/shared/components/MultiVariantLegendBarWrapper.js +18 -0
  221. package/esm/shared/components/MultiVariantTooltip.d.ts +5 -6
  222. package/esm/shared/components/MultiVariantTooltip.js +35 -17
  223. package/esm/shared/components/ScrollableVariantContainer.d.ts +8 -0
  224. package/esm/shared/components/ScrollableVariantContainer.js +23 -0
  225. package/esm/shared/components/SetColorDialog.d.ts +3 -2
  226. package/esm/shared/components/SetColorDialog.js +2 -2
  227. package/esm/shared/components/SetColorDialogBulkEditPanel.d.ts +7 -8
  228. package/esm/shared/components/SetColorDialogBulkEditPanel.js +24 -54
  229. package/esm/shared/components/SetColorDialogRowPalettizer.js +13 -23
  230. package/esm/shared/components/SetRowHeightDialog.d.ts +2 -3
  231. package/esm/shared/components/SourcesDataGrid.d.ts +1 -1
  232. package/esm/shared/components/SourcesDataGrid.js +1 -1
  233. package/esm/shared/components/SourcesGrid.d.ts +1 -1
  234. package/esm/shared/components/SourcesGrid.js +2 -2
  235. package/esm/shared/components/SourcesGridHeader.d.ts +1 -1
  236. package/esm/shared/components/SourcesGridHeader.js +1 -1
  237. package/esm/shared/components/SvgTree.d.ts +5 -0
  238. package/esm/shared/components/SvgTree.js +19 -0
  239. package/esm/shared/components/TreeSidebar.d.ts +5 -0
  240. package/esm/shared/components/TreeSidebar.js +121 -0
  241. package/esm/shared/components/types.d.ts +43 -0
  242. package/esm/shared/components/types.js +1 -0
  243. package/esm/shared/constants.d.ts +8 -2
  244. package/esm/shared/constants.js +11 -2
  245. package/esm/shared/drawAlleleCount.d.ts +2 -1
  246. package/esm/shared/drawAlleleCount.js +50 -16
  247. package/esm/shared/drawPhased.js +11 -12
  248. package/{dist → esm/shared}/getMultiVariantFeaturesAutorun.d.ts +5 -4
  249. package/esm/{getMultiVariantFeaturesAutorun.js → shared/getMultiVariantFeaturesAutorun.js} +9 -2
  250. package/esm/{getMultiVariantSourcesAutorun.d.ts → shared/getMultiVariantSourcesAutorun.d.ts} +4 -3
  251. package/esm/{getMultiVariantSourcesAutorun.js → shared/getMultiVariantSourcesAutorun.js} +10 -2
  252. package/esm/shared/getSources.d.ts +1 -1
  253. package/esm/shared/getSources.js +2 -2
  254. package/esm/shared/hooks/useMouseTracking.d.ts +6 -0
  255. package/esm/shared/hooks/useMouseTracking.js +34 -0
  256. package/esm/shared/makeSidebarSvg.d.ts +9 -0
  257. package/esm/shared/makeSidebarSvg.js +9 -0
  258. package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -5
  259. package/esm/shared/minorAlleleFrequencyUtils.js +37 -38
  260. package/esm/shared/setupMultiVariantAutoruns.d.ts +2 -0
  261. package/esm/shared/setupMultiVariantAutoruns.js +8 -0
  262. package/esm/shared/treeDrawingAutorun.d.ts +16 -0
  263. package/esm/shared/treeDrawingAutorun.js +71 -0
  264. package/esm/shared/types.d.ts +15 -0
  265. package/package.json +38 -39
  266. package/dist/ChordVariantDisplay/index.d.ts +0 -2
  267. package/dist/ChordVariantDisplay/index.js +0 -25
  268. package/dist/ChordVariantDisplay/models/configSchema.d.ts +0 -12
  269. package/dist/ChordVariantDisplay/models/configSchema.js +0 -15
  270. package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +0 -115
  271. package/dist/ChordVariantDisplay/models/stateModelFactory.js +0 -35
  272. package/dist/LinearVariantDisplay/configSchema.d.ts +0 -34
  273. package/dist/LinearVariantDisplay/configSchema.js +0 -12
  274. package/dist/LinearVariantDisplay/index.d.ts +0 -2
  275. package/dist/LinearVariantDisplay/index.js +0 -24
  276. package/dist/LinearVariantDisplay/model.d.ts +0 -278
  277. package/dist/LinearVariantDisplay/model.js +0 -37
  278. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +0 -5
  279. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +0 -29
  280. package/dist/MultiLinearVariantDisplay/configSchema.d.ts +0 -80
  281. package/dist/MultiLinearVariantDisplay/configSchema.js +0 -30
  282. package/dist/MultiLinearVariantDisplay/index.d.ts +0 -2
  283. package/dist/MultiLinearVariantDisplay/index.js +0 -57
  284. package/dist/MultiLinearVariantDisplay/model.d.ts +0 -422
  285. package/dist/MultiLinearVariantDisplay/model.js +0 -82
  286. package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +0 -3
  287. package/dist/MultiLinearVariantDisplay/renderSvg.js +0 -15
  288. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +0 -6
  289. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +0 -83
  290. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +0 -5
  291. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +0 -31
  292. package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +0 -37
  293. package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +0 -22
  294. package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +0 -2
  295. package/dist/MultiLinearVariantMatrixDisplay/index.js +0 -24
  296. package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +0 -431
  297. package/dist/MultiLinearVariantMatrixDisplay/model.js +0 -125
  298. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +0 -3
  299. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +0 -17
  300. package/dist/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.d.ts +0 -37
  301. package/dist/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.js +0 -87
  302. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +0 -8
  303. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +0 -41
  304. package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +0 -2
  305. package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +0 -6
  306. package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +0 -2
  307. package/dist/MultiLinearVariantMatrixRenderer/index.js +0 -20
  308. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +0 -14
  309. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +0 -154
  310. package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +0 -14
  311. package/dist/MultiLinearVariantMatrixRenderer/types.js +0 -2
  312. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +0 -63
  313. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +0 -79
  314. package/dist/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.d.ts +0 -33
  315. package/dist/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.js +0 -67
  316. package/dist/MultiLinearVariantRenderer/components/util.d.ts +0 -1
  317. package/dist/MultiLinearVariantRenderer/components/util.js +0 -15
  318. package/dist/MultiLinearVariantRenderer/configSchema.d.ts +0 -2
  319. package/dist/MultiLinearVariantRenderer/configSchema.js +0 -8
  320. package/dist/MultiLinearVariantRenderer/index.d.ts +0 -2
  321. package/dist/MultiLinearVariantRenderer/index.js +0 -19
  322. package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +0 -14
  323. package/dist/MultiLinearVariantRenderer/makeImageData.js +0 -140
  324. package/dist/MultiLinearVariantRenderer/types.d.ts +0 -21
  325. package/dist/MultiLinearVariantRenderer/types.js +0 -2
  326. package/dist/MultiVariantBaseRenderer.d.ts +0 -46
  327. package/dist/MultiVariantBaseRenderer.js +0 -39
  328. package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -18
  329. package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -92
  330. package/dist/SplitVcfTabixAdapter/configSchema.d.ts +0 -23
  331. package/dist/SplitVcfTabixAdapter/configSchema.js +0 -29
  332. package/dist/SplitVcfTabixAdapter/index.d.ts +0 -3
  333. package/dist/SplitVcfTabixAdapter/index.js +0 -52
  334. package/dist/StructuralVariantChordRenderer/Chord.d.ts +0 -13
  335. package/dist/StructuralVariantChordRenderer/Chord.js +0 -82
  336. package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +0 -16
  337. package/dist/StructuralVariantChordRenderer/ReactComponent.js +0 -30
  338. package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -21
  339. package/dist/StructuralVariantChordRenderer/configSchema.js +0 -25
  340. package/dist/StructuralVariantChordRenderer/index.d.ts +0 -2
  341. package/dist/StructuralVariantChordRenderer/index.js +0 -18
  342. package/dist/StructuralVariantChordRenderer/types.d.ts +0 -17
  343. package/dist/StructuralVariantChordRenderer/types.js +0 -2
  344. package/dist/Tooltip.d.ts +0 -19
  345. package/dist/Tooltip.js +0 -32
  346. package/dist/VariantFeatureWidget/AltFormatter.d.ts +0 -4
  347. package/dist/VariantFeatureWidget/AltFormatter.js +0 -13
  348. package/dist/VariantFeatureWidget/Checkbox2.d.ts +0 -6
  349. package/dist/VariantFeatureWidget/Checkbox2.js +0 -8
  350. package/dist/VariantFeatureWidget/Formatter.d.ts +0 -3
  351. package/dist/VariantFeatureWidget/Formatter.js +0 -23
  352. package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.d.ts +0 -1
  353. package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.js +0 -5
  354. package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.d.ts +0 -1
  355. package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.js +0 -5
  356. package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.d.ts +0 -7
  357. package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.js +0 -111
  358. package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.d.ts +0 -4
  359. package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.js +0 -60
  360. package/dist/VariantFeatureWidget/LaunchBreakendPanel/index.d.ts +0 -1
  361. package/dist/VariantFeatureWidget/LaunchBreakendPanel/index.js +0 -8
  362. package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.d.ts +0 -5
  363. package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.js +0 -15
  364. package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGridWrapper.d.ts +0 -5
  365. package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGridWrapper.js +0 -18
  366. package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +0 -5
  367. package/dist/VariantFeatureWidget/VariantFeatureWidget.js +0 -103
  368. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +0 -4
  369. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +0 -80
  370. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.d.ts +0 -9
  371. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.js +0 -10
  372. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +0 -6
  373. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +0 -54
  374. package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +0 -5
  375. package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +0 -51
  376. package/dist/VariantFeatureWidget/VariantSampleGrid/index.d.ts +0 -1
  377. package/dist/VariantFeatureWidget/VariantSampleGrid/index.js +0 -8
  378. package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +0 -21
  379. package/dist/VariantFeatureWidget/VariantSampleGrid/types.js +0 -2
  380. package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +0 -1
  381. package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +0 -14
  382. package/dist/VariantFeatureWidget/configSchema.d.ts +0 -1
  383. package/dist/VariantFeatureWidget/configSchema.js +0 -5
  384. package/dist/VariantFeatureWidget/index.d.ts +0 -2
  385. package/dist/VariantFeatureWidget/index.js +0 -52
  386. package/dist/VariantFeatureWidget/stateModelFactory.d.ts +0 -104
  387. package/dist/VariantFeatureWidget/stateModelFactory.js +0 -12
  388. package/dist/VariantFeatureWidget/types.d.ts +0 -16
  389. package/dist/VariantFeatureWidget/types.js +0 -2
  390. package/dist/VariantFeatureWidget/variantFieldDescriptions.d.ts +0 -9
  391. package/dist/VariantFeatureWidget/variantFieldDescriptions.js +0 -12
  392. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +0 -14
  393. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +0 -30
  394. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +0 -6
  395. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +0 -21
  396. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +0 -19
  397. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +0 -58
  398. package/dist/VariantRPC/MultiVariantGetSources.d.ts +0 -14
  399. package/dist/VariantRPC/MultiVariantGetSources.js +0 -22
  400. package/dist/VariantRPC/getGenotypeMatrix.d.ts +0 -6
  401. package/dist/VariantRPC/getGenotypeMatrix.js +0 -68
  402. package/dist/VariantRPC/types.d.ts +0 -36
  403. package/dist/VariantRPC/types.js +0 -2
  404. package/dist/VariantTrack/configSchema.d.ts +0 -79
  405. package/dist/VariantTrack/configSchema.js +0 -10
  406. package/dist/VariantTrack/index.d.ts +0 -2
  407. package/dist/VariantTrack/index.js +0 -20
  408. package/dist/VcfAdapter/VcfAdapter.d.ts +0 -35
  409. package/dist/VcfAdapter/VcfAdapter.js +0 -119
  410. package/dist/VcfAdapter/configSchema.d.ts +0 -18
  411. package/dist/VcfAdapter/configSchema.js +0 -35
  412. package/dist/VcfAdapter/index.d.ts +0 -2
  413. package/dist/VcfAdapter/index.js +0 -49
  414. package/dist/VcfAdapter/vcfParser.d.ts +0 -7
  415. package/dist/VcfAdapter/vcfParser.js +0 -26
  416. package/dist/VcfFeature/index.d.ts +0 -19
  417. package/dist/VcfFeature/index.js +0 -80
  418. package/dist/VcfFeature/util.d.ts +0 -6
  419. package/dist/VcfFeature/util.js +0 -227
  420. package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -25
  421. package/dist/VcfTabixAdapter/VcfTabixAdapter.js +0 -117
  422. package/dist/VcfTabixAdapter/configSchema.d.ts +0 -32
  423. package/dist/VcfTabixAdapter/configSchema.js +0 -56
  424. package/dist/VcfTabixAdapter/index.d.ts +0 -3
  425. package/dist/VcfTabixAdapter/index.js +0 -52
  426. package/dist/extensionPoints.d.ts +0 -2
  427. package/dist/extensionPoints.js +0 -39
  428. package/dist/getMultiVariantFeaturesAutorun.js +0 -48
  429. package/dist/getMultiVariantSourcesAutorun.d.ts +0 -11
  430. package/dist/getMultiVariantSourcesAutorun.js +0 -38
  431. package/dist/index.d.ts +0 -7
  432. package/dist/index.js +0 -52
  433. package/dist/shared/MultiVariantBaseModel.d.ts +0 -413
  434. package/dist/shared/MultiVariantBaseModel.js +0 -373
  435. package/dist/shared/SharedVariantConfigSchema.d.ts +0 -66
  436. package/dist/shared/SharedVariantConfigSchema.js +0 -56
  437. package/dist/shared/SharedVariantMixin.d.ts +0 -325
  438. package/dist/shared/SharedVariantMixin.js +0 -58
  439. package/dist/shared/components/AddFiltersDialog.d.ts +0 -9
  440. package/dist/shared/components/AddFiltersDialog.js +0 -61
  441. package/dist/shared/components/MAFFilterDialog.d.ts +0 -8
  442. package/dist/shared/components/MAFFilterDialog.js +0 -28
  443. package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +0 -5
  444. package/dist/shared/components/MultiVariantBaseDisplayComponent.js +0 -29
  445. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +0 -6
  446. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.js +0 -29
  447. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +0 -7
  448. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +0 -74
  449. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +0 -7
  450. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +0 -145
  451. package/dist/shared/components/MultiVariantClusterDialog/types.d.ts +0 -10
  452. package/dist/shared/components/MultiVariantClusterDialog/types.js +0 -2
  453. package/dist/shared/components/MultiVariantColorLegend.d.ts +0 -10
  454. package/dist/shared/components/MultiVariantColorLegend.js +0 -24
  455. package/dist/shared/components/MultiVariantCrosshairs.d.ts +0 -7
  456. package/dist/shared/components/MultiVariantCrosshairs.js +0 -40
  457. package/dist/shared/components/MultiVariantLegendBar.d.ts +0 -7
  458. package/dist/shared/components/MultiVariantLegendBar.js +0 -32
  459. package/dist/shared/components/MultiVariantTooltip.d.ts +0 -10
  460. package/dist/shared/components/MultiVariantTooltip.js +0 -24
  461. package/dist/shared/components/RectBg.d.ts +0 -8
  462. package/dist/shared/components/RectBg.js +0 -10
  463. package/dist/shared/components/SetColorDialog.d.ts +0 -11
  464. package/dist/shared/components/SetColorDialog.js +0 -12
  465. package/dist/shared/components/SetColorDialogBulkEditPanel.d.ts +0 -10
  466. package/dist/shared/components/SetColorDialogBulkEditPanel.js +0 -84
  467. package/dist/shared/components/SetColorDialogHelpfulTips.d.ts +0 -1
  468. package/dist/shared/components/SetColorDialogHelpfulTips.js +0 -7
  469. package/dist/shared/components/SetColorDialogRowPalettizer.d.ts +0 -10
  470. package/dist/shared/components/SetColorDialogRowPalettizer.js +0 -41
  471. package/dist/shared/components/SetMinMaxDialog.d.ts +0 -10
  472. package/dist/shared/components/SetMinMaxDialog.js +0 -26
  473. package/dist/shared/components/SetRowHeightDialog.d.ts +0 -8
  474. package/dist/shared/components/SetRowHeightDialog.js +0 -18
  475. package/dist/shared/components/SourcesDataGrid.d.ts +0 -7
  476. package/dist/shared/components/SourcesDataGrid.js +0 -68
  477. package/dist/shared/components/SourcesGrid.d.ts +0 -7
  478. package/dist/shared/components/SourcesGrid.js +0 -14
  479. package/dist/shared/components/SourcesGridHeader.d.ts +0 -8
  480. package/dist/shared/components/SourcesGridHeader.js +0 -41
  481. package/dist/shared/components/ui/SetColorDialog.d.ts +0 -31
  482. package/dist/shared/components/ui/SetColorDialog.js +0 -51
  483. package/dist/shared/components/ui/SetColorDialogBulkEditPanel.d.ts +0 -10
  484. package/dist/shared/components/ui/SetColorDialogBulkEditPanel.js +0 -84
  485. package/dist/shared/components/ui/SetColorDialogHelpfulTips.d.ts +0 -1
  486. package/dist/shared/components/ui/SetColorDialogHelpfulTips.js +0 -7
  487. package/dist/shared/components/ui/SetColorDialogRowPalettizer.d.ts +0 -10
  488. package/dist/shared/components/ui/SetColorDialogRowPalettizer.js +0 -41
  489. package/dist/shared/constants.d.ts +0 -2
  490. package/dist/shared/constants.js +0 -5
  491. package/dist/shared/drawAlleleCount.d.ts +0 -2
  492. package/dist/shared/drawAlleleCount.js +0 -50
  493. package/dist/shared/drawPhased.d.ts +0 -1
  494. package/dist/shared/drawPhased.js +0 -25
  495. package/dist/shared/findSecondLargestNumber.d.ts +0 -0
  496. package/dist/shared/findSecondLargestNumber.js +0 -1
  497. package/dist/shared/getSources.d.ts +0 -15
  498. package/dist/shared/getSources.js +0 -34
  499. package/dist/shared/minorAlleleFrequencyUtils.d.ts +0 -14
  500. package/dist/shared/minorAlleleFrequencyUtils.js +0 -72
  501. package/dist/shared/sourcesGridUtils.d.ts +0 -11
  502. package/dist/shared/sourcesGridUtils.js +0 -32
  503. package/dist/shared/types.d.ts +0 -14
  504. package/dist/shared/types.js +0 -2
  505. package/dist/shared/util.d.ts +0 -2
  506. package/dist/shared/util.js +0 -21
  507. package/dist/util.d.ts +0 -0
  508. package/dist/util.js +0 -1
  509. package/esm/MultiVariantBaseRenderer.d.ts +0 -46
  510. package/esm/MultiVariantBaseRenderer.js +0 -33
  511. package/esm/VariantFeatureWidget/Checkbox2.d.ts +0 -6
  512. package/esm/VariantFeatureWidget/Checkbox2.js +0 -5
  513. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.d.ts +0 -1
  514. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.js +0 -1
  515. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.d.ts +0 -1
  516. package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.js +0 -1
  517. package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.d.ts +0 -4
  518. package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.js +0 -24
  519. package/esm/VariantFeatureWidget/LaunchBreakendPanel/index.d.ts +0 -1
  520. package/esm/VariantFeatureWidget/LaunchBreakendPanel/index.js +0 -1
  521. package/esm/VariantFeatureWidget/VariantSampleGrid/index.d.ts +0 -1
  522. package/esm/VariantFeatureWidget/VariantSampleGrid/index.js +0 -1
  523. package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +0 -1
  524. package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +0 -11
  525. package/esm/extensionPoints.d.ts +0 -2
  526. package/esm/getMultiVariantFeaturesAutorun.d.ts +0 -18
  527. package/esm/shared/SharedVariantMixin.d.ts +0 -325
  528. package/esm/shared/SharedVariantMixin.js +0 -55
  529. package/esm/shared/components/ui/SetColorDialog.js +0 -45
  530. package/esm/shared/components/ui/SetColorDialogBulkEditPanel.d.ts +0 -10
  531. package/esm/shared/components/ui/SetColorDialogBulkEditPanel.js +0 -81
  532. package/esm/shared/components/ui/SetColorDialogHelpfulTips.d.ts +0 -1
  533. package/esm/shared/components/ui/SetColorDialogHelpfulTips.js +0 -4
  534. package/esm/shared/components/ui/SetColorDialogRowPalettizer.d.ts +0 -10
  535. package/esm/shared/components/ui/SetColorDialogRowPalettizer.js +0 -38
  536. package/esm/shared/findSecondLargestNumber.d.ts +0 -0
  537. package/esm/shared/findSecondLargestNumber.js +0 -1
  538. package/esm/shared/util.d.ts +0 -2
  539. package/esm/shared/util.js +0 -17
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import DraggableDialog from '@jbrowse/core/ui/DraggableDialog';
4
+ import { useLocalStorage } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { Button, DialogActions, DialogContent } from '@mui/material';
7
+ import ClearTreeWarningDialog from "./ClearTreeWarningDialog.js";
8
+ import SetColorDialogBulkEditPanel from "./SetColorDialogBulkEditPanel.js";
9
+ import SetColorDialogHelpfulTips from "./SetColorDialogHelpfulTips.js";
10
+ import SetColorDialogRowPalettizer from "./SetColorDialogRowPalettizer.js";
11
+ const useStyles = makeStyles()({
12
+ content: {
13
+ minWidth: 800,
14
+ },
15
+ fr: {
16
+ float: 'right',
17
+ display: 'flex',
18
+ gap: 8,
19
+ },
20
+ });
21
+ export default function SetColorDialog({ model, handleClose, title = 'Color/arrangement editor', enableBulkEdit = false, enableRowPalettizer = false, showTipsStorageKey = 'setColorDialog-showTips', SourcesGridComponent, }) {
22
+ const { classes } = useStyles();
23
+ const { sources } = model;
24
+ const [showBulkEditor, setShowBulkEditor] = useState(false);
25
+ const [currLayout, setCurrLayout] = useState(structuredClone(sources || []));
26
+ const [showTips, setShowTips] = useLocalStorage(showTipsStorageKey, false);
27
+ const [showWarning, setShowWarning] = useState(false);
28
+ return (_jsxs(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: title, children: [showBulkEditor && enableBulkEdit ? (_jsx(SetColorDialogBulkEditPanel, { currLayout: currLayout, onClose: arg => {
29
+ if (arg) {
30
+ setCurrLayout(arg);
31
+ }
32
+ setShowBulkEditor(false);
33
+ } })) : (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { className: classes.content, children: [_jsxs("div", { className: classes.fr, children: [_jsx(Button, { variant: "contained", onClick: () => {
34
+ setShowTips(!showTips);
35
+ }, children: showTips ? 'Hide tips' : 'Show tips' }), enableBulkEdit ? (_jsx(Button, { color: "secondary", variant: "contained", onClick: () => {
36
+ setShowBulkEditor(!showBulkEditor);
37
+ }, children: "Show Bulk row editor" })) : null] }), showTips ? _jsx(SetColorDialogHelpfulTips, {}) : null, enableRowPalettizer ? (_jsxs(_Fragment, { children: [_jsx("br", {}), _jsx(SetColorDialogRowPalettizer, { currLayout: currLayout, setCurrLayout: setCurrLayout })] })) : null, _jsx(SourcesGridComponent, { rows: currLayout, onChange: setCurrLayout, showTips: showTips })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", type: "submit", color: "inherit", onClick: () => {
38
+ model.clearLayout();
39
+ setCurrLayout(model.sources || []);
40
+ }, children: "Clear custom settings" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
41
+ handleClose();
42
+ setCurrLayout([...(model.sources || [])]);
43
+ }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: () => {
44
+ const { sources, clusterTree } = model;
45
+ const orderChanged = clusterTree &&
46
+ sources?.length === currLayout.length &&
47
+ sources.some((source, idx) => source.name !== currLayout[idx]?.name);
48
+ if (orderChanged) {
49
+ setShowWarning(true);
50
+ }
51
+ else {
52
+ model.setLayout(currLayout);
53
+ handleClose();
54
+ }
55
+ }, children: "Submit" })] })] })), showWarning ? (_jsx(ClearTreeWarningDialog, { handleClose: () => {
56
+ setShowWarning(false);
57
+ }, onConfirm: () => {
58
+ model.setLayout(currLayout);
59
+ handleClose();
60
+ } })) : null] }));
61
+ }
@@ -0,0 +1,4 @@
1
+ export default function ClearTreeWarningDialog({ handleClose, onConfirm, }: {
2
+ handleClose: () => void;
3
+ onConfirm: () => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog } from '@jbrowse/core/ui';
3
+ import { Button, DialogActions, DialogContent, DialogContentText, } from '@mui/material';
4
+ export default function ClearTreeWarningDialog({ handleClose, onConfirm, }) {
5
+ return (_jsxs(Dialog, { open: true, title: "Clear cluster tree?", onClose: handleClose, children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: "You have changed the row order. This will clear the cluster tree visualization. Do you want to continue?" }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: handleClose, color: "primary", children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", onClick: () => {
6
+ onConfirm();
7
+ handleClose();
8
+ }, children: "Continue" })] })] }));
9
+ }
@@ -1,8 +1,7 @@
1
- declare const MAFFilterDialog: ({ model, handleClose, }: {
1
+ export default function MAFFilterDialog({ model, handleClose, }: {
2
2
  model: {
3
3
  minorAlleleFrequencyFilter?: number;
4
4
  setMafFilter: (arg: number) => void;
5
5
  };
6
6
  handleClose: () => void;
7
- }) => import("react/jsx-runtime").JSX.Element;
8
- export default MAFFilterDialog;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { Button, Dialog, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
4
- import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
5
  const useStyles = makeStyles()({
7
6
  root: {
8
7
  width: 500,
9
8
  },
10
9
  });
11
- const MAFFilterDialog = observer(function ({ model, handleClose, }) {
10
+ export default function MAFFilterDialog({ model, handleClose, }) {
12
11
  const { minorAlleleFrequencyFilter = '' } = model;
13
12
  const { classes } = useStyles();
14
13
  const [maf, setMaf] = useState(`${minorAlleleFrequencyFilter}`);
@@ -19,8 +18,5 @@ const MAFFilterDialog = observer(function ({ model, handleClose, }) {
19
18
  model.setMafFilter(+maf);
20
19
  }
21
20
  handleClose();
22
- }, children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
23
- handleClose();
24
- }, children: "Cancel" })] })] }) }));
25
- });
26
- export default MAFFilterDialog;
21
+ }, children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: handleClose, children: "Cancel" })] })] }) }));
22
+ }
@@ -1,4 +1,4 @@
1
- import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
1
+ import type { MultiVariantBaseModel } from '../MultiVariantBaseModel.ts';
2
2
  declare const MultiVariantBaseDisplayComponent: (props: {
3
3
  model: MultiVariantBaseModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,24 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useState } from 'react';
2
+ import { useRef } from 'react';
3
3
  import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
4
4
  import { observer } from 'mobx-react';
5
- import Crosshair from './MultiVariantCrosshairs';
6
- import LegendBar from './MultiVariantLegendBar';
7
- const MultiVariantBaseDisplayComponent = observer(function (props) {
5
+ import Crosshair from "./MultiVariantCrosshairs.js";
6
+ import LegendBar from "./MultiVariantLegendBar.js";
7
+ import TreeSidebar from "./TreeSidebar.js";
8
+ import { useMouseTracking } from "../hooks/useMouseTracking.js";
9
+ const MultiVariantBaseDisplayComponent = observer(function MultiVariantBaseDisplayComponent(props) {
8
10
  const { model } = props;
9
11
  const ref = useRef(null);
10
- const [mouseY, setMouseY] = useState();
11
- const [mouseX, setMouseX] = useState();
12
- return (_jsxs("div", { ref: ref, onMouseMove: event => {
13
- var _a;
14
- const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
15
- const top = (rect === null || rect === void 0 ? void 0 : rect.top) || 0;
16
- const left = (rect === null || rect === void 0 ? void 0 : rect.left) || 0;
17
- setMouseY(event.clientY - top);
18
- setMouseX(event.clientX - left);
19
- }, onMouseLeave: () => {
20
- setMouseY(undefined);
21
- setMouseX(undefined);
22
- }, children: [_jsx(BaseLinearDisplayComponent, { ...props }), _jsx(LegendBar, { model: model }), mouseX && mouseY ? (_jsx(Crosshair, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
12
+ const { mouseState, handleMouseMove, handleMouseLeave } = useMouseTracking(ref);
13
+ return (_jsxs("div", { ref: ref, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: [_jsx(BaseLinearDisplayComponent, { ...props }), _jsx(TreeSidebar, { model: model }), _jsx(LegendBar, { model: model }), mouseState ? (_jsx(Crosshair, { mouseX: mouseState.x, mouseY: mouseState.y, offsetX: mouseState.offsetX, offsetY: mouseState.offsetY, model: model })) : null] }));
23
14
  });
24
15
  export default MultiVariantBaseDisplayComponent;
@@ -1,4 +1,4 @@
1
- import type { ReducedModel } from './types';
1
+ import type { ReducedModel } from './types.ts';
2
2
  declare const ClusterDialog: ({ model, handleClose, }: {
3
3
  model: ReducedModel;
4
4
  handleClose: () => void;
@@ -3,8 +3,8 @@ import { useState } from 'react';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
4
  import { FormControlLabel, Radio, RadioGroup, Typography } from '@mui/material';
5
5
  import { observer } from 'mobx-react';
6
- import ClusterDialogAuto from './ClusterDialogAuto';
7
- import ClusterDialogManual from './ClusterDialogManual';
6
+ import ClusterDialogAuto from "./ClusterDialogAuto.js";
7
+ import ClusterDialogManual from "./ClusterDialogManual.js";
8
8
  function Header({ activeMode, setActiveMode, }) {
9
9
  return (_jsxs("div", { children: [_jsx(Typography, { style: { marginBottom: 30 }, children: "This procedure will cluster the visible genotype data using hierarchical clustering" }), _jsx(RadioGroup, { children: Object.entries({
10
10
  auto: (_jsx("div", { children: "Run in-app clustering (slower, particularly for large numbers of samples, uses JS implementation of hclust)" })),
@@ -13,7 +13,7 @@ function Header({ activeMode, setActiveMode, }) {
13
13
  setActiveMode(key);
14
14
  } }), label: val }, key))) })] }));
15
15
  }
16
- const ClusterDialog = observer(function ({ model, handleClose, }) {
16
+ const ClusterDialog = observer(function ClusterDialog({ model, handleClose, }) {
17
17
  const [activeMode, setActiveMode] = useState('auto');
18
18
  return (_jsx(Dialog, { open: true, title: "Cluster by genotype", onClose: (_, reason) => {
19
19
  if (reason !== 'backdropClick') {
@@ -1,4 +1,4 @@
1
- import type { ReducedModel } from './types';
1
+ import type { ReducedModel } from './types.ts';
2
2
  declare const ClusterDialogAuto: ({ model, children, handleClose, }: {
3
3
  model: ReducedModel;
4
4
  children: React.ReactNode;
@@ -4,17 +4,19 @@ import { ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
5
5
  import { createStopToken, stopStopToken } from '@jbrowse/core/util/stopToken';
6
6
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
7
+ import { isAlive } from '@jbrowse/mobx-state-tree';
7
8
  import { Button, DialogActions, DialogContent } from '@mui/material';
8
9
  import { observer } from 'mobx-react';
9
- import { isAlive } from 'mobx-state-tree';
10
- const ClusterDialogAuto = observer(function ({ model, children, handleClose, }) {
10
+ const ClusterDialogAuto = observer(function ClusterDialogAuto({ model, children, handleClose, }) {
11
11
  const [progress, setProgress] = useState('');
12
12
  const [loading, setLoading] = useState(false);
13
13
  const [error, setError] = useState();
14
- const [stopToken, setStopToken] = useState('');
14
+ const [stopToken, setStopToken] = useState();
15
+ const { rpcManager } = getSession(model);
16
+ const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
15
17
  return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [children, _jsxs("div", { children: [loading ? (_jsxs("div", { style: { padding: 50 }, children: [_jsx("span", { children: progress || 'Loading...' }), _jsx(Button, { onClick: () => {
16
18
  stopStopToken(stopToken);
17
- }, children: "Stop" })] })) : null, error ? _jsx(ErrorMessage, { error: error }) : null] })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", disabled: loading, onClick: async () => {
19
+ }, children: "Stop" })] })) : null, error ? _jsx(ErrorMessage, { error: error }) : null] })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", disabled: loading || !model.sourcesWithoutLayout, onClick: async () => {
18
20
  try {
19
21
  setError(undefined);
20
22
  setProgress('Initializing');
@@ -23,8 +25,6 @@ const ClusterDialogAuto = observer(function ({ model, children, handleClose, })
23
25
  if (!view.initialized) {
24
26
  return;
25
27
  }
26
- const { rpcManager } = getSession(model);
27
- const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
28
28
  if (sourcesWithoutLayout) {
29
29
  const sessionId = getRpcSessionId(model);
30
30
  const stopToken = createStopToken();
@@ -41,13 +41,8 @@ const ClusterDialogAuto = observer(function ({ model, children, handleClose, })
41
41
  setProgress(arg);
42
42
  },
43
43
  }));
44
- model.setLayout(ret.order.map(idx => {
45
- const ret = sourcesWithoutLayout[idx];
46
- if (!ret) {
47
- throw new Error(`out of bounds at ${idx}`);
48
- }
49
- return ret;
50
- }));
44
+ model.setLayout(ret.order.map(idx => sourcesWithoutLayout[idx]), false);
45
+ model.setClusterTree(ret.tree);
51
46
  }
52
47
  handleClose();
53
48
  }
@@ -60,7 +55,7 @@ const ClusterDialogAuto = observer(function ({ model, children, handleClose, })
60
55
  finally {
61
56
  setLoading(false);
62
57
  setProgress('');
63
- setStopToken('');
58
+ setStopToken(undefined);
64
59
  }
65
60
  }, children: "Run clustering" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
66
61
  handleClose();
@@ -1,4 +1,4 @@
1
- import type { ReducedModel } from './types';
1
+ import type { ReducedModel } from './types.ts';
2
2
  declare const ClusterDialogManuals: ({ model, handleClose, children, }: {
3
3
  model: ReducedModel;
4
4
  handleClose: () => void;
@@ -3,23 +3,16 @@ import { useEffect, useState } from 'react';
3
3
  import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
4
4
  import { getContainingView, getSession, isAbortException, useLocalStorage, } from '@jbrowse/core/util';
5
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
6
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
7
+ import { isAlive } from '@jbrowse/mobx-state-tree';
6
8
  import { Button, DialogActions, DialogContent, FormControlLabel, Paper, Radio, RadioGroup, TextField, Typography, } from '@mui/material';
7
- import copy from 'copy-to-clipboard';
8
- import { saveAs } from 'file-saver';
9
9
  import { observer } from 'mobx-react';
10
- import { isAlive } from 'mobx-state-tree';
11
- import { makeStyles } from 'tss-react/mui';
12
- const useStyles = makeStyles()(theme => ({
10
+ const useStyles = makeStyles()({
13
11
  textAreaFont: {
14
12
  fontFamily: 'Courier New',
15
13
  },
16
- mgap: {
17
- display: 'flex',
18
- flexDirection: 'column',
19
- gap: theme.spacing(4),
20
- },
21
- }));
22
- const ClusterDialogManuals = observer(function ({ model, handleClose, children, }) {
14
+ });
15
+ const ClusterDialogManuals = observer(function ClusterDialogManuals({ model, handleClose, children, }) {
23
16
  const { classes } = useStyles();
24
17
  const [paste, setPaste] = useState('');
25
18
  const [ret, setRet] = useState();
@@ -83,13 +76,16 @@ cat(resultClusters$order,sep='\n')`
83
76
  gap: '8px',
84
77
  flexWrap: 'wrap',
85
78
  marginBottom: '16px',
86
- }, children: [_jsx(Button, { variant: "contained", onClick: () => {
79
+ }, children: [_jsx(Button, { variant: "contained", onClick: async () => {
80
+ const { saveAs } = await import('file-saver-es');
87
81
  saveAs(new Blob([results || ''], {
88
82
  type: 'text/plain;charset=utf-8',
89
83
  }), 'cluster.R');
90
- }, children: "Download Rscript" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: () => {
84
+ }, children: "Download Rscript" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: async () => {
85
+ const { default: copy } = await import('copy-to-clipboard');
91
86
  copy(results || '');
92
- }, children: "Copy Rscript to clipboard" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: () => {
87
+ }, children: "Copy Rscript to clipboard" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: async () => {
88
+ const { saveAs } = await import('file-saver-es');
93
89
  saveAs(new Blob([resultsTsv || ''], {
94
90
  type: 'text/plain;charset=utf-8',
95
91
  }), 'genotypes.tsv');
@@ -1,10 +1,11 @@
1
- import type { Source } from '../../types';
1
+ import type { Source } from '../../types.ts';
2
2
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
3
  export interface ReducedModel {
4
4
  sourcesWithoutLayout?: Source[];
5
5
  minorAlleleFrequencyFilter?: number;
6
6
  lengthCutoffFilter: number;
7
7
  adapterConfig: AnyConfigurationModel;
8
- setLayout: (arg: Source[]) => void;
8
+ setClusterTree: (arg?: string) => void;
9
+ setLayout: (arg: Source[], clearTree?: boolean) => void;
9
10
  clearLayout: () => void;
10
11
  }
@@ -1,4 +1,4 @@
1
- import type { Source } from '../types';
1
+ import type { Source } from '../types.ts';
2
2
  declare const MultiVariantColorLegend: ({ model, labelWidth, }: {
3
3
  model: {
4
4
  canDisplayLabels: boolean;
@@ -1,19 +1,29 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Fragment } from 'react';
3
- import { clamp, getFillProps } from '@jbrowse/core/util';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { getFillProps } from '@jbrowse/core/util';
4
4
  import { useTheme } from '@mui/material';
5
5
  import { observer } from 'mobx-react';
6
- import RectBg from './RectBg';
7
- const MultiVariantColorLegend = observer(function ({ model, labelWidth, }) {
6
+ import RectBg from "./RectBg.js";
7
+ const LegendItem = function ({ source, idx, rowHeight, }) {
8
+ const { color } = source;
9
+ const colorBoxWidth = 15;
10
+ return color ? (_jsx(RectBg, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null;
11
+ };
12
+ const LegendItemText = function ({ source, idx, rowHeight, textFillProps, }) {
13
+ const { color, name, label } = source;
14
+ const svgFontSize = Math.min(rowHeight, 12);
15
+ const colorBoxWidth = 15;
16
+ return (_jsx("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, ...textFillProps, children: label || name }));
17
+ };
18
+ const MultiVariantColorLegend = observer(function MultiVariantColorLegend({ model, labelWidth, }) {
8
19
  const { canDisplayLabels, rowHeight, sources } = model;
9
- const svgFontSize = clamp(rowHeight, 8, 12);
10
20
  const colorBoxWidth = 15;
11
- const hasColors = sources === null || sources === void 0 ? void 0 : sources.some(s => s.color);
12
- const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
13
21
  const theme = useTheme();
14
- return sources ? (_jsxs(_Fragment, { children: [canDisplayLabels ? (_jsx(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => {
15
- const { color, name, label } = source;
16
- return (_jsxs(Fragment, { children: [color ? (_jsx(RectBg, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? (_jsx("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, ...getFillProps(theme.palette.text.primary), children: label || name })) : null] }, `${label}-${idx}`));
17
- })] })) : null;
22
+ const hasColors = useMemo(() => sources?.some(s => s.color) ?? false, [sources]);
23
+ const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
24
+ const textFillProps = useMemo(() => getFillProps(theme.palette.text.primary), [theme.palette.text.primary]);
25
+ return sources ? (_jsxs(_Fragment, { children: [canDisplayLabels ? (_jsx(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => (_jsx(LegendItem, { source: source, idx: idx, rowHeight: rowHeight }, `${source.label}-${idx}`))), canDisplayLabels
26
+ ? sources.map((source, idx) => (_jsx(LegendItemText, { source: source, idx: idx, rowHeight: rowHeight, textFillProps: textFillProps }, `${source.label}-text-${idx}`)))
27
+ : null] })) : null;
18
28
  });
19
29
  export default MultiVariantColorLegend;
@@ -1,7 +1,9 @@
1
- import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
2
- declare const MultiVariantCrosshairs: ({ mouseX, mouseY, model, }: {
1
+ import type { MultiVariantBaseModel } from '../MultiVariantBaseModel.ts';
2
+ declare const MultiVariantCrosshairs: ({ mouseX, mouseY, model, offsetX, offsetY, }: {
3
3
  mouseX: number;
4
4
  mouseY: number;
5
5
  model: MultiVariantBaseModel;
6
+ offsetX: number;
7
+ offsetY: number;
6
8
  }) => import("react/jsx-runtime").JSX.Element;
7
9
  export default MultiVariantCrosshairs;
@@ -1,35 +1,43 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import { getContainingView } from '@jbrowse/core/util';
3
- import { useTheme } from '@mui/material';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
5
  import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- import MultiVariantTooltip from './MultiVariantTooltip';
7
- const useStyles = makeStyles()({
8
- rel: {
9
- position: 'relative',
10
- },
11
- cursor: {
6
+ import MultiVariantTooltip from "./MultiVariantTooltip.js";
7
+ const useStyles = makeStyles()(theme => ({
8
+ container: {
9
+ position: 'absolute',
10
+ top: 0,
11
+ left: 0,
12
12
  pointerEvents: 'none',
13
13
  zIndex: 800,
14
+ },
15
+ horizontalLine: {
14
16
  position: 'absolute',
17
+ left: 0,
18
+ height: 1,
19
+ backgroundColor: theme.palette.text.primary,
20
+ pointerEvents: 'none',
15
21
  },
16
- color: {
17
- width: 10,
18
- height: 10,
22
+ verticalLine: {
23
+ position: 'absolute',
24
+ top: 0,
25
+ width: 1,
26
+ backgroundColor: theme.palette.text.primary,
27
+ pointerEvents: 'none',
19
28
  },
20
- });
21
- const MultiVariantCrosshairs = observer(function ({ mouseX, mouseY, model, }) {
29
+ }));
30
+ const MultiVariantCrosshairs = observer(function MultiVariantCrosshairs({ mouseX, mouseY, model, offsetX, offsetY, }) {
22
31
  const { classes } = useStyles();
23
- const theme = useTheme();
24
- const { hoveredGenotype, height, scrollTop, sourceMap } = model;
32
+ const { hoveredGenotype, height, sourceMap } = model;
25
33
  const { width } = getContainingView(model);
26
- const source = hoveredGenotype ? sourceMap === null || sourceMap === void 0 ? void 0 : sourceMap[hoveredGenotype.name] : undefined;
27
- const y = mouseY - scrollTop;
28
- return (_jsxs("div", { className: classes.rel, children: [_jsxs("svg", { className: classes.cursor, width: width, height: height, style: {
29
- top: scrollTop,
30
- }, children: [_jsx("line", { x1: 0, x2: width, y1: y, y2: y, stroke: theme.palette.text.primary }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: theme.palette.text.primary })] }), source ? (_jsx(MultiVariantTooltip, { source: {
31
- ...source,
32
- ...hoveredGenotype,
33
- } })) : null] }));
34
+ const tooltipSource = useMemo(() => {
35
+ if (!hoveredGenotype) {
36
+ return undefined;
37
+ }
38
+ const source = sourceMap?.[hoveredGenotype.name];
39
+ return source ? { ...source, ...hoveredGenotype } : undefined;
40
+ }, [hoveredGenotype, sourceMap]);
41
+ return (_jsxs("div", { className: classes.container, style: { width, height }, children: [_jsx("div", { className: classes.horizontalLine, style: { transform: `translateY(${mouseY}px)`, width } }), _jsx("div", { className: classes.verticalLine, style: { transform: `translateX(${mouseX}px)`, height } }), tooltipSource ? (_jsx(MultiVariantTooltip, { source: tooltipSource, x: offsetX + mouseX, y: offsetY + mouseY })) : null] }));
34
42
  });
35
43
  export default MultiVariantCrosshairs;
@@ -1,7 +1,7 @@
1
- import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
2
- export declare const LegendBar: (props: {
3
- model: MultiVariantBaseModel;
1
+ import type { LegendBarModel } from './types.ts';
2
+ declare const MultiVariantLegendBar: (props: {
3
+ model: LegendBarModel;
4
4
  orientation?: string;
5
5
  exportSVG?: boolean;
6
6
  }) => import("react/jsx-runtime").JSX.Element | null;
7
- export default LegendBar;
7
+ export default MultiVariantLegendBar;
@@ -1,26 +1,28 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { clamp, getContainingView, max, measureText } from '@jbrowse/core/util';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { measureText } from '@jbrowse/core/util';
3
4
  import { observer } from 'mobx-react';
4
- import ColorLegend from './MultiVariantColorLegend';
5
- const Wrapper = observer(function ({ children, model, exportSVG, }) {
6
- const { id, scrollTop, height } = model;
7
- const clipid = `legend-${id}`;
8
- return exportSVG ? (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: 1000, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx("g", { transform: `translate(0,${-scrollTop})`, children: children }) })] })) : (_jsx("svg", { style: {
9
- position: 'absolute',
10
- top: 0,
11
- left: 0,
12
- zIndex: 100,
13
- pointerEvents: 'none',
14
- height: model.totalHeight,
15
- width: getContainingView(model).width,
16
- }, children: children }));
17
- });
18
- export const LegendBar = observer(function (props) {
5
+ import ColorLegend from "./MultiVariantColorLegend.js";
6
+ import MultiVariantLegendBarWrapper from "./MultiVariantLegendBarWrapper.js";
7
+ const MultiVariantLegendBar = observer(function MultiVariantLegendBar(props) {
19
8
  const { model } = props;
20
9
  const { canDisplayLabels, rowHeight, sources } = model;
21
- const svgFontSize = clamp(rowHeight, 8, 12);
22
- return sources ? (_jsx(Wrapper, { ...props, children: _jsx(ColorLegend, { model: model, labelWidth: max(sources
23
- .map(s => measureText(s.label, svgFontSize) + 10)
24
- .map(width => (canDisplayLabels ? width : 20)), 0) }) })) : null;
10
+ const svgFontSize = Math.min(rowHeight, 12);
11
+ const labelWidth = useMemo(() => {
12
+ if (!sources) {
13
+ return 0;
14
+ }
15
+ let maxWidth = 0;
16
+ for (const s of sources) {
17
+ const width = canDisplayLabels
18
+ ? measureText(s.label, svgFontSize) + 10
19
+ : 20;
20
+ if (width > maxWidth) {
21
+ maxWidth = width;
22
+ }
23
+ }
24
+ return maxWidth;
25
+ }, [sources, svgFontSize, canDisplayLabels]);
26
+ return sources ? (_jsx(MultiVariantLegendBarWrapper, { ...props, children: _jsx(ColorLegend, { model: model, labelWidth: labelWidth }) })) : null;
25
27
  });
26
- export default LegendBar;
28
+ export default MultiVariantLegendBar;
@@ -0,0 +1,7 @@
1
+ import type { LegendBarModel } from './types.ts';
2
+ declare const MultiVariantLegendBarWrapper: ({ children, model, exportSVG, }: {
3
+ model: LegendBarModel;
4
+ children: React.ReactNode;
5
+ exportSVG?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default MultiVariantLegendBarWrapper;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getContainingView } from '@jbrowse/core/util';
3
+ import { observer } from 'mobx-react';
4
+ const MultiVariantLegendBarWrapper = observer(function MultiVariantLegendBarWrapper({ children, model, exportSVG, }) {
5
+ const { id, scrollTop, height, hierarchy, treeAreaWidth, showTree } = model;
6
+ const clipid = `legend-${typeof jest === 'undefined' ? id : 'test'}`;
7
+ const leftOffset = hierarchy && showTree ? treeAreaWidth : 0;
8
+ return exportSVG ? (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: 1000, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx("g", { transform: `translate(0,${-scrollTop})`, children: children }) })] })) : (_jsx("svg", { style: {
9
+ position: 'absolute',
10
+ top: 0,
11
+ left: leftOffset,
12
+ zIndex: 100,
13
+ pointerEvents: 'none',
14
+ height: model.totalHeight,
15
+ width: getContainingView(model).width,
16
+ }, children: children }));
17
+ });
18
+ export default MultiVariantLegendBarWrapper;
@@ -1,10 +1,9 @@
1
- export default function MultiVariantTooltip({ source, }: {
1
+ declare const MultiVariantTooltip: import("react").NamedExoticComponent<{
2
2
  source: {
3
3
  color?: string;
4
- hoveredGenotype?: {
5
- genotype: string;
6
- name: string;
7
- };
8
4
  [key: string]: unknown;
9
5
  };
10
- }): import("react/jsx-runtime").JSX.Element;
6
+ x: number;
7
+ y: number;
8
+ }>;
9
+ export default MultiVariantTooltip;