@jbrowse/plugin-variants 3.1.0 → 3.3.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 (237) hide show
  1. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
  2. package/dist/MultiLinearVariantDisplay/index.js +1 -1
  3. package/dist/MultiLinearVariantDisplay/model.d.ts +58 -3
  4. package/dist/MultiLinearVariantDisplay/model.js +0 -1
  5. package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
  6. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
  7. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
  8. package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
  9. package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +59 -2
  10. package/dist/MultiLinearVariantMatrixDisplay/model.js +5 -1
  11. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
  12. package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
  13. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
  14. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
  15. package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
  16. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
  17. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +15 -8
  18. package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
  19. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
  20. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
  21. package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
  22. package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
  23. package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
  24. package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
  25. package/dist/MultiLinearVariantRenderer/index.js +2 -2
  26. package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
  27. package/dist/MultiLinearVariantRenderer/makeImageData.js +63 -23
  28. package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
  29. package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
  30. package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
  31. package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
  32. package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
  33. package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
  34. package/dist/VariantFeatureWidget/Formatter.js +23 -0
  35. package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
  36. package/dist/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
  37. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
  38. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
  39. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
  40. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
  41. package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
  42. package/dist/VariantFeatureWidget/VariantSampleGrid/types.js +2 -0
  43. package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
  44. package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
  45. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
  46. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +30 -0
  47. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
  48. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
  49. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
  50. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
  51. package/dist/VariantRPC/getGenotypeMatrix.d.ts +6 -0
  52. package/dist/VariantRPC/getGenotypeMatrix.js +60 -0
  53. package/dist/VariantRPC/types.d.ts +36 -0
  54. package/dist/VariantRPC/types.js +2 -0
  55. package/dist/VcfAdapter/VcfAdapter.js +6 -3
  56. package/dist/VcfFeature/index.js +0 -1
  57. package/dist/VcfFeature/util.d.ts +2 -0
  58. package/dist/VcfFeature/util.js +125 -27
  59. package/dist/VcfTabixAdapter/VcfTabixAdapter.js +17 -7
  60. package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
  61. package/dist/getMultiVariantFeaturesAutorun.js +9 -2
  62. package/dist/getMultiVariantSourcesAutorun.js +3 -2
  63. package/dist/index.js +2 -0
  64. package/dist/shared/MultiVariantBaseModel.d.ts +59 -3
  65. package/dist/shared/MultiVariantBaseModel.js +95 -37
  66. package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
  67. package/dist/shared/components/AddFiltersDialog.js +61 -0
  68. package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
  69. package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
  70. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
  71. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.js +29 -0
  72. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
  73. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +74 -0
  74. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
  75. package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +145 -0
  76. package/dist/shared/components/MultiVariantClusterDialog/types.d.ts +10 -0
  77. package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
  78. package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
  79. package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
  80. package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
  81. package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
  82. package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
  83. package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
  84. package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
  85. package/dist/shared/components/MultiVariantTooltip.js +3 -2
  86. package/dist/shared/components/RectBg.js +4 -2
  87. package/dist/shared/components/SetColorDialog.js +1 -1
  88. package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
  89. package/dist/shared/components/SourcesDataGrid.js +2 -2
  90. package/dist/shared/components/SourcesGrid.js +1 -1
  91. package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
  92. package/dist/shared/components/SourcesGridHeader.js +2 -2
  93. package/dist/shared/drawAlleleCount.d.ts +1 -1
  94. package/dist/shared/drawAlleleCount.js +29 -5
  95. package/dist/shared/drawPhased.d.ts +1 -1
  96. package/dist/shared/drawPhased.js +14 -10
  97. package/dist/shared/getSources.d.ts +15 -0
  98. package/dist/shared/getSources.js +34 -0
  99. package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
  100. package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
  101. package/dist/shared/sourcesGridUtils.d.ts +3 -2
  102. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
  103. package/esm/MultiLinearVariantDisplay/index.js +1 -1
  104. package/esm/MultiLinearVariantDisplay/model.d.ts +58 -3
  105. package/esm/MultiLinearVariantDisplay/model.js +0 -1
  106. package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
  107. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
  108. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
  109. package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
  110. package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +59 -2
  111. package/esm/MultiLinearVariantMatrixDisplay/model.js +5 -1
  112. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
  113. package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
  114. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
  115. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
  116. package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
  117. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
  118. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +16 -9
  119. package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
  120. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
  121. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
  122. package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
  123. package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
  124. package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
  125. package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
  126. package/esm/MultiLinearVariantRenderer/index.js +1 -1
  127. package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
  128. package/esm/MultiLinearVariantRenderer/makeImageData.js +64 -24
  129. package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
  130. package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
  131. package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
  132. package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
  133. package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
  134. package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
  135. package/esm/VariantFeatureWidget/Formatter.js +17 -0
  136. package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
  137. package/esm/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
  138. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
  139. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
  140. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
  141. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
  142. package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
  143. package/esm/VariantFeatureWidget/VariantSampleGrid/types.js +1 -0
  144. package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
  145. package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
  146. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
  147. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +23 -0
  148. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
  149. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
  150. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
  151. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
  152. package/esm/VariantRPC/getGenotypeMatrix.d.ts +6 -0
  153. package/esm/VariantRPC/getGenotypeMatrix.js +57 -0
  154. package/esm/VariantRPC/types.d.ts +36 -0
  155. package/esm/VariantRPC/types.js +1 -0
  156. package/esm/VcfAdapter/VcfAdapter.js +7 -4
  157. package/esm/VcfFeature/index.js +0 -1
  158. package/esm/VcfFeature/util.d.ts +2 -0
  159. package/esm/VcfFeature/util.js +123 -27
  160. package/esm/VcfTabixAdapter/VcfTabixAdapter.js +18 -8
  161. package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
  162. package/esm/getMultiVariantFeaturesAutorun.js +9 -2
  163. package/esm/getMultiVariantSourcesAutorun.js +3 -2
  164. package/esm/index.js +2 -0
  165. package/esm/shared/MultiVariantBaseModel.d.ts +59 -3
  166. package/esm/shared/MultiVariantBaseModel.js +97 -39
  167. package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
  168. package/esm/shared/components/AddFiltersDialog.js +59 -0
  169. package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
  170. package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
  171. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
  172. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.js +24 -0
  173. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
  174. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +72 -0
  175. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
  176. package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +140 -0
  177. package/esm/shared/components/MultiVariantClusterDialog/types.d.ts +10 -0
  178. package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
  179. package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
  180. package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
  181. package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
  182. package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
  183. package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
  184. package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
  185. package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
  186. package/esm/shared/components/MultiVariantTooltip.js +3 -2
  187. package/esm/shared/components/RectBg.js +4 -2
  188. package/esm/shared/components/SetColorDialog.js +1 -1
  189. package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
  190. package/esm/shared/components/SourcesDataGrid.js +2 -2
  191. package/esm/shared/components/SourcesGrid.js +1 -1
  192. package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
  193. package/esm/shared/components/SourcesGridHeader.js +2 -2
  194. package/esm/shared/drawAlleleCount.d.ts +1 -1
  195. package/esm/shared/drawAlleleCount.js +29 -5
  196. package/esm/shared/drawPhased.d.ts +1 -1
  197. package/esm/shared/drawPhased.js +14 -10
  198. package/esm/shared/getSources.d.ts +15 -0
  199. package/esm/shared/getSources.js +31 -0
  200. package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
  201. package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
  202. package/esm/shared/sourcesGridUtils.d.ts +3 -2
  203. package/package.json +10 -9
  204. package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
  205. package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
  206. package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
  207. package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
  208. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
  209. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
  210. package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
  211. package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
  212. package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
  213. package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
  214. package/dist/shared/components/ClusterDialog.d.ts +0 -11
  215. package/dist/shared/components/ClusterDialog.js +0 -113
  216. package/dist/shared/components/LegendBar.d.ts +0 -18
  217. package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
  218. package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
  219. package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
  220. package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
  221. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
  222. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
  223. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
  224. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
  225. package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
  226. package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
  227. package/esm/shared/components/ClusterDialog.d.ts +0 -11
  228. package/esm/shared/components/ClusterDialog.js +0 -107
  229. package/esm/shared/components/LegendBar.d.ts +0 -18
  230. /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
  231. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
  232. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
  233. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
  234. /package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
  235. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
  236. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
  237. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
