@jbrowse/plugin-linear-genome-view 1.7.11 → 2.1.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 (272) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +119 -139
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  3. package/dist/BaseLinearDisplay/components/Block.js +53 -74
  4. package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
  5. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
  6. package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
  7. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  8. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +146 -175
  9. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  10. package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
  11. package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  12. package/dist/BaseLinearDisplay/index.js +13 -40
  13. package/dist/BaseLinearDisplay/index.js.map +1 -0
  14. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +19 -14
  15. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
  16. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  17. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
  18. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  19. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
  20. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
  21. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  22. package/dist/LinearBareDisplay/configSchema.js +11 -17
  23. package/dist/LinearBareDisplay/configSchema.js.map +1 -0
  24. package/dist/LinearBareDisplay/index.js +7 -20
  25. package/dist/LinearBareDisplay/index.js.map +1 -0
  26. package/dist/LinearBareDisplay/model.d.ts +15 -13
  27. package/dist/LinearBareDisplay/model.js +36 -42
  28. package/dist/LinearBareDisplay/model.js.map +1 -0
  29. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
  30. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
  31. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  32. package/dist/LinearBasicDisplay/configSchema.js +15 -23
  33. package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
  34. package/dist/LinearBasicDisplay/index.js +10 -22
  35. package/dist/LinearBasicDisplay/index.js.map +1 -0
  36. package/dist/LinearBasicDisplay/model.d.ts +20 -14
  37. package/dist/LinearBasicDisplay/model.js +180 -159
  38. package/dist/LinearBasicDisplay/model.js.map +1 -0
  39. package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
  40. package/dist/LinearGenomeView/components/CenterLine.js +60 -74
  41. package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
  42. package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
  43. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  44. package/dist/LinearGenomeView/components/Gridlines.d.ts +8 -0
  45. package/dist/LinearGenomeView/components/Gridlines.js +78 -0
  46. package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
  47. package/dist/LinearGenomeView/components/Header.d.ts +1 -0
  48. package/dist/LinearGenomeView/components/Header.js +70 -125
  49. package/dist/LinearGenomeView/components/Header.js.map +1 -0
  50. package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  51. package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
  52. package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
  53. package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -0
  54. package/dist/LinearGenomeView/components/ImportForm.js +222 -289
  55. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
  56. package/dist/LinearGenomeView/components/LinearGenomeView.js +60 -124
  57. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  58. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
  59. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  60. package/dist/LinearGenomeView/components/MiniControls.js +64 -78
  61. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
  62. package/dist/LinearGenomeView/components/OverviewRubberBand.js +229 -293
  63. package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  64. package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +3 -3
  65. package/dist/LinearGenomeView/components/OverviewScaleBar.js +275 -370
  66. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  67. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
  68. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
  69. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  70. package/dist/LinearGenomeView/components/RubberBand.js +228 -296
  71. package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
  72. package/dist/LinearGenomeView/components/Ruler.js +45 -90
  73. package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
  74. package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
  75. package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
  76. package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
  77. package/dist/LinearGenomeView/components/SearchBox.js +155 -166
  78. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
  79. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
  80. package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -149
  81. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  82. package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
  83. package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  84. package/dist/LinearGenomeView/components/TrackContainer.d.ts +2 -1
  85. package/dist/LinearGenomeView/components/TrackContainer.js +113 -158
  86. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
  87. package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
  88. package/dist/LinearGenomeView/components/TrackLabel.js +113 -133
  89. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
  90. package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  91. package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
  92. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
  93. package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
  94. package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
  95. package/dist/LinearGenomeView/components/util.js +94 -71
  96. package/dist/LinearGenomeView/components/util.js.map +1 -0
  97. package/dist/LinearGenomeView/index.d.ts +64 -77
  98. package/dist/LinearGenomeView/index.js +1035 -1412
  99. package/dist/LinearGenomeView/index.js.map +1 -0
  100. package/dist/LinearGenomeView/util.js +76 -83
  101. package/dist/LinearGenomeView/util.js.map +1 -0
  102. package/dist/index.d.ts +98 -48
  103. package/dist/index.js +225 -295
  104. package/dist/index.js.map +1 -0
  105. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
  106. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
  107. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  108. package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
  109. package/esm/BaseLinearDisplay/components/Block.js +46 -0
  110. package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
  111. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
  112. package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
  113. package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  114. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
  115. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +114 -0
  116. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  117. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
  118. package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
  119. package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  120. package/esm/BaseLinearDisplay/index.d.ts +5 -0
  121. package/esm/BaseLinearDisplay/index.js +4 -0
  122. package/esm/BaseLinearDisplay/index.js.map +1 -0
  123. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
  124. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
  125. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  126. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
  127. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
  128. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  129. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
  130. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
  131. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  132. package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
  133. package/esm/LinearBareDisplay/configSchema.js +9 -0
  134. package/esm/LinearBareDisplay/configSchema.js.map +1 -0
  135. package/esm/LinearBareDisplay/index.d.ts +2 -0
  136. package/esm/LinearBareDisplay/index.js +3 -0
  137. package/esm/LinearBareDisplay/index.js.map +1 -0
  138. package/esm/LinearBareDisplay/model.d.ts +194 -0
  139. package/esm/LinearBareDisplay/model.js +28 -0
  140. package/esm/LinearBareDisplay/model.js.map +1 -0
  141. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
  142. package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
  143. package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  144. package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
  145. package/esm/LinearBasicDisplay/configSchema.js +14 -0
  146. package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
  147. package/esm/LinearBasicDisplay/index.d.ts +2 -0
  148. package/esm/LinearBasicDisplay/index.js +3 -0
  149. package/esm/LinearBasicDisplay/index.js.map +1 -0
  150. package/esm/LinearBasicDisplay/model.d.ts +218 -0
  151. package/esm/LinearBasicDisplay/model.js +127 -0
  152. package/esm/LinearBasicDisplay/model.js.map +1 -0
  153. package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
  154. package/esm/LinearGenomeView/components/CenterLine.js +40 -0
  155. package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
  156. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
  157. package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
  158. package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  159. package/esm/LinearGenomeView/components/Gridlines.d.ts +8 -0
  160. package/esm/LinearGenomeView/components/Gridlines.js +71 -0
  161. package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
  162. package/esm/LinearGenomeView/components/Header.d.ts +7 -0
  163. package/esm/LinearGenomeView/components/Header.js +81 -0
  164. package/esm/LinearGenomeView/components/Header.js.map +1 -0
  165. package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
  166. package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
  167. package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
  168. package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
  169. package/esm/LinearGenomeView/components/ImportForm.js +141 -0
  170. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
  171. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
  172. package/esm/LinearGenomeView/components/LinearGenomeView.js +63 -0
  173. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  174. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
  175. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
  176. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  177. package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
  178. package/esm/LinearGenomeView/components/MiniControls.js +25 -0
  179. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
  180. package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
  181. package/esm/LinearGenomeView/components/OverviewRubberBand.js +197 -0
  182. package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  183. package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
  184. package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
  185. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  186. package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
  187. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
  188. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  189. package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
  190. package/esm/LinearGenomeView/components/RubberBand.js +197 -0
  191. package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
  192. package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
  193. package/esm/LinearGenomeView/components/Ruler.js +50 -0
  194. package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
  195. package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
  196. package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
  197. package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
  198. package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
  199. package/esm/LinearGenomeView/components/SearchBox.js +94 -0
  200. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
  201. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
  202. package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
  203. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  204. package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
  205. package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
  206. package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  207. package/esm/LinearGenomeView/components/TrackContainer.d.ts +10 -0
  208. package/esm/LinearGenomeView/components/TrackContainer.js +104 -0
  209. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
  210. package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
  211. package/esm/LinearGenomeView/components/TrackLabel.js +88 -0
  212. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
  213. package/{dist/LinearGenomeView/components/VerticalGuides.d.ts → esm/LinearGenomeView/components/TracksContainer.d.ts} +4 -3
  214. package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
  215. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
  216. package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
  217. package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
  218. package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
  219. package/esm/LinearGenomeView/components/util.d.ts +14 -0
  220. package/esm/LinearGenomeView/components/util.js +17 -0
  221. package/esm/LinearGenomeView/components/util.js.map +1 -0
  222. package/esm/LinearGenomeView/index.d.ts +275 -0
  223. package/esm/LinearGenomeView/index.js +978 -0
  224. package/esm/LinearGenomeView/index.js.map +1 -0
  225. package/esm/LinearGenomeView/util.d.ts +14 -0
  226. package/esm/LinearGenomeView/util.js +62 -0
  227. package/esm/LinearGenomeView/util.js.map +1 -0
  228. package/esm/index.d.ts +615 -0
  229. package/esm/index.js +127 -0
  230. package/esm/index.js.map +1 -0
  231. package/package.json +22 -15
  232. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -4
  233. package/src/BaseLinearDisplay/components/Block.tsx +5 -5
  234. package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
  235. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +9 -9
  236. package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
  237. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
  238. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
  239. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
  240. package/src/LinearBasicDisplay/model.ts +19 -11
  241. package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
  242. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
  243. package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +9 -11
  244. package/src/LinearGenomeView/components/Header.tsx +10 -15
  245. package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
  246. package/src/LinearGenomeView/components/ImportForm.tsx +6 -12
  247. package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
  248. package/src/LinearGenomeView/components/LinearGenomeView.tsx +6 -9
  249. package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
  250. package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
  251. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +61 -59
  252. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
  253. package/src/LinearGenomeView/components/RubberBand.tsx +12 -18
  254. package/src/LinearGenomeView/components/Ruler.tsx +5 -11
  255. package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
  256. package/src/LinearGenomeView/components/SearchBox.tsx +4 -3
  257. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -6
  258. package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
  259. package/src/LinearGenomeView/components/TrackContainer.tsx +29 -39
  260. package/src/LinearGenomeView/components/TrackLabel.tsx +76 -79
  261. package/src/LinearGenomeView/components/TracksContainer.tsx +10 -15
  262. package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
  263. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -550
  264. package/src/LinearGenomeView/index.test.ts +15 -36
  265. package/src/LinearGenomeView/index.tsx +390 -564
  266. package/src/index.ts +1 -1
  267. package/dist/LinearBareDisplay/index.test.js +0 -33
  268. package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
  269. package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
  270. package/dist/LinearGenomeView/components/VerticalGuides.js +0 -116
  271. package/dist/LinearGenomeView/index.test.js +0 -1187
  272. package/dist/LinearGenomeView/util.test.js +0 -78
