@jbrowse/plugin-variants 2.17.0 → 2.18.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 (284) hide show
  1. package/dist/ChordVariantDisplay/index.d.ts +1 -1
  2. package/dist/ChordVariantDisplay/index.js +1 -2
  3. package/dist/ChordVariantDisplay/models/configSchema.d.ts +1 -4
  4. package/dist/ChordVariantDisplay/models/configSchema.js +1 -10
  5. package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
  6. package/dist/ChordVariantDisplay/models/stateModelFactory.js +2 -23
  7. package/dist/LinearVariantDisplay/configSchema.d.ts +2 -2
  8. package/dist/LinearVariantDisplay/configSchema.js +1 -10
  9. package/dist/LinearVariantDisplay/index.d.ts +1 -1
  10. package/dist/LinearVariantDisplay/index.js +2 -2
  11. package/dist/LinearVariantDisplay/model.d.ts +8 -38
  12. package/dist/LinearVariantDisplay/model.js +1 -17
  13. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
  14. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +73 -0
  15. package/dist/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
  16. package/dist/MultiLinearVariantDisplay/configSchema.js +30 -0
  17. package/dist/MultiLinearVariantDisplay/index.d.ts +2 -0
  18. package/dist/MultiLinearVariantDisplay/index.js +47 -0
  19. package/dist/MultiLinearVariantDisplay/model.d.ts +278 -0
  20. package/dist/MultiLinearVariantDisplay/model.js +235 -0
  21. package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
  22. package/dist/MultiLinearVariantDisplay/renderSvg.js +18 -0
  23. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
  24. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +42 -0
  25. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
  26. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +81 -0
  27. package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
  28. package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +22 -0
  29. package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
  30. package/dist/MultiLinearVariantMatrixDisplay/index.js +24 -0
  31. package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
  32. package/dist/MultiLinearVariantMatrixDisplay/model.js +218 -0
  33. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
  34. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +21 -0
  35. package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
  36. package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +106 -0
  37. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
  38. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +12 -0
  39. package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
  40. package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +6 -0
  41. package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
  42. package/dist/MultiLinearVariantMatrixRenderer/index.js +20 -0
  43. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
  44. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +60 -0
  45. package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
  46. package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +43 -0
  47. package/dist/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
  48. package/dist/MultiLinearVariantRenderer/configSchema.js +13 -0
  49. package/dist/MultiLinearVariantRenderer/index.d.ts +2 -0
  50. package/dist/MultiLinearVariantRenderer/index.js +19 -0
  51. package/dist/MultiVariantBaseRenderer.d.ts +46 -0
  52. package/dist/MultiVariantBaseRenderer.js +39 -0
  53. package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -2
  54. package/dist/StructuralVariantChordRenderer/Chord.js +5 -9
  55. package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
  56. package/dist/StructuralVariantChordRenderer/ReactComponent.js +0 -1
  57. package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
  58. package/dist/StructuralVariantChordRenderer/configSchema.js +1 -13
  59. package/dist/StructuralVariantChordRenderer/index.d.ts +1 -1
  60. package/dist/StructuralVariantChordRenderer/index.js +1 -1
  61. package/dist/Tooltip.d.ts +19 -0
  62. package/dist/Tooltip.js +58 -0
  63. package/dist/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
  64. package/dist/VariantFeatureWidget/AnnotGrid.js +2 -2
  65. package/dist/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
  66. package/dist/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
  67. package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
  68. package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
  69. package/dist/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
  70. package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
  71. package/dist/VariantFeatureWidget/VariantFeatureWidget.js +4 -6
  72. package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
  73. package/dist/VariantFeatureWidget/VariantSampleGrid.js +9 -13
  74. package/dist/VariantFeatureWidget/index.d.ts +1 -1
  75. package/dist/VariantFeatureWidget/index.js +1 -1
  76. package/dist/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
  77. package/dist/VariantFeatureWidget/stateModelFactory.js +1 -1
  78. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
  79. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +67 -0
  80. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
  81. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +63 -0
  82. package/dist/VariantRPC/MultiVariantGetSources.d.ts +14 -0
  83. package/dist/VariantRPC/MultiVariantGetSources.js +22 -0
  84. package/dist/VariantTrack/configSchema.d.ts +2 -3
  85. package/dist/VariantTrack/configSchema.js +6 -13
  86. package/dist/VariantTrack/index.d.ts +1 -1
  87. package/dist/VcfAdapter/VcfAdapter.d.ts +3 -2
  88. package/dist/VcfAdapter/VcfAdapter.js +3 -5
  89. package/dist/VcfAdapter/configSchema.d.ts +0 -3
  90. package/dist/VcfAdapter/configSchema.js +1 -7
  91. package/dist/VcfAdapter/index.d.ts +1 -1
  92. package/dist/VcfFeature/index.d.ts +5 -29
  93. package/dist/VcfFeature/index.js +35 -26
  94. package/dist/VcfFeature/util.d.ts +1 -4
  95. package/dist/VcfFeature/util.js +0 -12
  96. package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
  97. package/dist/VcfTabixAdapter/VcfTabixAdapter.js +10 -5
  98. package/dist/VcfTabixAdapter/configSchema.d.ts +0 -9
  99. package/dist/VcfTabixAdapter/configSchema.js +2 -14
  100. package/dist/VcfTabixAdapter/index.d.ts +1 -1
  101. package/dist/configSchema.d.ts +34 -0
  102. package/dist/configSchema.js +44 -0
  103. package/dist/extensionPoints.d.ts +1 -1
  104. package/dist/getMultiVariantFeaturesAutorun.d.ts +19 -0
  105. package/dist/getMultiVariantFeaturesAutorun.js +40 -0
  106. package/dist/getMultiVariantSourcesAutorun.d.ts +16 -0
  107. package/dist/getMultiVariantSourcesAutorun.js +37 -0
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +18 -4
  110. package/dist/shared/BulkEditPanel.d.ts +6 -0
  111. package/dist/shared/BulkEditPanel.js +103 -0
  112. package/dist/shared/ClusterDialog.d.ts +12 -0
  113. package/dist/shared/ClusterDialog.js +150 -0
  114. package/dist/shared/ColorLegend.d.ts +11 -0
  115. package/dist/shared/ColorLegend.js +24 -0
  116. package/dist/shared/DraggableDialog.d.ts +6 -0
  117. package/dist/shared/DraggableDialog.js +62 -0
  118. package/dist/shared/LegendBar.d.ts +18 -0
  119. package/dist/shared/LegendBar.js +38 -0
  120. package/dist/shared/MAFFilterDialog.d.ts +9 -0
  121. package/dist/shared/MAFFilterDialog.js +56 -0
  122. package/dist/shared/RectBg.d.ts +9 -0
  123. package/dist/shared/RectBg.js +12 -0
  124. package/dist/shared/RowPalettizer.d.ts +6 -0
  125. package/dist/shared/RowPalettizer.js +38 -0
  126. package/dist/shared/SetColorDialog.d.ts +12 -0
  127. package/dist/shared/SetColorDialog.js +94 -0
  128. package/dist/shared/SetMinMaxDialog.d.ts +11 -0
  129. package/dist/shared/SetMinMaxDialog.js +56 -0
  130. package/dist/shared/SharedVariantConfigSchema.d.ts +66 -0
  131. package/dist/shared/SharedVariantConfigSchema.js +56 -0
  132. package/dist/shared/SharedVariantMixin.d.ts +309 -0
  133. package/dist/shared/SharedVariantMixin.js +58 -0
  134. package/dist/shared/SourcesGrid.d.ts +8 -0
  135. package/dist/shared/SourcesGrid.js +143 -0
  136. package/dist/shared/Tooltip.d.ts +18 -0
  137. package/dist/shared/Tooltip.js +38 -0
  138. package/dist/shared/util.d.ts +10 -0
  139. package/dist/shared/util.js +32 -0
  140. package/dist/util.d.ts +11 -0
  141. package/dist/util.js +53 -0
  142. package/esm/ChordVariantDisplay/index.d.ts +1 -1
  143. package/esm/ChordVariantDisplay/index.js +1 -2
  144. package/esm/ChordVariantDisplay/models/configSchema.d.ts +1 -4
  145. package/esm/ChordVariantDisplay/models/configSchema.js +1 -10
  146. package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
  147. package/esm/ChordVariantDisplay/models/stateModelFactory.js +3 -24
  148. package/esm/LinearVariantDisplay/configSchema.d.ts +2 -2
  149. package/esm/LinearVariantDisplay/configSchema.js +1 -10
  150. package/esm/LinearVariantDisplay/index.d.ts +1 -1
  151. package/esm/LinearVariantDisplay/index.js +2 -2
  152. package/esm/LinearVariantDisplay/model.d.ts +8 -38
  153. package/esm/LinearVariantDisplay/model.js +2 -18
  154. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
  155. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +45 -0
  156. package/esm/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
  157. package/esm/MultiLinearVariantDisplay/configSchema.js +24 -0
  158. package/esm/MultiLinearVariantDisplay/index.d.ts +2 -0
  159. package/esm/MultiLinearVariantDisplay/index.js +18 -0
  160. package/esm/MultiLinearVariantDisplay/model.d.ts +278 -0
  161. package/esm/MultiLinearVariantDisplay/model.js +206 -0
  162. package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
  163. package/esm/MultiLinearVariantDisplay/renderSvg.js +12 -0
  164. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
  165. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +37 -0
  166. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
  167. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +53 -0
  168. package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
  169. package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +16 -0
  170. package/esm/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
  171. package/esm/MultiLinearVariantMatrixDisplay/index.js +18 -0
  172. package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
  173. package/esm/MultiLinearVariantMatrixDisplay/model.js +189 -0
  174. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
  175. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +15 -0
  176. package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
  177. package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +100 -0
  178. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
  179. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +7 -0
  180. package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
  181. package/esm/MultiLinearVariantMatrixRenderer/configSchema.js +4 -0
  182. package/esm/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
  183. package/esm/MultiLinearVariantMatrixRenderer/index.js +14 -0
  184. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
  185. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +54 -0
  186. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
  187. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +18 -0
  188. package/esm/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
  189. package/esm/MultiLinearVariantRenderer/configSchema.js +8 -0
  190. package/esm/MultiLinearVariantRenderer/index.d.ts +2 -0
  191. package/esm/MultiLinearVariantRenderer/index.js +13 -0
  192. package/esm/MultiVariantBaseRenderer.d.ts +46 -0
  193. package/esm/MultiVariantBaseRenderer.js +33 -0
  194. package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -2
  195. package/esm/StructuralVariantChordRenderer/Chord.js +5 -9
  196. package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
  197. package/esm/StructuralVariantChordRenderer/ReactComponent.js +0 -1
  198. package/esm/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
  199. package/esm/StructuralVariantChordRenderer/configSchema.js +1 -13
  200. package/esm/StructuralVariantChordRenderer/index.d.ts +1 -1
  201. package/esm/StructuralVariantChordRenderer/index.js +1 -1
  202. package/esm/Tooltip.d.ts +19 -0
  203. package/esm/Tooltip.js +30 -0
  204. package/esm/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
  205. package/esm/VariantFeatureWidget/AnnotGrid.js +2 -2
  206. package/esm/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
  207. package/esm/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
  208. package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
  209. package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
  210. package/esm/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
  211. package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
  212. package/esm/VariantFeatureWidget/VariantFeatureWidget.js +5 -7
  213. package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
  214. package/esm/VariantFeatureWidget/VariantSampleGrid.js +10 -14
  215. package/esm/VariantFeatureWidget/index.d.ts +1 -1
  216. package/esm/VariantFeatureWidget/index.js +1 -1
  217. package/esm/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
  218. package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
  219. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
  220. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +60 -0
  221. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
  222. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +56 -0
  223. package/esm/VariantRPC/MultiVariantGetSources.d.ts +14 -0
  224. package/esm/VariantRPC/MultiVariantGetSources.js +15 -0
  225. package/esm/VariantTrack/configSchema.d.ts +2 -3
  226. package/esm/VariantTrack/configSchema.js +5 -13
  227. package/esm/VariantTrack/index.d.ts +1 -1
  228. package/esm/VcfAdapter/VcfAdapter.d.ts +3 -2
  229. package/esm/VcfAdapter/VcfAdapter.js +4 -6
  230. package/esm/VcfAdapter/configSchema.d.ts +0 -3
  231. package/esm/VcfAdapter/configSchema.js +1 -7
  232. package/esm/VcfAdapter/index.d.ts +1 -1
  233. package/esm/VcfFeature/index.d.ts +5 -29
  234. package/esm/VcfFeature/index.js +35 -26
  235. package/esm/VcfFeature/util.d.ts +1 -4
  236. package/esm/VcfFeature/util.js +0 -12
  237. package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
  238. package/esm/VcfTabixAdapter/VcfTabixAdapter.js +11 -6
  239. package/esm/VcfTabixAdapter/configSchema.d.ts +0 -9
  240. package/esm/VcfTabixAdapter/configSchema.js +2 -14
  241. package/esm/VcfTabixAdapter/index.d.ts +1 -1
  242. package/esm/configSchema.d.ts +34 -0
  243. package/esm/configSchema.js +42 -0
  244. package/esm/extensionPoints.d.ts +1 -1
  245. package/esm/extensionPoints.js +1 -1
  246. package/esm/getMultiVariantFeaturesAutorun.d.ts +19 -0
  247. package/esm/getMultiVariantFeaturesAutorun.js +37 -0
  248. package/esm/getMultiVariantSourcesAutorun.d.ts +16 -0
  249. package/esm/getMultiVariantSourcesAutorun.js +34 -0
  250. package/esm/index.d.ts +1 -1
  251. package/esm/index.js +18 -4
  252. package/esm/shared/BulkEditPanel.d.ts +6 -0
  253. package/esm/shared/BulkEditPanel.js +77 -0
  254. package/esm/shared/ClusterDialog.d.ts +12 -0
  255. package/esm/shared/ClusterDialog.js +121 -0
  256. package/esm/shared/ColorLegend.d.ts +11 -0
  257. package/esm/shared/ColorLegend.js +19 -0
  258. package/esm/shared/DraggableDialog.d.ts +6 -0
  259. package/esm/shared/DraggableDialog.js +34 -0
  260. package/esm/shared/LegendBar.d.ts +18 -0
  261. package/esm/shared/LegendBar.js +32 -0
  262. package/esm/shared/MAFFilterDialog.d.ts +9 -0
  263. package/esm/shared/MAFFilterDialog.js +31 -0
  264. package/esm/shared/RectBg.d.ts +9 -0
  265. package/esm/shared/RectBg.js +7 -0
  266. package/esm/shared/RowPalettizer.d.ts +6 -0
  267. package/esm/shared/RowPalettizer.js +32 -0
  268. package/esm/shared/SetColorDialog.d.ts +12 -0
  269. package/esm/shared/SetColorDialog.js +65 -0
  270. package/esm/shared/SetMinMaxDialog.d.ts +11 -0
  271. package/esm/shared/SetMinMaxDialog.js +30 -0
  272. package/esm/shared/SharedVariantConfigSchema.d.ts +66 -0
  273. package/esm/shared/SharedVariantConfigSchema.js +53 -0
  274. package/esm/shared/SharedVariantMixin.d.ts +309 -0
  275. package/esm/shared/SharedVariantMixin.js +55 -0
  276. package/esm/shared/SourcesGrid.d.ts +8 -0
  277. package/esm/shared/SourcesGrid.js +115 -0
  278. package/esm/shared/Tooltip.d.ts +18 -0
  279. package/esm/shared/Tooltip.js +33 -0
  280. package/esm/shared/util.d.ts +10 -0
  281. package/esm/shared/util.js +28 -0
  282. package/esm/util.d.ts +11 -0
  283. package/esm/util.js +47 -0
  284. package/package.json +4 -4