@@ -7,8 +7,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
9
9
  const mobx_react_1 = require("mobx-react");
10
- const Crosshair_1 = __importDefault(require("./Crosshair"));
11
- const LegendBar_1 = __importDefault(require("../../shared/components/LegendBar"));
10
+ const MultiVariantCrosshairs_1 = __importDefault(require("../../shared/components/MultiVariantCrosshairs"));
11
+ const MultiVariantLegendBar_1 = __importDefault(require("../../shared/components/MultiVariantLegendBar"));
12
12
  const MultiLinearVariantDisplayComponent = (0, mobx_react_1.observer)(function (props) {
13
13
  const { model } = props;
14
14
  const ref = (0, react_1.useRef)(null);
@@ -24,6 +24,6 @@ const MultiLinearVariantDisplayComponent = (0, mobx_react_1.observer)(function (
24
24
  }, onMouseLeave: () => {
25
25
  setMouseY(undefined);
26
26
  setMouseX(undefined);
27
- }, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(LegendBar_1.default, { model: model }), mouseX && mouseY ? ((0, jsx_runtime_1.jsx)(Crosshair_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
27
+ }, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model }), mouseX && mouseY ? ((0, jsx_runtime_1.jsx)(MultiVariantCrosshairs_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
28
28
  });
29
29
  exports.default = MultiLinearVariantDisplayComponent;
@@ -46,7 +46,7 @@ function MultiLinearVariantDisplayF(pluginManager) {
46
46
  const configSchema = (0, configSchema_1.default)(pluginManager);
47
47
  return new DisplayType_1.default({
48
48
  name: 'MultiLinearVariantDisplay',
49
- displayName: 'Multi-variant display (regular)',
49
+ displayName: 'Multi-sample variant display (regular)',
50
50
  configSchema,
51
51
  stateModel: (0, model_1.default)(configSchema),
52
52
  trackType: 'VariantTrack',
@@ -89,11 +89,13 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
89
89
  renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
90
90
  rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
91
91
  autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
92
+ lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
93
+ jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
94
+ referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
92
95
  } & {
93
96
  type: import("mobx-state-tree").ISimpleType<"MultiLinearVariantDisplay">;
94
97
  rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
95
98
  minorAlleleFrequencyFilter: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
96
- autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
97
99
  }, {
98
100
  rendererTypeName: string;
99
101
  error: unknown;
@@ -237,19 +239,28 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
237
239
  renderProps(): any;
238
240
  } & {
239
241
  sourcesLoadingStopToken: string | undefined;
242
+ simplifiedFeaturesStopToken: string | undefined;
240
243
  featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
241
244
  sourcesVolatile: import("../shared/types").Source[] | undefined;
242
245
  featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
243
246
  hasPhased: boolean;
244
247
  sampleInfo: undefined | Record<string, import("../shared/types").SampleInfo>;
245
- hoveredGenotype: string | undefined;
248
+ hoveredGenotype: {
249
+ genotype: string;
250
+ name: string;
251
+ } | undefined;
246
252
  } & {
253
+ setJexlFilters(f?: string[]): void;
247
254
  setRowHeight(arg: number): void;
248
- setHoveredGenotype(arg: string): void;
255
+ setHoveredGenotype(arg?: {
256
+ genotype: string;
257
+ name: string;
258
+ }): void;
249
259
  setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
250
260
  setLayout(layout: import("../shared/types").Source[]): void;
251
261
  clearLayout(): void;
252
262
  setSourcesLoading(str: string): void;
263
+ setSimplifiedFeaturesLoading(str: string): void;
253
264
  setSources(sources: import("../shared/types").Source[]): void;
254
265
  setMafFilter(arg: number): void;
255
266
  setShowSidebarLabels(arg: boolean): void;
@@ -257,8 +268,19 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
257
268
  setAutoHeight(arg: boolean): void;
258
269
  setHasPhased(arg: boolean): void;
259
270
  setSampleInfo(arg: Record<string, import("../shared/types").SampleInfo>): void;
271
+ setReferenceDrawingMode(arg: string): void;
260
272
  } & {
273
+ readonly activeFilters: any;
261
274
  readonly preSources: import("../shared/types").Source[] | undefined;
275
+ readonly sourcesWithoutLayout: {
276
+ label: string;
277
+ id: string;
278
+ baseUri?: string;
279
+ name: string;
280
+ color?: string;
281
+ group?: string;
282
+ HP?: number;
283
+ }[] | undefined;
262
284
  readonly sources: {
263
285
  label: string;
264
286
  id: string;
@@ -269,6 +291,17 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
269
291
  HP?: number;
270
292
  }[] | undefined;
271
293
  } & {
294
+ readonly sourceMap: {
295
+ [k: string]: {
296
+ label: string;
297
+ id: string;
298
+ baseUri?: string;
299
+ name: string;
300
+ color?: string;
301
+ group?: string;
302
+ HP?: number;
303
+ };
304
+ } | undefined;
272
305
  readonly rowHeight: number;
273
306
  adapterProps(): any;
274
307
  trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
@@ -322,6 +355,18 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
322
355
  type?: undefined;
323
356
  checked?: undefined;
324
357
  onClick?: undefined;
358
+ } | {
359
+ label: string;
360
+ type: string;
361
+ subMenu: {
362
+ label: string;
363
+ type: string;
364
+ checked: boolean;
365
+ onClick: () => void;
366
+ }[];
367
+ icon?: undefined;
368
+ checked?: undefined;
369
+ onClick?: undefined;
325
370
  } | {
326
371
  label: string;
327
372
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
@@ -334,10 +379,20 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
334
379
  type?: undefined;
335
380
  checked?: undefined;
336
381
  onClick?: undefined;
382
+ } | {
383
+ label: string;
384
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
385
+ muiName: string;
386
+ };
387
+ onClick: () => void;
388
+ type?: undefined;
389
+ checked?: undefined;
390
+ subMenu?: undefined;
337
391
  })[];
338
392
  } & {
339
393
  readonly canDisplayLabels: boolean;
340
394
  readonly totalHeight: number;
395
+ readonly featuresReady: boolean;
341
396
  } & {
342
397
  renderProps(): any;
343
398
  } & {
@@ -46,7 +46,6 @@ function stateModelFactory(configSchema) {
46
46
  type: mobx_state_tree_1.types.literal('MultiLinearVariantDisplay'),
47
47
  rowHeightSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 11),
48
48
  minorAlleleFrequencyFilter: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 0),
49
- autoHeight: false,
50
49
  }))