@@ -1,5 +1,5 @@
1
- import { Instance } from 'mobx-state-tree';
2
1
  import React from 'react';
2
+ import { Instance } from 'mobx-state-tree';
3
3
  import { LinearGenomeViewStateModel } from '..';
4
4
  declare type LGV = Instance<LinearGenomeViewStateModel>;
5
5
  declare function TracksContainer({ children, model, }: {
@@ -1,214 +1,187 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
9
17
  });
10
- exports.default = void 0;
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _styles = require("@material-ui/core/styles");
15
-
16
- var _mobxReact = require("mobx-react");
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _normalizeWheel = _interopRequireDefault(require("normalize-wheel"));
21
-
22
- var _ = require("..");
23
-
24
- var _RubberBand = _interopRequireDefault(require("./RubberBand"));
25
-
26
- var _ScaleBar = _interopRequireDefault(require("./ScaleBar"));
27
-
28
- var _VerticalGuides = _interopRequireDefault(require("./VerticalGuides"));
29
-
30
- var _CenterLine = _interopRequireDefault(require("./CenterLine"));
31
-
32
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
-
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
- var useStyles = (0, _styles.makeStyles)(function (theme) {
37
- return {
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __read = (this && this.__read) || function (o, n) {
26
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
27
+ if (!m) return o;
28
+ var i = m.call(o), r, ar = [], e;
29
+ try {
30
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
+ }
32
+ catch (error) { e = { error: error }; }
33
+ finally {
34
+ try {
35
+ if (r && !r.done && (m = i["return"])) m.call(i);
36
+ }
37
+ finally { if (e) throw e.error; }
38
+ }
39
+ return ar;
40
+ };
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ var react_1 = __importStar(require("react"));
46
+ var mui_1 = require("tss-react/mui");
47
+ var mobx_react_1 = require("mobx-react");
48
+ var normalize_wheel_1 = __importDefault(require("normalize-wheel"));
49
+ var __1 = require("..");
50
+ var RubberBand_1 = __importDefault(require("./RubberBand"));
51
+ var ScaleBar_1 = __importDefault(require("./ScaleBar"));
52
+ var Gridlines_1 = __importDefault(require("./Gridlines"));
53
+ var CenterLine_1 = __importDefault(require("./CenterLine"));
54
+ var useStyles = (0, mui_1.makeStyles)()({
38
55
  tracksContainer: {
39
- position: 'relative',
40
- borderRadius: theme.shape.borderRadius,
41
- overflow: 'hidden'
56
+ position: 'relative',
57
+ overflow: 'hidden',
42
58
  },
43
59
  spacer: {
44
- position: 'relative',
45
- height: _.RESIZE_HANDLE_HEIGHT
46
- }
47
- };
60
+ position: 'relative',
61
+ height: 3,
62
+ },
48
63
  });
49
-
50
- function TracksContainer(_ref) {
51
- var children = _ref.children,
52
- model = _ref.model;
53
- var classes = useStyles(); // refs are to store these variables to avoid repeated rerenders associated
54
- // with useState/setState
55
-
56
- var delta = (0, _react.useRef)(0);
57
- var scheduled = (0, _react.useRef)(false);
58
- var timeout = (0, _react.useRef)();
59
- var ref = (0, _react.useRef)(null);
60
- var prevX = (0, _react.useRef)(0);
61
-
62
- var _useState = (0, _react.useState)(false),
63
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
64
- mouseDragging = _useState2[0],
65
- setMouseDragging = _useState2[1];
66
-
67
- (0, _react.useEffect)(function () {
68
- var cleanup = function cleanup() {};
69
-
70
- function globalMouseMove(event) {
71
- event.preventDefault();
72
- var currX = event.clientX;
73
- var distance = currX - prevX.current;
74
-
75
- if (distance) {
76
- // use rAF to make it so multiple event handlers aren't fired per-frame
77
- // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
78
- if (!scheduled.current) {
79
- scheduled.current = true;
80
- window.requestAnimationFrame(function () {
81
- model.horizontalScroll(-distance);
82
- scheduled.current = false;
64
+ function TracksContainer(_a) {
65
+ var children = _a.children, model = _a.model;
66
+ var classes = useStyles().classes;
67
+ // refs are to store these variables to avoid repeated rerenders associated
68
+ // with useState/setState
69
+ var delta = (0, react_1.useRef)(0);
70
+ var scheduled = (0, react_1.useRef)(false);
71
+ var timeout = (0, react_1.useRef)();
72
+ var ref = (0, react_1.useRef)(null);
73
+ var prevX = (0, react_1.useRef)(0);
74
+ var _b = __read((0, react_1.useState)(false), 2), mouseDragging = _b[0], setMouseDragging = _b[1];
75
+ (0, react_1.useEffect)(function () {
76
+ var cleanup = function () { };
77
+ function globalMouseMove(event) {
78
+ event.preventDefault();
79
+ var currX = event.clientX;
80
+ var distance = currX - prevX.current;
81
+ if (distance) {
82
+ // use rAF to make it so multiple event handlers aren't fired per-frame
83
+ // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
84
+ if (!scheduled.current) {
85
+ scheduled.current = true;
86
+ window.requestAnimationFrame(function () {
87
+ model.horizontalScroll(-distance);
88
+ scheduled.current = false;
89
+ prevX.current = event.clientX;
90
+ });
91
+ }
92
+ }
93
+ }
94
+ function globalMouseUp() {
95
+ prevX.current = 0;
96
+ if (mouseDragging) {
97
+ setMouseDragging(false);
98
+ }
99
+ }
100
+ if (mouseDragging) {
101
+ window.addEventListener('mousemove', globalMouseMove, true);
102
+ window.addEventListener('mouseup', globalMouseUp, true);
103
+ cleanup = function () {
104
+ window.removeEventListener('mousemove', globalMouseMove, true);
105
+ window.removeEventListener('mouseup', globalMouseUp, true);
106
+ };
107
+ }
108
+ return cleanup;
109
+ }, [model, mouseDragging, prevX]);
110
+ function mouseDown(event) {
111
+ // check if clicking a draggable element or a resize handle
112
+ var target = event.target;
113
+ if (target.draggable || target.dataset.resizer) {
114
+ return;
115
+ }
116
+ // otherwise do click and drag scroll
117
+ if (event.button === 0) {
83
118
  prevX.current = event.clientX;
84
- });
119
+ setMouseDragging(true);
85
120
  }
86
- }
87
121
  }
88
-
89
- function globalMouseUp() {
90
- prevX.current = 0;
91
-
92
- if (mouseDragging) {
122
+ // this local mouseup is used in addition to the global because sometimes
123
+ // the global add/remove are not called in time, resulting in issue #533
124
+ function mouseUp(event) {
125
+ event.preventDefault();
93
126
  setMouseDragging(false);
94
- }
95
- }
96
-
97
- if (mouseDragging) {
98
- window.addEventListener('mousemove', globalMouseMove, true);
99
- window.addEventListener('mouseup', globalMouseUp, true);
100
-
101
- cleanup = function cleanup() {
102
- window.removeEventListener('mousemove', globalMouseMove, true);
103
- window.removeEventListener('mouseup', globalMouseUp, true);
104
- };
105
127
  }
106
-
107
- return cleanup;
108
- }, [model, mouseDragging, prevX]);
109
-
110
- function mouseDown(event) {
111
- // check if clicking a draggable element or a resize handle
112
- var target = event.target;
113
-
114
- if (target.draggable || target.dataset.resizer) {
115
- return;
116
- } // otherwise do click and drag scroll
117
-
118
-
119
- if (event.button === 0) {
120
- prevX.current = event.clientX;
121
- setMouseDragging(true);
128
+ function mouseLeave(event) {
129
+ event.preventDefault();
122
130
  }
123
- } // this local mouseup is used in addition to the global because sometimes
124
- // the global add/remove are not called in time, resulting in issue #533
125
-
126
-
127
- function mouseUp(event) {
128
- event.preventDefault();
129
- setMouseDragging(false);
130
- }
131
-
132
- function mouseLeave(event) {
133
- event.preventDefault();
134
- }
135
-
136
- (0, _react.useEffect)(function () {
137
- var curr = ref.current; // if ctrl is held down, zoom in with y-scroll
138
- // else scroll horizontally with x-scroll
139
-
140
- function onWheel(origEvent) {
141
- var event = (0, _normalizeWheel.default)(origEvent);
142
-
143
- if (origEvent.ctrlKey === true) {
144
- origEvent.preventDefault();
145
- delta.current += event.pixelY / 500;
146
- model.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
147
-
148
- if (timeout.current) {
149
- clearTimeout(timeout.current);
131
+ (0, react_1.useEffect)(function () {
132
+ var curr = ref.current;
133
+ // if ctrl is held down, zoom in with y-scroll
134
+ // else scroll horizontally with x-scroll
135
+ function onWheel(origEvent) {
136
+ var event = (0, normalize_wheel_1.default)(origEvent);
137
+ if (origEvent.ctrlKey === true) {
138
+ origEvent.preventDefault();
139
+ delta.current += event.pixelY / 500;
140
+ model.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
141
+ if (timeout.current) {
142
+ clearTimeout(timeout.current);
143
+ }
144
+ timeout.current = setTimeout(function () {
145
+ model.setScaleFactor(1);
146
+ model.zoomTo(delta.current > 0
147
+ ? model.bpPerPx * (1 + delta.current)
148
+ : model.bpPerPx / (1 - delta.current));
149
+ delta.current = 0;
150
+ }, 300);
151
+ }
152
+ else {
153
+ // this is needed to stop the event from triggering "back button
154
+ // action" on MacOSX etc. but is a heuristic to avoid preventing the
155
+ // inner-track scroll behavior
156
+ if (Math.abs(event.pixelX) > Math.abs(2 * event.pixelY)) {
157
+ origEvent.preventDefault();
158
+ }
159
+ delta.current += event.pixelX;
160
+ if (!scheduled.current) {
161
+ // use rAF to make it so multiple event handlers aren't fired per-frame
162
+ // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
163
+ scheduled.current = true;
164
+ window.requestAnimationFrame(function () {
165
+ model.horizontalScroll(delta.current);
166
+ delta.current = 0;
167
+ scheduled.current = false;
168
+ });
169
+ }
170
+ }
150
171
  }
151
-
152
- timeout.current = setTimeout(function () {
153
- model.setScaleFactor(1);
154
- model.zoomTo(delta.current > 0 ? model.bpPerPx * (1 + delta.current) : model.bpPerPx / (1 - delta.current));
155
- delta.current = 0;
156
- }, 300);
157
- } else {
158
- // this is needed to stop the event from triggering "back button
159
- // action" on MacOSX etc. but is a heuristic to avoid preventing the
160
- // inner-track scroll behavior
161
- if (Math.abs(event.pixelX) > Math.abs(2 * event.pixelY)) {
162
- origEvent.preventDefault();
172
+ if (curr) {
173
+ curr.addEventListener('wheel', onWheel);
174
+ return function () {
175
+ curr.removeEventListener('wheel', onWheel);
176
+ };
163
177
  }
164
-
165
- delta.current += event.pixelX;
166
-
167
- if (!scheduled.current) {
168
- // use rAF to make it so multiple event handlers aren't fired per-frame
169
- // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
170
- scheduled.current = true;
171
- window.requestAnimationFrame(function () {
172
- model.horizontalScroll(delta.current);
173
- delta.current = 0;
174
- scheduled.current = false;
175
- });
176
- }
177
- }
178
- }
179
-
180
- if (curr) {
181
- curr.addEventListener('wheel', onWheel);
182
- return function () {
183
- curr.removeEventListener('wheel', onWheel);
184
- };
185
- }
186
-
187
- return function () {};
188
- }, [model]);
189
- return /*#__PURE__*/_react.default.createElement("div", {
190
- ref: ref,
191
- role: "presentation",
192
- className: classes.tracksContainer,
193
- onMouseDown: mouseDown,
194
- onMouseUp: mouseUp,
195
- onMouseLeave: mouseLeave
196
- }, /*#__PURE__*/_react.default.createElement(_VerticalGuides.default, {
197
- model: model
198
- }), model.showCenterLine ? /*#__PURE__*/_react.default.createElement(_CenterLine.default, {
199
- model: model
200
- }) : null, /*#__PURE__*/_react.default.createElement(_RubberBand.default, {
201
- model: model,
202
- ControlComponent: /*#__PURE__*/_react.default.createElement(_ScaleBar.default, {
203
- model: model,
204
- style: {
205
- height: _.SCALE_BAR_HEIGHT,
206
- boxSizing: 'border-box'
207
- }
208
- })
209
- }), children);
178
+ return function () { };
179
+ }, [model]);
180
+ return (react_1.default.createElement("div", { ref: ref, "data-testid": "trackContainer", className: classes.tracksContainer, onMouseDown: mouseDown, onMouseUp: mouseUp, onMouseLeave: mouseLeave },
181
+ model.showGridlines ? react_1.default.createElement(Gridlines_1.default, { model: model }) : null,
182
+ model.showCenterLine ? react_1.default.createElement(CenterLine_1.default, { model: model }) : null,
183
+ react_1.default.createElement(RubberBand_1.default, { model: model, ControlComponent: react_1.default.createElement(ScaleBar_1.default, { model: model, style: { height: __1.SCALE_BAR_HEIGHT, boxSizing: 'border-box' } }) }),
184
+ children));
210
185
  }
211
-
212
- var _default = (0, _mobxReact.observer)(TracksContainer);
213
-
214
- exports.default = _default;
186
+ exports.default = (0, mobx_react_1.observer)(TracksContainer);
187
+ //# sourceMappingURL=TracksContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TracksContainer.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/TracksContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAC1D,qCAA0C;AAC1C,yCAAqC;AAErC,oEAA4C;AAE5C,wBAAiE;AACjE,4DAAqC;AACrC,wDAAiC;AACjC,0DAAmC;AACnC,4DAAqC;AAErC,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC;IAC7B,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,QAAQ;KACnB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;KACV;CACF,CAAC,CAAA;AAKF,SAAS,eAAe,CAAC,EAMxB;QALC,QAAQ,cAAA,EACR,KAAK,WAAA;IAKG,IAAA,OAAO,GAAK,SAAS,EAAE,QAAhB,CAAgB;IAC/B,2EAA2E;IAC3E,yBAAyB;IACzB,IAAM,KAAK,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAA;IACvB,IAAM,SAAS,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAA;IAC/B,IAAM,OAAO,GAAG,IAAA,cAAM,GAAS,CAAA;IAC/B,IAAM,GAAG,GAAG,IAAA,cAAM,EAAiB,IA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CAAC;QACD,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACvC,OAAO;gBACL,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAC5C,CAAC,CAAA;SACF;QACD,OAAO,cAAO,CAAC,CAAA;IACjB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,CACL,uCACE,GAAG,EAAE,GAAG,iBACI,gBAAgB,EAC5B,SAAS,EAAE,OAAO,CAAC,eAAe,EAClC,WAAW,EAAE,SAAS,EACtB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,UAAU;QAEvB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,8BAAC,mBAAS,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI;QACxD,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,8BAAC,oBAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI;QAE3D,8BAAC,oBAAU,IACT,KAAK,EAAE,KAAK,EACZ,gBAAgB,EACd,8BAAC,kBAAQ,IACP,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,MAAM,EAAE,oBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,GAC5D,GAEJ;QACD,QAAQ,CACL,CACP,CAAA;AACH,CAAC;AAED,kBAAe,IAAA,qBAAQ,EAAC,eAAe,CAAC,CAAA"}
@@ -1,92 +1,77 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
9
17
  });
10
- exports.default = void 0;
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _react = _interopRequireWildcard(require("react"));
15
-
16
- var _mobxReact = require("mobx-react");
17
-
18
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
19
-
20
- var _Slider = _interopRequireDefault(require("@material-ui/core/Slider"));
21
-
22
- var _styles = require("@material-ui/core/styles");
23
-
24
- var _ZoomIn = _interopRequireDefault(require("@material-ui/icons/ZoomIn"));
25
-
26
- var _ZoomOut = _interopRequireDefault(require("@material-ui/icons/ZoomOut"));
27
-
28
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
- var useStyles = (0, _styles.makeStyles)({
33
- container: {
34
- display: 'flex',
35
- flexDirection: 'row',
36
- alignItems: 'center'
37
- },
38
- slider: {
39
- width: 70
40
- }
41
- });
42
-
43
- function ZoomControls(_ref) {
44
- var model = _ref.model;
45
- var classes = useStyles();
46
- var maxBpPerPx = model.maxBpPerPx,
47
- minBpPerPx = model.minBpPerPx,
48
- bpPerPx = model.bpPerPx,
49
- scaleFactor = model.scaleFactor;
50
-
51
- var _useState = (0, _react.useState)(-Math.log2(bpPerPx) * 100),
52
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
53
- value = _useState2[0],
54
- setValue = _useState2[1];
55
-
56
- (0, _react.useEffect)(function () {
57
- setValue(-Math.log2(bpPerPx) * 100);
58
- }, [setValue, bpPerPx]);
59
- return /*#__PURE__*/_react.default.createElement("div", {
60
- className: classes.container
61
- }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
62
- "data-testid": "zoom_out",
63
- onClick: function onClick() {
64
- model.zoom(bpPerPx * 2);
65
- },
66
- disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1,
67
- color: "secondary"
68
- }, /*#__PURE__*/_react.default.createElement(_ZoomOut.default, null)), /*#__PURE__*/_react.default.createElement(_Slider.default, {
69
- className: classes.slider,
70
- value: value,
71
- min: -Math.log2(maxBpPerPx) * 100,
72
- max: -Math.log2(minBpPerPx) * 100,
73
- onChange: function onChange(_, val) {
74
- return setValue(val);
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __read = (this && this.__read) || function (o, n) {
26
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
27
+ if (!m) return o;
28
+ var i = m.call(o), r, ar = [], e;
29
+ try {
30
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
31
+ }
32
+ catch (error) { e = { error: error }; }
33
+ finally {
34
+ try {
35
+ if (r && !r.done && (m = i["return"])) m.call(i);
36
+ }
37
+ finally { if (e) throw e.error; }
38
+ }
39
+ return ar;
40
+ };
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ var react_1 = __importStar(require("react"));
46
+ var mobx_react_1 = require("mobx-react");
47
+ var material_1 = require("@mui/material");
48
+ var mui_1 = require("tss-react/mui");
49
+ var ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
50
+ var ZoomOut_1 = __importDefault(require("@mui/icons-material/ZoomOut"));
51
+ var useStyles = (0, mui_1.makeStyles)()({
52
+ container: {
53
+ display: 'flex',
54
+ flexDirection: 'row',
55
+ alignItems: 'center',
75
56
  },
76
- onChangeCommitted: function onChangeCommitted() {
77
- return model.zoomTo(Math.pow(2, -value / 100));
57
+ slider: {
58
+ width: 70,
78
59
  },
79
- disabled: scaleFactor !== 1
80
- }), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
81
- "data-testid": "zoom_in",
82
- onClick: function onClick() {
83
- model.zoom(model.bpPerPx / 2);
84
- },
85
- disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1,
86
- color: "secondary"
87
- }, /*#__PURE__*/_react.default.createElement(_ZoomIn.default, null)));
60
+ });
61
+ function ZoomControls(_a) {
62
+ var model = _a.model;
63
+ var classes = useStyles().classes;
64
+ var maxBpPerPx = model.maxBpPerPx, minBpPerPx = model.minBpPerPx, bpPerPx = model.bpPerPx, scaleFactor = model.scaleFactor;
65
+ var _b = __read((0, react_1.useState)(-Math.log2(bpPerPx) * 100), 2), value = _b[0], setValue = _b[1];
66
+ (0, react_1.useEffect)(function () {
67
+ setValue(-Math.log2(bpPerPx) * 100);
68
+ }, [setValue, bpPerPx]);
69
+ return (react_1.default.createElement("div", { className: classes.container },
70
+ react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_out", onClick: function () { return model.zoom(bpPerPx * 2); }, disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
71
+ react_1.default.createElement(ZoomOut_1.default, null)),
72
+ react_1.default.createElement(material_1.Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChange: function (_, val) { return setValue(val); }, onChangeCommitted: function () { return model.zoomTo(Math.pow(2, (-value / 100))); }, disabled: scaleFactor !== 1 }),
73
+ react_1.default.createElement(material_1.IconButton, { "data-testid": "zoom_in", onClick: function () { return model.zoom(model.bpPerPx / 2); }, disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1, color: "secondary", size: "large" },
74
+ react_1.default.createElement(ZoomIn_1.default, null))));
88
75
  }
89
-
90
- var _default = (0, _mobxReact.observer)(ZoomControls);
91
-
92
- exports.default = _default;
76
+ exports.default = (0, mobx_react_1.observer)(ZoomControls);
77
+ //# sourceMappingURL=ZoomControls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomControls.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/ZoomControls.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAkD;AAClD,yCAAqC;AACrC,0CAAkD;AAClD,qCAA0C;AAC1C,sEAA+C;AAC/C,wEAAiD;AAGjD,IAAM,SAAS,GAAG,IAAA,gBAAU,GAAE,CAAC;IAC7B,SAAS,EAAE;QACT,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,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