@@ -1,9 +1,8 @@
1
- import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
2
- import { openLocation } from '@jbrowse/core/util/io';
3
- import { ObservableCreate } from '@jbrowse/core/util/rxjs';
4
1
  import { TabixIndexedFile } from '@gmod/tabix';
5
2
  import VcfParser from '@gmod/vcf';
6
- // local
3
+ import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
4
+ import { openLocation } from '@jbrowse/core/util/io';
5
+ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
7
6
  import VcfFeature from '../VcfFeature';
8
7
  export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
9
8
  async configurePre() {
@@ -61,7 +60,13 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
61
60
  ...opts,
62
61
  });
63
62
  observer.complete();
64
- }, opts.signal);
63
+ }, opts.stopToken);
64
+ }
65
+ async getSources() {
66
+ const { parser } = await this.configure();
67
+ return parser.samples.map(name => ({
68
+ name,
69
+ }));
65
70
  }
66
- freeResources( /* { region } */) { }
71
+ freeResources() { }
67
72
  }
@@ -1,7 +1,4 @@
1
1
  declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  vcfGzLocation: {
6
3
  type: string;
7
4
  defaultValue: {
@@ -10,17 +7,11 @@ declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configuration
10
7
  };
11
8
  };
12
9
  index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
13
- /**
14
- * #slot index.indexType
15
- */
16
10
  indexType: {
17
11
  model: import("mobx-state-tree").ISimpleType<string>;
18
12
  type: string;
19
13
  defaultValue: string;
20
14
  };