51
50
  .views(() => ({
52
51
  get rendererTypeName() {
@@ -7,9 +7,9 @@ exports.renderSvg = renderSvg;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const util_1 = require("@jbrowse/core/util");
9
9
  const mobx_1 = require("mobx");
10
- const LegendBar_1 = __importDefault(require("../shared/components/LegendBar"));
10
+ const MultiVariantLegendBar_1 = __importDefault(require("../shared/components/MultiVariantLegendBar"));
11
11
  async function renderSvg(self, opts, superRenderSvg) {
12
12
  await (0, mobx_1.when)(() => !!self.regionCannotBeRenderedText);
13
13
  const { offsetPx } = (0, util_1.getContainingView)(self);
14
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: (0, jsx_runtime_1.jsx)(LegendBar_1.default, { model: self, orientation: "left", exportSVG: true }) })] }));
14
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: self, orientation: "left", exportSVG: true }) })] }));
15
15
  }
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const jsx_runtime_1 = require("react/jsx-runtime");
4
7
  const react_1 = require("react");
5
8
  const ui_1 = require("@jbrowse/core/ui");
9
+ const BaseTooltip_1 = __importDefault(require("@jbrowse/core/ui/BaseTooltip"));
6
10
  const util_1 = require("@jbrowse/core/util");
7
11
  const mobx_react_1 = require("mobx-react");
8
12
  const mui_1 = require("tss-react/mui");
@@ -37,15 +41,21 @@ const LinesConnectingMatrixToGenomicPosition = (0, mobx_react_1.observer)(functi
37
41
  const assembly = assemblyManager.get(assemblyNames[0]);
38
42
  const b0 = ((_a = dynamicBlocks.contentBlocks[0]) === null || _a === void 0 ? void 0 : _a.widthPx) || 0;
39
43
  const w = b0 / ((featuresVolatile === null || featuresVolatile === void 0 ? void 0 : featuresVolatile.length) || 1);
40
- return assembly && featuresVolatile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Wrapper, { exportSVG: exportSVG, model: model, children: [(0, jsx_runtime_1.jsx)(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? ((0, jsx_runtime_1.jsx)("line", { stroke: "#f00c", strokeWidth: 2, style: {
41
- pointerEvents: 'none',
42
- }, x1: mouseOverLine.idx * w + w / 2, x2: mouseOverLine.c, y1: lineZoneHeight, y2: 0, onMouseLeave: () => {
43
- setMouseOverLine(undefined);
44
- } })) : null] }), !exportSVG ? ((0, jsx_runtime_1.jsx)(ui_1.ResizeHandle, { style: {
44
+ return assembly && featuresVolatile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Wrapper, { exportSVG: exportSVG, model: model, children: [(0, jsx_runtime_1.jsx)(AllLines, { model: model, setMouseOverLine: setMouseOverLine }), mouseOverLine ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("line", { stroke: "#f00c", strokeWidth: 2, style: {
45
+ pointerEvents: 'none',
46
+ }, x1: mouseOverLine.idx * w + w / 2, x2: mouseOverLine.c, y1: lineZoneHeight, y2: 0, onMouseLeave: () => {
47
+ setMouseOverLine(undefined);
48
+ } }), (0, jsx_runtime_1.jsx)(LineTooltip, { contents: mouseOverLine.f.get('name') })] })) : null] }), !exportSVG ? ((0, jsx_runtime_1.jsx)(ui_1.ResizeHandle, { style: {
45
49
  position: 'absolute',
46
50
  top: lineZoneHeight - 4,
47
51
  }, onDrag: n => model.setLineZoneHeight(lineZoneHeight + n), className: classes.resizeHandle })) : null] })) : null;
48
52
  });