21
- /**
22
- * #slot index.location
23
- */
24
15
  location: {
25
16
  type: string;
26
17
  defaultValue: {
@@ -1,29 +1,17 @@
1
- import { types } from 'mobx-state-tree';
2
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
3
- /**
4
- * #config VcfTabixAdapter
5
- */
6
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import { types } from 'mobx-state-tree';
3
+ function x() { }
7
4
  const VcfTabixAdapter = ConfigurationSchema('VcfTabixAdapter', {
8
- /**
9
- * #slot
10
- */
11
5
  vcfGzLocation: {
12
6
  type: 'fileLocation',
13
7
  defaultValue: { uri: '/path/to/my.vcf.gz', locationType: 'UriLocation' },
14
8
  },
15
9
  index: ConfigurationSchema('VcfIndex', {
16
- /**
17
- * #slot index.indexType
18
- */
19
10
  indexType: {
20
11
  model: types.enumeration('IndexType', ['TBI', 'CSI']),
21
12
  type: 'stringEnum',
22
13
  defaultValue: 'TBI',
23
14
  },
24
- /**
25
- * #slot index.location
26
- */
27
15
  location: {
28
16
  type: 'fileLocation',
29
17
  defaultValue: {
@@ -1,3 +1,3 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export { default as configSchema } from './configSchema';
3
3
  export default function VcfTabixAdapterF(pluginManager: PluginManager): void;
@@ -0,0 +1,34 @@
1
+ declare const WiggleRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
+ color: {
3
+ type: string;
4
+ description: string;
5
+ defaultValue: string;
6
+ };
7
+ posColor: {
8
+ type: string;
9
+ description: string;
10
+ defaultValue: string;
11
+ };
12
+ negColor: {
13
+ type: string;
14
+ description: string;
15
+ defaultValue: string;
16
+ };
17
+ clipColor: {
18
+ type: string;
19
+ description: string;
20
+ defaultValue: string;
21
+ };
22
+ bicolorPivot: {
23
+ type: string;
24
+ model: import("mobx-state-tree").ISimpleType<string>;
25
+ description: string;
26
+ defaultValue: string;
27
+ };
28
+ bicolorPivotValue: {
29
+ type: string;
30
+ defaultValue: number;
31
+ description: string;
32
+ };
33
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
34
+ export default WiggleRenderer;
@@ -0,0 +1,42 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
+ import { types } from 'mobx-state-tree';
3
+ function x() { }
4
+ const WiggleRenderer = ConfigurationSchema('WiggleRenderer', {
5
+ color: {
6
+ type: 'color',
7
+ description: 'the color of track, overrides posColor and negColor',
8
+ defaultValue: '#f0f',
9
+ },
10
+ posColor: {
11
+ type: 'color',
12
+ description: 'the color to use when the score is positive',
13
+ defaultValue: 'blue',
14
+ },
15
+ negColor: {
16
+ type: 'color',
17
+ description: 'the color to use when the score is negative',
18
+ defaultValue: 'red',
19
+ },
20
+ clipColor: {
21
+ type: 'color',
22
+ description: 'the color of the clipping marker',
23
+ defaultValue: 'red',
24
+ },
25
+ bicolorPivot: {
26
+ type: 'stringEnum',
27
+ model: types.enumeration('Scale type', [
28
+ 'numeric',
29
+ 'mean',
30
+ 'z_score',
31
+ 'none',
32
+ ]),
33
+ description: 'type of bicolor pivot',
34
+ defaultValue: 'numeric',
35
+ },
36
+ bicolorPivotValue: {
37
+ type: 'number',
38
+ defaultValue: 0,
39
+ description: 'value to use for bicolor pivot',
40
+ },
41
+ }, { explicitlyTyped: true });
42
+ export default WiggleRenderer;
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function ExtensionPointsF(pluginManager: PluginManager): void;
@@ -1,4 +1,4 @@
1
- import { makeIndex, makeIndexType, getFileName, } from '@jbrowse/core/util/tracks';
1
+ import { getFileName, makeIndex, makeIndexType, } from '@jbrowse/core/util/tracks';
2
2
  export default function ExtensionPointsF(pluginManager) {
3
3
  pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
4
4
  return (file, index, adapterHint) => {
@@ -0,0 +1,19 @@
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
+ import type { Feature } from '@jbrowse/core/util';
3
+ export interface Source {
4
+ name: string;
5
+ color?: string;
6
+ group?: string;
7
+ [key: string]: string | undefined;
8
+ }
9
+ export declare function getMultiVariantFeaturesAutorun(self: {
10
+ configuration: AnyConfigurationModel;
11
+ adapterConfig: AnyConfigurationModel;
12
+ sources?: Source[];
13
+ mafFilter: number;
14
+ statsReadyAndRegionNotTooLarge: boolean;
15
+ adapterProps: () => Record<string, unknown>;
16
+ setError: (error: unknown) => void;
17
+ setFeatures: (f: Feature[]) => void;
18
+ setMessage: (str: string) => void;
19
+ }): void;
@@ -0,0 +1,37 @@
1
+ import { SimpleFeature, getContainingView, getSession, } from '@jbrowse/core/util';
2
+ import { isAbortException } from '@jbrowse/core/util/aborting';
3
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks';
4
+ import { autorun } from 'mobx';
5
+ import { addDisposer, isAlive } from 'mobx-state-tree';
6
+ export function getMultiVariantFeaturesAutorun(self) {
7
+ addDisposer(self, autorun(async () => {
8
+ try {
9
+ const view = getContainingView(self);
10
+ if (!view.initialized || !self.statsReadyAndRegionNotTooLarge) {
11
+ return;
12
+ }
13
+ const { rpcManager } = getSession(self);
14
+ const { sources, mafFilter, adapterConfig } = self;
15
+ if (!sources) {
16
+ return;
17
+ }
18
+ const sessionId = getRpcSessionId(self);
19
+ const features = (await rpcManager.call(sessionId, 'MultiVariantGetSimplifiedFeatures', {
20
+ regions: view.dynamicBlocks.contentBlocks,
21
+ sources,
22
+ mafFilter,
23
+ sessionId,
24
+ adapterConfig,
25
+ }));
26
+ if (isAlive(self)) {
27
+ self.setFeatures(features.map(f => new SimpleFeature(f)));
28
+ }
29
+ }
30
+ catch (e) {
31
+ if (!isAbortException(e) && isAlive(self)) {
32
+ console.error(e);
33
+ getSession(self).notifyError(`${e}`, e);
34
+ }
35
+ }
36
+ }, { delay: 1000 }));
37
+ }
@@ -0,0 +1,16 @@
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
+ export interface Source {
3
+ name: string;
4
+ color?: string;
5
+ group?: string;
6
+ [key: string]: string | undefined;
7
+ }
8
+ export declare function getMultiVariantSourcesAutorun(self: {
9
+ configuration: AnyConfigurationModel;
10
+ adapterConfig: AnyConfigurationModel;
11
+ adapterProps: () => Record<string, unknown>;
12
+ setSourcesLoading: (aborter: string) => void;
13
+ setError: (error: unknown) => void;
14
+ setMessage: (str: string) => void;
15
+ setSources: (sources: Source[]) => void;
16
+ }): void;
@@ -0,0 +1,34 @@
1
+ import { getContainingView, getSession } from '@jbrowse/core/util';
2
+ import { isAbortException } from '@jbrowse/core/util/aborting';
3
+ import { createStopToken } from '@jbrowse/core/util/stopToken';
4
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks';
5
+ import { autorun } from 'mobx';
6
+ import { addDisposer, isAlive } from 'mobx-state-tree';
7
+ export function getMultiVariantSourcesAutorun(self) {
8
+ addDisposer(self, autorun(async () => {
9
+ try {
10
+ const view = getContainingView(self);
11
+ if (!view.initialized) {
12
+ return;
13
+ }
14
+ const { rpcManager } = getSession(self);
15
+ const { adapterConfig } = self;
16
+ const token = createStopToken();
17
+ self.setSourcesLoading(token);
18
+ const sessionId = getRpcSessionId(self);
19
+ const sources = (await rpcManager.call(sessionId, 'MultiVariantGetSources', {
20
+ sessionId,
21
+ adapterConfig,
22
+ }));
23
+ if (isAlive(self)) {
24
+ self.setSources(sources);
25
+ }
26
+ }
27
+ catch (e) {
28
+ if (!isAbortException(e) && isAlive(self)) {
29
+ console.error(e);
30
+ getSession(self).notifyError(`${e}`, e);
31
+ }
32
+ }
33
+ }, { delay: 1000 }));
34
+ }
package/esm/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class VariantsPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/esm/index.js CHANGED
@@ -1,12 +1,19 @@
1
- import VcfAdapterF from './VcfAdapter';
2
- import VcfTabixAdapterF from './VcfTabixAdapter';
3
- import ExtensionPointsF from './extensionPoints';
4
- import VariantTrackF from './VariantTrack';
5
1
  import Plugin from '@jbrowse/core/Plugin';
6
2
  import ChordVariantDisplayF from './ChordVariantDisplay';
7
3
  import LinearVariantDisplayF from './LinearVariantDisplay';
4
+ import MultiLinearVariantDisplayF from './MultiLinearVariantDisplay';
5
+ import LinearVariantMatrixDisplayF from './MultiLinearVariantMatrixDisplay';
6
+ import LinearVariantMatrixRendererF from './MultiLinearVariantMatrixRenderer';
7
+ import MultiVariantRendererF from './MultiLinearVariantRenderer';
8
8
  import StructuralVariantChordRendererF from './StructuralVariantChordRenderer';
9
9
  import VariantFeatureWidgetF from './VariantFeatureWidget';
10
+ import { MultiVariantGetGenotypeMatrix } from './VariantRPC/MultiVariantGetGenotypeMatrix';
11
+ import { MultiVariantGetSimplifiedFeatures } from './VariantRPC/MultiVariantGetSimplifiedFeatures';
12
+ import { MultiVariantGetSources } from './VariantRPC/MultiVariantGetSources';
13
+ import VariantTrackF from './VariantTrack';
14
+ import VcfAdapterF from './VcfAdapter';
15
+ import VcfTabixAdapterF from './VcfTabixAdapter';
16
+ import ExtensionPointsF from './extensionPoints';
10
17
  export default class VariantsPlugin extends Plugin {
11
18
  constructor() {
12
19
  super(...arguments);
@@ -19,8 +26,15 @@ export default class VariantsPlugin extends Plugin {
19
26
  VariantTrackF(pluginManager);
20
27
  ExtensionPointsF(pluginManager);
21
28
  LinearVariantDisplayF(pluginManager);
29
+ LinearVariantMatrixDisplayF(pluginManager);
30
+ MultiLinearVariantDisplayF(pluginManager);
31
+ MultiVariantRendererF(pluginManager);
32
+ LinearVariantMatrixRendererF(pluginManager);
22
33
  StructuralVariantChordRendererF(pluginManager);
23
34
  ChordVariantDisplayF(pluginManager);
35
+ pluginManager.addRpcMethod(() => new MultiVariantGetSources(pluginManager));
36
+ pluginManager.addRpcMethod(() => new MultiVariantGetGenotypeMatrix(pluginManager));
37
+ pluginManager.addRpcMethod(() => new MultiVariantGetSimplifiedFeatures(pluginManager));
24
38
  }
25
39
  }
26
40
  export { default as VcfFeature } from './VcfFeature';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type Source } from '../util';
3
+ export default function BulkEditPanel({ setCurrLayout, currLayout, }: {
4
+ currLayout: Source[];
5
+ setCurrLayout: (arg: Source[]) => void;
6
+ }): React.JSX.Element;
@@ -0,0 +1,77 @@
1
+ import React, { useState } from 'react';
2
+ import { ErrorMessage } from '@jbrowse/core/ui';
3
+ import { Button, TextField, Typography } from '@mui/material';
4
+ import { makeStyles } from 'tss-react/mui';
5
+ const useStyles = makeStyles()({
6
+ textAreaFont: {
7
+ fontFamily: 'Courier New',
8
+ },
9
+ });
10
+ export default function BulkEditPanel({ setCurrLayout, currLayout, }) {
11
+ const { classes } = useStyles();
12
+ const [val, setVal] = useState('');
13
+ const [error, setError] = useState();
14
+ return (React.createElement("div", null,
15
+ React.createElement(Typography, null, "Paste CSV or TSV. If a header column is present. First line is a header. If a column called \"name\" is present, it uses that to connect to IDs in the table, otherwise it uses the first column no."),
16
+ React.createElement(TextField, { variant: "outlined", multiline: true, minRows: 5, placeholder: 'name,population\nHG00098,GBR\nHG00101,GBR\nHG00459,CHS\n...', maxRows: 10, fullWidth: true, value: val, onChange: event => {
17
+ setVal(event.target.value);
18
+ }, slotProps: {
19
+ input: {
20
+ classes: {
21
+ input: classes.textAreaFont,
22
+ },
23
+ },
24
+ } }),
25
+ React.createElement(Button, { variant: "contained", onClick: () => {
26
+ const lines = val
27
+ .split('\n')
28
+ .map(f => f.trim())
29
+ .filter(f => !!f);
30
+ const fields = lines[0].split(/[,\t]/gm);
31
+ if (fields.includes('name')) {
32
+ setError('');
33
+ const oldLayout = currLayout.map(record => [record.name, record]);
34
+ const newData = Object.fromEntries(lines.slice(1).map(line => {
35
+ const cols = line.split(/[,\t]/gm);
36
+ const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
37
+ return [
38
+ newRecord.name,
39
+ { ...newRecord, ...oldLayout[newRecord.name] },
40
+ ];
41
+ }));
42
+ setCurrLayout(currLayout.map(record => ({
43
+ ...record,
44
+ ...newData[record.name],
45
+ })));
46
+ }
47
+ else {
48
+ setError(new Error('No "name" column found on line 1'));
49
+ }
50
+ } }, "Update rows"),
51
+ React.createElement(Button, { variant: "contained", onClick: () => {
52
+ const lines = val
53
+ .split('\n')
54
+ .map(f => f.trim())
55
+ .filter(f => !!f);
56
+ const fields = lines[0].split(/[,\t]/gm);
57
+ if (fields.includes('name')) {
58
+ setError('');
59
+ const oldLayout = currLayout.map(record => [record.name, record]);
60
+ const newData = Object.fromEntries(lines.slice(1).map(line => {
61
+ const cols = line.split(/[,\t]/gm);
62
+ const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
63
+ return [
64
+ newRecord.name,
65
+ { ...newRecord, ...oldLayout[newRecord.name] },
66
+ ];
67
+ }));
68
+ setCurrLayout(currLayout.map(record => ({
69
+ ...newData[record.name],
70
+ })));
71
+ }
72
+ else {
73
+ setError(new Error('No "name" column found on line 1'));
74
+ }
75
+ } }, "Replace rows"),
76
+ error ? React.createElement(ErrorMessage, { error: error }) : null));
77
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { Source } from '../util';
3
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
+ export default function HierarchicalCluster({ model, handleClose, }: {
5
+ model: {
6
+ sources?: Source[];
7
+ mafFilter?: number;
8
+ adapterConfig: AnyConfigurationModel;
9
+ setLayout: (arg: Source[]) => void;
10
+ };
11
+ handleClose: () => void;
12
+ }): React.JSX.Element;
@@ -0,0 +1,121 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
3
+ import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
4
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks';
5
+ import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
6
+ import copy from 'copy-to-clipboard';
7
+ import { saveAs } from 'file-saver';
8
+ import { isAlive } from 'mobx-state-tree';
9
+ import { makeStyles } from 'tss-react/mui';
10
+ const useStyles = makeStyles()(theme => ({
11
+ textAreaFont: {
12
+ fontFamily: 'Courier New',
13
+ },
14
+ mgap: {
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ gap: theme.spacing(4),
18
+ },
19
+ }));
20
+ export default function HierarchicalCluster({ model, handleClose, }) {
21
+ const { classes } = useStyles();
22
+ const [results, setResults] = useState();
23
+ const [error, setError] = useState();
24
+ const [paste, setPaste] = useState('');
25
+ useEffect(() => {
26
+ ;
27
+ (async () => {
28
+ try {
29
+ setError(undefined);
30
+ const view = getContainingView(model);
31
+ if (!view.initialized) {
32
+ return;
33
+ }
34
+ const { rpcManager } = getSession(model);
35
+ const { sources, mafFilter, adapterConfig } = model;
36
+ const sessionId = getRpcSessionId(model);
37
+ const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
38
+ regions: view.dynamicBlocks.contentBlocks,
39
+ sources,
40
+ mafFilter,
41
+ sessionId,
42
+ adapterConfig,
43
+ }));
44
+ const entries = Object.values(ret);
45
+ const keys = Object.keys(ret);
46
+ const text = `try(library(fastcluster), silent=TRUE)
47
+ inputMatrix<-matrix(c(${entries.map(val => val.genotypes.join(',')).join(',\n')}
48
+ ),nrow=${entries.length},byrow=TRUE)
49
+ rownames(inputMatrix)<-c(${keys.map(key => `'${key}'`).join(',')})
50
+ resultClusters<-hclust(dist(inputMatrix), method='single')
51
+ cat(resultClusters$order,sep='\\n')`;
52
+ setResults(text);
53
+ }
54
+ catch (e) {
55
+ if (!isAbortException(e) && isAlive(model)) {
56
+ console.error(e);
57
+ setError(e);
58
+ }
59
+ }
60
+ })();
61
+ }, [model]);
62
+ return (React.createElement(Dialog, { open: true, title: "Cluster by genotype", onClose: handleClose },
63
+ React.createElement(DialogContent, null,
64
+ React.createElement("div", { className: classes.mgap },
65
+ React.createElement(Typography, null, "This page will produce an R script that will perform hierarchical clustering on the visible genotype data using `hclust`."),
66
+ React.createElement(Typography, null, "You can then paste the results in this form to specify the row ordering."),
67
+ results ? (React.createElement("div", null,
68
+ React.createElement("div", null,
69
+ "Step 1:",
70
+ ' ',
71
+ React.createElement(Button, { variant: "contained", onClick: () => {
72
+ saveAs(new Blob([results || ''], {
73
+ type: 'text/plain;charset=utf-8',
74
+ }), 'cluster.R');
75
+ } }, "Download Rscript"),
76
+ ' ',
77
+ "or",
78
+ ' ',
79
+ React.createElement(Button, { variant: "contained", onClick: () => {
80
+ copy(results || '');
81
+ } }, "Copy Rscript to clipboard"),
82
+ React.createElement("div", null,
83
+ React.createElement(TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Step 2. Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
84
+ setPaste(event.target.value);
85
+ }, slotProps: {
86
+ input: {
87
+ classes: {
88
+ input: classes.textAreaFont,
89
+ },
90
+ },
91
+ } }))))) : (React.createElement(LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })),
92
+ error ? React.createElement(ErrorMessage, { error: error }) : null)),
93
+ React.createElement(DialogActions, null,
94
+ React.createElement(Button, { disabled: !results, variant: "contained", onClick: () => {
95
+ const { sources } = model;
96
+ if (sources) {
97
+ try {
98
+ model.setLayout(paste
99
+ .split('\n')
100
+ .map(t => t.trim())
101
+ .filter(f => !!f)
102
+ .map(r => +r)
103
+ .map(idx => {
104
+ const ret = sources[idx - 1];
105
+ if (!ret) {
106
+ throw new Error(`out of bounds at ${idx}`);
107
+ }
108
+ return ret;
109
+ }));
110
+ }
111
+ catch (e) {
112
+ console.error(e);
113
+ setError(e);
114
+ }
115
+ }
116
+ handleClose();
117
+ } }, "Apply clustering"),
118
+ React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
119
+ handleClose();
120
+ } }, "Cancel"))));
121
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { Source } from '../util';
3
+ declare const ColorLegend: ({ model, labelWidth, }: {
4
+ model: {
5
+ canDisplayLabels: boolean;
6
+ rowHeight: number;
7
+ sources?: Source[];
8
+ };
9
+ labelWidth: number;
10
+ }) => React.JSX.Element | null;
11
+ export default ColorLegend;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { clamp } from '@jbrowse/core/util';
3
+ import { observer } from 'mobx-react';
4
+ import RectBg from './RectBg';
5
+ const ColorLegend = observer(function ({ model, labelWidth, }) {
6
+ const { canDisplayLabels, rowHeight, sources } = model;
7
+ const svgFontSize = clamp(rowHeight, 8, 12);
8
+ const colorBoxWidth = 15;
9
+ const legendWidth = labelWidth + colorBoxWidth + 5;
10
+ return sources ? (React.createElement(React.Fragment, null,
11
+ canDisplayLabels ? (React.createElement(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null,
12
+ sources.map((source, idx) => {
13
+ const { color, name } = source;
14
+ return (React.createElement(React.Fragment, { key: `${name}-${idx}` },
15
+ color ? (React.createElement(RectBg, { y: idx * rowHeight + 1, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null,
16
+ canDisplayLabels ? (React.createElement("text", { y: idx * rowHeight + svgFontSize, x: colorBoxWidth + 2, fontSize: svgFontSize }, name)) : null));
17
+ }))) : null;
18
+ });
19
+ export default ColorLegend;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { DialogProps } from '@mui/material';
3
+ declare const DraggableDialog: (props: DialogProps & {
4
+ title: string;
5
+ }) => React.JSX.Element;
6
+ export default DraggableDialog;
@@ -0,0 +1,34 @@
1
+ import React, { useRef } from 'react';
2
+ import CloseIcon from '@mui/icons-material/Close';
3
+ import { Dialog, DialogTitle, Divider, IconButton, Paper, ScopedCssBaseline, } from '@mui/material';
4
+ import { observer } from 'mobx-react';
5
+ import Draggable from 'react-draggable';
6
+ import { makeStyles } from 'tss-react/mui';
7
+ const useStyles = makeStyles()(theme => ({
8
+ closeButton: {
9
+ position: 'absolute',
10
+ right: theme.spacing(1),
11
+ top: theme.spacing(1),
12
+ color: theme.palette.grey[500],
13
+ },
14
+ }));
15
+ function PaperComponent(props) {
16
+ const ref = useRef(null);
17
+ return (React.createElement(Draggable, { nodeRef: ref, cancel: '[class*="MuiDialogContent-root"]', onStart: arg => { var _a, _b; return (_b = (_a = arg.target) === null || _a === void 0 ? void 0 : _a.className) === null || _b === void 0 ? void 0 : _b.includes('MuiDialogTitle'); } },
18
+ React.createElement(Paper, { ref: ref, ...props })));
19
+ }
20
+ const DraggableDialog = observer(function DraggableDialog(props) {
21
+ const { classes } = useStyles();
22
+ const { title, children, onClose } = props;
23
+ return (React.createElement(Dialog, { ...props, PaperComponent: PaperComponent },
24
+ React.createElement(ScopedCssBaseline, null,
25
+ React.createElement(DialogTitle, { style: { cursor: 'move' } },
26
+ title,
27
+ onClose ? (React.createElement(IconButton, { className: classes.closeButton, onClick: () => {
28
+ onClose();
29
+ } },
30
+ React.createElement(CloseIcon, null))) : null),
31
+ React.createElement(Divider, null),
32
+ children)));
33
+ });
34
+ export default DraggableDialog;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { Source } from '../util';
3
+ interface ReducedModel {
4
+ scrollTop: number;
5
+ totalHeight: number;
6
+ rowHeight: number;
7
+ lineZoneHeight?: number;
8
+ sources?: Source[];
9
+ canDisplayLabels: boolean;
10
+ height: number;
11
+ id: string;
12
+ }
13
+ export declare const LegendBar: (props: {
14
+ model: ReducedModel;
15
+ orientation?: string;
16
+ exportSVG?: boolean;
17
+ }) => React.JSX.Element | null;
18
+ export default LegendBar;