53
+ const TooltipContents = (0, react_1.forwardRef)(function TooltipContents2({ message }, ref) {
54
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, children: (0, react_1.isValidElement)(message) ? (message) : message ? ((0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: String(message) })) : null }));
55
+ });
56
+ const LineTooltip = (0, mobx_react_1.observer)(function ({ contents }) {
57
+ return contents ? ((0, jsx_runtime_1.jsx)(BaseTooltip_1.default, { children: (0, jsx_runtime_1.jsx)(TooltipContents, { message: contents }) })) : null;
58
+ });
49
59
  const AllLines = (0, mobx_react_1.observer)(function ({ model, setMouseOverLine, }) {
50
60
  var _a;
51
61
  const { assemblyManager } = (0, util_1.getSession)(model);
@@ -7,9 +7,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
9
9
  const mobx_react_1 = require("mobx-react");
10
- const Crosshair_1 = __importDefault(require("./Crosshair"));
11
10
  const LinesConnectingMatrixToGenomicPosition_1 = __importDefault(require("./LinesConnectingMatrixToGenomicPosition"));
12
- const LegendBar_1 = __importDefault(require("../../shared/components/LegendBar"));
11
+ const MultiVariantCrosshairs_1 = __importDefault(require("../../shared/components/MultiVariantCrosshairs"));
12
+ const MultiVariantLegendBar_1 = __importDefault(require("../../shared/components/MultiVariantLegendBar"));
13
13
  const MultiLinearVariantMatrixDisplayComponent = (0, mobx_react_1.observer)(function (props) {
14
14
  const { model } = props;
15
15
  const { lineZoneHeight } = model;
@@ -26,6 +26,6 @@ const MultiLinearVariantMatrixDisplayComponent = (0, mobx_react_1.observer)(func
26
26
  }, onMouseLeave: () => {
27
27
  setMouseY(undefined);
28
28
  setMouseX(undefined);
29
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { model: model }), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'absolute', top: lineZoneHeight }, children: [(0, jsx_runtime_1.jsx)(LegendBar_1.default, { model: model }), (0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props })] })] }), mouseX && mouseY && mouseY > lineZoneHeight ? ((0, jsx_runtime_1.jsx)(Crosshair_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
29
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { model: model }), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'absolute', top: lineZoneHeight }, children: [(0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model }), (0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props })] })] }), mouseX && mouseY && mouseY > lineZoneHeight ? ((0, jsx_runtime_1.jsx)(MultiVariantCrosshairs_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
30
30
  });
31
31
  exports.default = MultiLinearVariantMatrixDisplayComponent;
@@ -13,7 +13,7 @@ function LinearVariantMatrixDisplayF(pluginManager) {
13
13
  const configSchema = (0, configSchema_1.default)(pluginManager);
14
14
  return new DisplayType_1.default({
15
15
  name: 'LinearVariantMatrixDisplay',
16
- displayName: 'Multi-variant display (matrix)',
16
+ displayName: 'Multi-sample variant display (matrix)',
17
17
  configSchema,
18
18
  stateModel: (0, model_1.default)(configSchema),
19
19
  trackType: 'VariantTrack',
@@ -89,6 +89,9 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
89
89
  renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
90
90
  rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
91
91
  autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
92
+ lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
93
+ jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
94
+ referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
92
95
  } & {
93
96
  type: import("mobx-state-tree").ISimpleType<"LinearVariantMatrixDisplay">;
94
97
  rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
@@ -236,19 +239,28 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
236
239
  renderProps(): any;
237
240
  } & {
238
241
  sourcesLoadingStopToken: string | undefined;
242
+ simplifiedFeaturesStopToken: string | undefined;
239
243
  featureUnderMouseVolatile: import("@jbrowse/core/util").Feature | undefined;
240
244
  sourcesVolatile: import("../shared/types").Source[] | undefined;
241
245
  featuresVolatile: import("@jbrowse/core/util").Feature[] | undefined;
242
246
  hasPhased: boolean;
243
247
  sampleInfo: undefined | Record<string, import("../shared/types").SampleInfo>;
244
- hoveredGenotype: string | undefined;
248
+ hoveredGenotype: {
249
+ genotype: string;
250
+ name: string;
251
+ } | undefined;
245
252
  } & {
253
+ setJexlFilters(f?: string[]): void;
246
254
  setRowHeight(arg: number): void;
247
- setHoveredGenotype(arg: string): void;
255
+ setHoveredGenotype(arg?: {
256
+ genotype: string;
257
+ name: string;
258
+ }): void;
248
259
  setFeatures(f: import("@jbrowse/core/util").Feature[]): void;
249
260
  setLayout(layout: import("../shared/types").Source[]): void;
250
261
  clearLayout(): void;
251
262
  setSourcesLoading(str: string): void;
263
+ setSimplifiedFeaturesLoading(str: string): void;
252
264
  setSources(sources: import("../shared/types").Source[]): void;
253
265
  setMafFilter(arg: number): void;
254
266
  setShowSidebarLabels(arg: boolean): void;
@@ -256,8 +268,19 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
256
268
  setAutoHeight(arg: boolean): void;
257
269
  setHasPhased(arg: boolean): void;
258
270
  setSampleInfo(arg: Record<string, import("../shared/types").SampleInfo>): void;
271
+ setReferenceDrawingMode(arg: string): void;
259
272
  } & {
273
+ readonly activeFilters: any;
260
274
  readonly preSources: import("../shared/types").Source[] | undefined;
275
+ readonly sourcesWithoutLayout: {
276
+ label: string;
277
+ id: string;
278
+ baseUri?: string;
279
+ name: string;
280
+ color?: string;
281
+ group?: string;
282
+ HP?: number;
283
+ }[] | undefined;
261
284
  readonly sources: {
262
285
  label: string;
263
286
  id: string;
@@ -268,6 +291,17 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
268
291
  HP?: number;
269
292
  }[] | undefined;
270
293
  } & {
294
+ readonly sourceMap: {
295
+ [k: string]: {
296
+ label: string;
297
+ id: string;
298
+ baseUri?: string;
299
+ name: string;
300
+ color?: string;
301
+ group?: string;
302
+ HP?: number;
303
+ };
304
+ } | undefined;
271
305
  readonly rowHeight: number;
272
306
  adapterProps(): any;
273
307
  trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
@@ -321,6 +355,18 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
321
355
  type?: undefined;
322
356
  checked?: undefined;
323
357
  onClick?: undefined;
358
+ } | {
359
+ label: string;
360
+ type: string;
361
+ subMenu: {
362
+ label: string;
363
+ type: string;
364
+ checked: boolean;
365
+ onClick: () => void;
366
+ }[];
367
+ icon?: undefined;
368
+ checked?: undefined;
369
+ onClick?: undefined;
324
370
  } | {
325
371
  label: string;
326
372
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
@@ -333,10 +379,20 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
333
379
  type?: undefined;
334
380
  checked?: undefined;
335
381
  onClick?: undefined;
382
+ } | {
383
+ label: string;
384
+ icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
385
+ muiName: string;
386
+ };
387
+ onClick: () => void;
388
+ type?: undefined;
389
+ checked?: undefined;
390
+ subMenu?: undefined;
336
391
  })[];
337
392
  } & {
338
393
  readonly canDisplayLabels: boolean;
339
394
  readonly totalHeight: number;
395
+ readonly featuresReady: boolean;
340
396
  } & {
341
397
  renderProps(): any;
342
398
  } & {
@@ -344,6 +400,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
344
400
  readonly blockType: string;
345
401
  readonly totalHeight: number;
346
402
  readonly rowHeight: number;
403
+ readonly featuresReady: boolean;
347
404
  } & {
348
405
  renderProps(): any;
349
406
  readonly canDisplayLabels: boolean;
@@ -65,15 +65,19 @@ function stateModelFactory(configSchema) {
65
65
  ? self.totalHeight / this.nrow
66
66
  : self.rowHeightSetting;
67
67
  },
68
+ get featuresReady() {
69
+ return !!self.featuresVolatile;
70
+ },
68
71
  }))
69
72
  .views(self => ({
70
73
  renderProps() {
71
74
  const superProps = self.adapterProps();
72
75
  return {
73
76
  ...superProps,
74
- notReady: superProps.notReady || !self.sources || !self.featuresVolatile,
77
+ notReady: superProps.notReady || !self.sources || !self.featuresReady,
75
78
  renderingMode: self.renderingMode,
76
79
  minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
80
+ lengthCutoffFilter: self.lengthCutoffFilter,
77
81
  height: self.totalHeight,
78
82
  sources: self.sources,
79
83
  };
@@ -8,10 +8,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const util_1 = require("@jbrowse/core/util");
9
9
  const mobx_1 = require("mobx");
10
10
  const LinesConnectingMatrixToGenomicPosition_1 = __importDefault(require("./components/LinesConnectingMatrixToGenomicPosition"));
11
- const LegendBar_1 = __importDefault(require("../shared/components/LegendBar"));
11
+ const MultiVariantLegendBar_1 = __importDefault(require("../shared/components/MultiVariantLegendBar"));
12
12
  async function renderSvg(model, opts, superRenderSvg) {
13
13
  await (0, mobx_1.when)(() => !!model.regionCannotBeRenderedText);
14
14
  const { offsetPx } = (0, util_1.getContainingView)(model);
15
15
  const { lineZoneHeight } = model;
16
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { exportSVG: true, model: model }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${lineZoneHeight})`, children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)(LegendBar_1.default, { model: model, orientation: "left", exportSVG: true })] })] }) }));
16
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: [(0, jsx_runtime_1.jsx)(LinesConnectingMatrixToGenomicPosition_1.default, { exportSVG: true, model: model }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,${lineZoneHeight})`, children: [(0, jsx_runtime_1.jsx)("g", { children: await superRenderSvg(opts) }), (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model, orientation: "left", exportSVG: true })] })] }) }));
17
17
  }
@@ -1,30 +1,34 @@
1
1
  import BoxRendererType from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
2
+ import { SimpleFeature } from '@jbrowse/core/util';
2
3
  import type { RenderArgsDeserialized } from './types';
3
4
  import type { Feature } from '@jbrowse/core/util';
4
5
  export default class LinearVariantMatrixRenderer extends BoxRendererType {
5
6
  supportsSVG: boolean;
6
7
  render(renderProps: RenderArgsDeserialized): Promise<{
7
8
  features: Map<any, any>;
8
- simplifiedFeatures: any;
9
+ simplifiedFeatures: SimpleFeature[];
9
10
  height: number;
10
11
  width: number;
12
+ arr: string[][];
11
13
  canvasRecordedData: any;
12
14
  layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
13
15
  reactElement?: React.ReactElement;
14
16
  html?: string;
15
17
  } | {
16
18
  features: Map<any, any>;
17
- simplifiedFeatures: any;
19
+ simplifiedFeatures: SimpleFeature[];
18
20
  height: number;
19
21
  width: number;
22
+ arr: string[][];
20
23
  reactElement: import("react/jsx-runtime").JSX.Element;
21
24
  layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
22
25
  html?: string;
23
26
  } | {
24
27
  features: Map<any, any>;
25
- simplifiedFeatures: any;
28
+ simplifiedFeatures: SimpleFeature[];
26
29
  height: number;
27
30
  width: number;
31
+ arr: string[][];
28
32
  imageData: any;
29
33
  layout: import("@jbrowse/core/util/layouts").BaseLayout<Feature>;
30
34
  reactElement?: React.ReactElement;
@@ -0,0 +1,8 @@
1
+ import type { MultiVariantBaseModel } from '../../shared/MultiVariantBaseModel';
2
+ declare const MultiLinearVariantMatrixRendering: (props: {
3
+ width: number;
4
+ height: number;
5
+ displayModel: MultiVariantBaseModel;
6
+ arr: string[][];
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export default MultiLinearVariantMatrixRendering;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const ui_1 = require("@jbrowse/core/ui");
6
+ const mobx_react_1 = require("mobx-react");
7
+ const MultiLinearVariantMatrixRendering = (0, mobx_react_1.observer)(function (props) {
8
+ const { arr, width, height, displayModel } = props;
9
+ const ref = (0, react_1.useRef)(null);
10
+ function getFeatureUnderMouse(eventClientX, eventClientY) {
11
+ var _a, _b, _c;
12
+ if (!ref.current) {
13
+ return;
14
+ }
15
+ const r = ref.current.getBoundingClientRect();
16
+ const offsetX = eventClientX - r.left;
17
+ const offsetY = eventClientY - r.top;
18
+ const dimY = arr.length;
19
+ const dimX = ((_a = arr[0]) === null || _a === void 0 ? void 0 : _a.length) || 0;
20
+ const name = (_b = displayModel.sources[Math.floor((offsetY / height) * dimX)]) === null || _b === void 0 ? void 0 : _b.name;
21
+ const genotype = (_c = arr[Math.floor((offsetX / width) * dimY)]) === null || _c === void 0 ? void 0 : _c[Math.floor((offsetY / height) * dimX)];
22
+ return genotype && name
23
+ ? {
24
+ name,
25
+ genotype,
26
+ }
27
+ : undefined;
28
+ }
29
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onMouseMove: e => {
30
+ displayModel.setHoveredGenotype(getFeatureUnderMouse(e.clientX, e.clientY));
31
+ }, onMouseLeave: () => {
32
+ displayModel.setHoveredGenotype(undefined);
33
+ }, onMouseOut: () => {
34
+ displayModel.setHoveredGenotype(undefined);
35
+ }, style: {
36
+ overflow: 'visible',
37
+ position: 'relative',
38
+ height,
39
+ }, children: (0, jsx_runtime_1.jsx)(ui_1.PrerenderedCanvas, { ...props }) }));
40
+ });
41
+ exports.default = MultiLinearVariantMatrixRendering;
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = LinearVariantMatrixRendererF;
7
- const LinearVariantMatrixRenderer_1 = __importDefault(require("./LinearVariantMatrixRenderer"));
8
- const LinearVariantMatrixRendering_1 = __importDefault(require("./components/LinearVariantMatrixRendering"));
7
+ const MultiLinearVariantMatrixRenderer_1 = __importDefault(require("./MultiLinearVariantMatrixRenderer"));
8
+ const MultiLinearVariantMatrixRendering_1 = __importDefault(require("./components/MultiLinearVariantMatrixRendering"));
9
9
  const configSchema_1 = __importDefault(require("./configSchema"));
10
10
  function LinearVariantMatrixRendererF(pluginManager) {
11
11
  pluginManager.addRendererType(() => {
12
- return new LinearVariantMatrixRenderer_1.default({
12
+ return new MultiLinearVariantMatrixRenderer_1.default({
13
13
  name: 'LinearVariantMatrixRenderer',
14
14
  displayName: 'Linear variant matrix renderer',
15
- ReactComponent: LinearVariantMatrixRendering_1.default,
15
+ ReactComponent: MultiLinearVariantMatrixRendering_1.default,
16
16
  configSchema: configSchema_1.default,
17
17
  pluginManager,
18
18
  });
@@ -1,9 +1,9 @@
1
- import type { RenderArgsDeserializedWithFeaturesAndLayout } from './types';
1
+ import type { RenderArgsDeserialized } from './types';
2
2
  export declare function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }: {
3
3
  ctx: CanvasRenderingContext2D;
4
4
  canvasWidth: number;
5
5
  canvasHeight: number;
6
- renderArgs: RenderArgsDeserializedWithFeaturesAndLayout;
6
+ renderArgs: RenderArgsDeserialized;
7
7
  }): Promise<{
8
8
  mafs: {
9
9
  feature: import("@jbrowse/core/util").Feature;
@@ -2,27 +2,34 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeImageData = makeImageData;
4
4
  const util_1 = require("@jbrowse/core/util");
5
+ const stopToken_1 = require("@jbrowse/core/util/stopToken");
5
6
  const constants_1 = require("../shared/constants");
6
7
  const drawAlleleCount_1 = require("../shared/drawAlleleCount");
7
8
  const drawPhased_1 = require("../shared/drawPhased");
8
9
  const minorAlleleFrequencyUtils_1 = require("../shared/minorAlleleFrequencyUtils");
9
10
  async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
10
- const { renderingMode: renderingMode, minorAlleleFrequencyFilter, sources, features, } = renderArgs;
11
+ const { renderingMode, minorAlleleFrequencyFilter, sources, features, stopToken, lengthCutoffFilter, } = renderArgs;
11
12
  const { statusCallback = () => { } } = renderArgs;
12
13
  const h = canvasHeight / sources.length;
13
- const mafs = (0, minorAlleleFrequencyUtils_1.getFeaturesThatPassMinorAlleleFrequencyFilter)(features.values(), minorAlleleFrequencyFilter);
14
+ (0, stopToken_1.checkStopToken)(stopToken);
15
+ const mafs = (0, minorAlleleFrequencyUtils_1.getFeaturesThatPassMinorAlleleFrequencyFilter)({
16
+ stopToken,
17
+ features: features.values(),
18
+ minorAlleleFrequencyFilter,
19
+ lengthCutoffFilter,
20
+ });
21
+ (0, stopToken_1.checkStopToken)(stopToken);
14
22
  const arr = [];
15
23
  const m = mafs.length;
16
24
  const w = canvasWidth / m;
17
25
  await (0, util_1.updateStatus)('Drawing variant matrix', statusCallback, () => {
18
- var _a, _b, _c;
19
- for (let i = 0; i < m; i++) {
26
+ (0, util_1.forEachWithStopTokenCheck)(mafs, stopToken, ({ feature, mostFrequentAlt }, idx) => {
27
+ var _a, _b, _c;
20
28
  const arr2 = [];
21
- const { feature, mostFrequentAlt } = mafs[i];
22
29
  const hasPhaseSet = (_a = feature.get('FORMAT')) === null || _a === void 0 ? void 0 : _a.includes('PS');
23
30
  if (hasPhaseSet) {
24
31
  const samp = feature.get('samples');
25
- const x = (i / mafs.length) * canvasWidth;
32
+ const x = (idx / mafs.length) * canvasWidth;
26
33
  const sln = sources.length;
27
34
  for (let j = 0; j < sln; j++) {
28
35
  const y = (j / sln) * canvasHeight;
@@ -54,7 +61,7 @@ async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
54
61
  }
55
62
  else {
56
63
  const samp = feature.get('genotypes');
57
- const x = (i / mafs.length) * canvasWidth;
64
+ const x = (idx / mafs.length) * canvasWidth;
58
65
  const sln = sources.length;
59
66
  for (let j = 0; j < sln; j++) {
60
67
  const y = (j / sln) * canvasHeight;
@@ -81,7 +88,7 @@ async function makeImageData({ ctx, canvasWidth, canvasHeight, renderArgs, }) {
81
88
  }
82
89
  }
83
90
  arr.push(arr2);
84
- }
91
+ });
85
92
  });
86
93
  return {
87
94
  mafs,
@@ -6,11 +6,9 @@ export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
6
6
  minorAlleleFrequencyFilter: number;
7
7
  highResolutionScaling: number;
8
8
  height: number;
9
- renderingMode: string;
10
- }
11
- export interface RenderArgsDeserializedWithFeaturesAndLayout extends RenderArgsDeserialized {
12
- sources: Source[];
13
9
  features: Map<string, Feature>;
14
10
  renderingMode: string;
15
11
  statusCallback?: (arg: string) => void;
12
+ lengthCutoffFilter: number;
13
+ stopToken: string;
16
14
  }