@jbrowse/plugin-linear-genome-view 2.2.1 → 2.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 (271) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -2
  3. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  4. package/dist/BaseLinearDisplay/components/Block.d.ts +1 -1
  5. package/dist/BaseLinearDisplay/components/Block.js +1 -1
  6. package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
  7. package/dist/BaseLinearDisplay/components/BlockMsg.js +3 -2
  8. package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
  9. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
  10. package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  11. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
  12. package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
  13. package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
  14. package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
  15. package/dist/BaseLinearDisplay/index.d.ts +2 -2
  16. package/dist/BaseLinearDisplay/index.js +4 -3
  17. package/dist/BaseLinearDisplay/index.js.map +1 -1
  18. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
  19. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
  20. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  21. package/dist/BaseLinearDisplay/models/configSchema.d.ts +2 -0
  22. package/dist/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -5
  23. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -0
  24. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
  25. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  26. package/dist/BaseLinearDisplay/models/util.d.ts +18 -0
  27. package/dist/BaseLinearDisplay/models/util.js +18 -0
  28. package/dist/BaseLinearDisplay/models/util.js.map +1 -0
  29. package/dist/FeatureTrack/index.d.ts +1 -1
  30. package/dist/FeatureTrack/index.js +5 -4
  31. package/dist/FeatureTrack/index.js.map +1 -1
  32. package/dist/LaunchLinearGenomeView/index.d.ts +3 -0
  33. package/dist/LaunchLinearGenomeView/index.js +44 -0
  34. package/dist/LaunchLinearGenomeView/index.js.map +1 -0
  35. package/dist/LinearBareDisplay/index.d.ts +6 -2
  36. package/dist/LinearBareDisplay/index.js +18 -2
  37. package/dist/LinearBareDisplay/index.js.map +1 -1
  38. package/dist/LinearBareDisplay/model.d.ts +1 -1
  39. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +2 -15
  40. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
  41. package/dist/LinearBasicDisplay/index.d.ts +6 -2
  42. package/dist/LinearBasicDisplay/index.js +21 -4
  43. package/dist/LinearBasicDisplay/index.js.map +1 -1
  44. package/dist/LinearBasicDisplay/model.d.ts +17 -13
  45. package/dist/LinearBasicDisplay/model.js +2 -1
  46. package/dist/LinearBasicDisplay/model.js.map +1 -1
  47. package/dist/LinearGenomeView/components/ExportSvgDialog.js +1 -19
  48. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
  49. package/dist/LinearGenomeView/components/GetSequenceDialog.js +7 -18
  50. package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  51. package/dist/LinearGenomeView/components/Header.js +2 -2
  52. package/dist/LinearGenomeView/components/HelpDialog.js +2 -17
  53. package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
  54. package/dist/LinearGenomeView/components/ImportForm.js +15 -10
  55. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  56. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +6 -7
  57. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
  58. package/{esm/LinearGenomeView/components/OverviewRubberBand.d.ts → dist/LinearGenomeView/components/OverviewRubberband.d.ts} +2 -2
  59. package/dist/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +27 -79
  60. package/dist/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
  61. package/dist/LinearGenomeView/components/{OverviewScaleBar.d.ts → OverviewScalebar.d.ts} +2 -2
  62. package/dist/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
  63. package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
  64. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
  65. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  66. package/dist/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +2 -2
  67. package/dist/LinearGenomeView/components/Rubberband.js +57 -0
  68. package/dist/LinearGenomeView/components/Rubberband.js.map +1 -0
  69. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
  70. package/dist/LinearGenomeView/components/RubberbandSpan.js +90 -0
  71. package/dist/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
  72. package/dist/LinearGenomeView/components/Ruler.d.ts +2 -18
  73. package/dist/LinearGenomeView/components/Ruler.js +9 -25
  74. package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
  75. package/dist/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +2 -2
  76. package/dist/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
  77. package/dist/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
  78. package/dist/LinearGenomeView/components/SearchBox.js +10 -6
  79. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
  80. package/dist/LinearGenomeView/components/SearchResultsDialog.js +17 -31
  81. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  82. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +4 -19
  83. package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  84. package/dist/LinearGenomeView/components/TrackContainer.js +2 -2
  85. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
  86. package/dist/LinearGenomeView/components/TracksContainer.js +21 -118
  87. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  88. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
  89. package/dist/LinearGenomeView/components/VerticalGuide.js +29 -0
  90. package/dist/LinearGenomeView/components/VerticalGuide.js.map +1 -0
  91. package/dist/LinearGenomeView/components/hooks.d.ts +65 -0
  92. package/dist/LinearGenomeView/components/hooks.js +264 -0
  93. package/dist/LinearGenomeView/components/hooks.js.map +1 -0
  94. package/dist/LinearGenomeView/components/util.d.ts +5 -2
  95. package/dist/LinearGenomeView/components/util.js +7 -6
  96. package/dist/LinearGenomeView/components/util.js.map +1 -1
  97. package/dist/LinearGenomeView/index.d.ts +3 -534
  98. package/dist/LinearGenomeView/index.js +12 -1327
  99. package/dist/LinearGenomeView/index.js.map +1 -1
  100. package/dist/LinearGenomeView/model.d.ts +535 -0
  101. package/dist/LinearGenomeView/model.js +1357 -0
  102. package/dist/LinearGenomeView/model.js.map +1 -0
  103. package/dist/index.d.ts +6 -6
  104. package/dist/index.js +12 -73
  105. package/dist/index.js.map +1 -1
  106. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
  107. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -2
  108. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  109. package/esm/BaseLinearDisplay/components/Block.d.ts +1 -1
  110. package/esm/BaseLinearDisplay/components/Block.js +1 -1
  111. package/esm/BaseLinearDisplay/components/Block.js.map +1 -1
  112. package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -2
  113. package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
  114. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
  115. package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  116. package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
  117. package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
  118. package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
  119. package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
  120. package/esm/BaseLinearDisplay/index.d.ts +2 -2
  121. package/esm/BaseLinearDisplay/index.js +2 -2
  122. package/esm/BaseLinearDisplay/index.js.map +1 -1
  123. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
  124. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
  125. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  126. package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -0
  127. package/esm/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -4
  128. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -0
  129. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
  130. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  131. package/esm/BaseLinearDisplay/models/util.d.ts +18 -0
  132. package/esm/BaseLinearDisplay/models/util.js +14 -0
  133. package/esm/BaseLinearDisplay/models/util.js.map +1 -0
  134. package/esm/FeatureTrack/index.d.ts +1 -1
  135. package/esm/FeatureTrack/index.js +5 -4
  136. package/esm/FeatureTrack/index.js.map +1 -1
  137. package/esm/LaunchLinearGenomeView/index.d.ts +3 -0
  138. package/esm/LaunchLinearGenomeView/index.js +42 -0
  139. package/esm/LaunchLinearGenomeView/index.js.map +1 -0
  140. package/esm/LinearBareDisplay/index.d.ts +6 -2
  141. package/esm/LinearBareDisplay/index.js +19 -2
  142. package/esm/LinearBareDisplay/index.js.map +1 -1
  143. package/esm/LinearBareDisplay/model.d.ts +1 -1
  144. package/esm/LinearBasicDisplay/components/SetMaxHeight.js +3 -13
  145. package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
  146. package/esm/LinearBasicDisplay/index.d.ts +6 -2
  147. package/esm/LinearBasicDisplay/index.js +20 -2
  148. package/esm/LinearBasicDisplay/index.js.map +1 -1
  149. package/esm/LinearBasicDisplay/model.d.ts +17 -13
  150. package/esm/LinearBasicDisplay/model.js +2 -1
  151. package/esm/LinearBasicDisplay/model.js.map +1 -1
  152. package/esm/LinearGenomeView/components/ExportSvgDialog.js +3 -18
  153. package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
  154. package/esm/LinearGenomeView/components/GetSequenceDialog.js +8 -19
  155. package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  156. package/esm/LinearGenomeView/components/Header.js +2 -2
  157. package/esm/LinearGenomeView/components/HelpDialog.js +3 -18
  158. package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -1
  159. package/esm/LinearGenomeView/components/ImportForm.js +15 -10
  160. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  161. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +4 -5
  162. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
  163. package/{dist/LinearGenomeView/components/OverviewRubberBand.d.ts → esm/LinearGenomeView/components/OverviewRubberband.d.ts} +2 -2
  164. package/esm/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +25 -80
  165. package/esm/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
  166. package/esm/LinearGenomeView/components/{OverviewScaleBar.d.ts → OverviewScalebar.d.ts} +2 -2
  167. package/esm/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
  168. package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
  169. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
  170. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  171. package/esm/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +2 -2
  172. package/esm/LinearGenomeView/components/Rubberband.js +29 -0
  173. package/esm/LinearGenomeView/components/Rubberband.js.map +1 -0
  174. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
  175. package/esm/LinearGenomeView/components/RubberbandSpan.js +65 -0
  176. package/esm/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
  177. package/esm/LinearGenomeView/components/Ruler.d.ts +2 -18
  178. package/esm/LinearGenomeView/components/Ruler.js +6 -22
  179. package/esm/LinearGenomeView/components/Ruler.js.map +1 -1
  180. package/esm/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +2 -2
  181. package/esm/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
  182. package/esm/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
  183. package/esm/LinearGenomeView/components/SearchBox.js +10 -6
  184. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
  185. package/esm/LinearGenomeView/components/SearchResultsDialog.js +18 -32
  186. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  187. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +5 -17
  188. package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  189. package/esm/LinearGenomeView/components/TrackContainer.js +2 -2
  190. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
  191. package/esm/LinearGenomeView/components/TracksContainer.js +22 -119
  192. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  193. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
  194. package/esm/LinearGenomeView/components/VerticalGuide.js +24 -0
  195. package/esm/LinearGenomeView/components/VerticalGuide.js.map +1 -0
  196. package/esm/LinearGenomeView/components/hooks.d.ts +65 -0
  197. package/esm/LinearGenomeView/components/hooks.js +255 -0
  198. package/esm/LinearGenomeView/components/hooks.js.map +1 -0
  199. package/esm/LinearGenomeView/components/util.d.ts +5 -2
  200. package/esm/LinearGenomeView/components/util.js +4 -3
  201. package/esm/LinearGenomeView/components/util.js.map +1 -1
  202. package/esm/LinearGenomeView/index.d.ts +3 -534
  203. package/esm/LinearGenomeView/index.js +10 -1318
  204. package/esm/LinearGenomeView/index.js.map +1 -1
  205. package/esm/LinearGenomeView/model.d.ts +535 -0
  206. package/esm/LinearGenomeView/model.js +1322 -0
  207. package/esm/LinearGenomeView/model.js.map +1 -0
  208. package/esm/index.d.ts +6 -6
  209. package/esm/index.js +12 -74
  210. package/esm/index.js.map +1 -1
  211. package/package.json +5 -6
  212. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +86 -84
  213. package/src/BaseLinearDisplay/components/Block.tsx +15 -11
  214. package/src/BaseLinearDisplay/components/BlockMsg.tsx +9 -9
  215. package/src/BaseLinearDisplay/components/LinearBlocks.tsx +62 -58
  216. package/src/BaseLinearDisplay/{models → components}/TooLargeMessage.tsx +0 -0
  217. package/src/BaseLinearDisplay/index.ts +2 -1
  218. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +4 -3
  219. package/src/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.ts → configSchema.ts} +5 -3
  220. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
  221. package/src/BaseLinearDisplay/models/util.ts +24 -0
  222. package/src/FeatureTrack/index.ts +5 -8
  223. package/src/LaunchLinearGenomeView/index.ts +66 -0
  224. package/src/LinearBareDisplay/index.ts +23 -2
  225. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +3 -28
  226. package/src/LinearBasicDisplay/index.ts +24 -2
  227. package/src/LinearBasicDisplay/model.ts +2 -1
  228. package/src/LinearGenomeView/README.md +2 -1
  229. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -23
  230. package/src/LinearGenomeView/components/GetSequenceDialog.tsx +13 -31
  231. package/src/LinearGenomeView/components/Header.tsx +3 -3
  232. package/src/LinearGenomeView/components/HelpDialog.tsx +8 -34
  233. package/src/LinearGenomeView/components/ImportForm.tsx +13 -9
  234. package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +132 -134
  235. package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +4 -5
  236. package/src/LinearGenomeView/components/{OverviewRubberBand.tsx → OverviewRubberband.tsx} +32 -114
  237. package/src/LinearGenomeView/components/{OverviewScaleBar.tsx → OverviewScalebar.tsx} +26 -25
  238. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +2 -1
  239. package/src/LinearGenomeView/components/Rubberband.tsx +89 -0
  240. package/src/LinearGenomeView/components/RubberbandSpan.tsx +116 -0
  241. package/src/LinearGenomeView/components/Ruler.tsx +11 -28
  242. package/src/LinearGenomeView/components/{ScaleBar.test.tsx → Scalebar.test.tsx} +5 -5
  243. package/src/LinearGenomeView/components/{ScaleBar.tsx → Scalebar.tsx} +11 -11
  244. package/src/LinearGenomeView/components/SearchBox.tsx +8 -6
  245. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -44
  246. package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +4 -30
  247. package/src/LinearGenomeView/components/TrackContainer.tsx +4 -2
  248. package/src/LinearGenomeView/components/TracksContainer.tsx +59 -136
  249. package/src/LinearGenomeView/components/VerticalGuide.tsx +37 -0
  250. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +39 -44
  251. package/src/LinearGenomeView/components/hooks.ts +300 -0
  252. package/src/LinearGenomeView/components/util.ts +8 -11
  253. package/src/LinearGenomeView/index.test.ts +6 -7
  254. package/src/LinearGenomeView/index.ts +18 -0
  255. package/src/LinearGenomeView/{index.tsx → model.ts} +7 -4
  256. package/src/index.ts +16 -108
  257. package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
  258. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
  259. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
  260. package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
  261. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
  262. package/dist/LinearGenomeView/components/RubberBand.js +0 -221
  263. package/dist/LinearGenomeView/components/RubberBand.js.map +0 -1
  264. package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
  265. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
  266. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
  267. package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
  268. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
  269. package/esm/LinearGenomeView/components/RubberBand.js +0 -196
  270. package/esm/LinearGenomeView/components/RubberBand.js.map +0 -1
  271. package/src/LinearGenomeView/components/RubberBand.tsx +0 -308
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<LinearGenomeView /> renders one track, one region 1`] = `
3
+ exports[`renders one track, one region 1`] = `
4
4
  <div
5
5
  style="position: relative;"
6
6
  >
@@ -9,57 +9,57 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
9
9
  style="position: relative;"
10
10
  >
11
11
  <div
12
- class="css-16hdnmo-rubberBandControl"
12
+ class="css-dznme2-rubberbandControl"
13
13
  role="presentation"
14
14
  >
15
15
  <div
16
- class="css-1420449-scaleBar"
16
+ class="css-16vhz0m-scalebar"
17
17
  >
18
18
  <div
19
- class="css-1i1w1rp-scaleBarVisibleRegion"
19
+ class="css-den3n5-scalebarVisibleRegion"
20
20
  style="width: 800px; left: 0px; background: rgba(66, 165, 245, 0.3); border-color: #42a5f5;"
21
21
  />
22
22
  <div
23
- class="css-z1h6g4-scaleBarContig"
23
+ class="css-osn2dd-scalebarContig"
24
24
  style="width: 0px; left: 0px; background-color: rgb(153, 153, 153);"
25
25
  />
26
26
  <div>
27
27
  <p
28
- class="MuiTypography-root MuiTypography-body1 css-6v00mp-MuiTypography-root-scaleBarRefName"
28
+ class="MuiTypography-root MuiTypography-body1 css-1hokke9-MuiTypography-root-scalebarRefName"
29
29
  style="left: 3px; color: rgb(153, 102, 0);"
30
30
  >
31
31
  ctgA
32
32
  </p>
33
33
  <div
34
- class="css-1an6zsa-scaleBarContig-scaleBarContigForward-scaleBarBorder"
34
+ class="css-c4j89u-scalebarContig-scalebarContigForward-scalebarBorder"
35
35
  style="left: 0px; width: 800px; border-color: rgb(153, 102, 0);"
36
36
  >
37
37
  <p
38
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
38
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
39
39
  style="left: 160px; pointer-events: none; color: rgb(153, 102, 0);"
40
40
  >
41
41
  20
42
42
  </p>
43
43
  <p
44
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
44
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
45
45
  style="left: 320px; pointer-events: none; color: rgb(153, 102, 0);"
46
46
  >
47
47
  40
48
48
  </p>
49
49
  <p
50
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
50
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
51
51
  style="left: 480px; pointer-events: none; color: rgb(153, 102, 0);"
52
52
  >
53
53
  60
54
54
  </p>
55
55
  <p
56
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
56
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
57
57
  style="left: 640px; pointer-events: none; color: rgb(153, 102, 0);"
58
58
  >
59
59
  80
60
60
  </p>
61
61
  <p
62
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
62
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
63
63
  style="left: 800px; pointer-events: none; color: rgb(153, 102, 0);"
64
64
  >
65
65
  100
@@ -67,7 +67,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
67
67
  </div>
68
68
  </div>
69
69
  <div
70
- class="css-z1h6g4-scaleBarContig"
70
+ class="css-osn2dd-scalebarContig"
71
71
  style="width: 0px; left: 800px; background-color: rgb(153, 153, 153);"
72
72
  />
73
73
  </div>
@@ -381,20 +381,19 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
381
381
  </div>
382
382
  </div>
383
383
  <div
384
- class="css-16hdnmo-rubberBandControl"
385
- data-testid="rubberBand_controls"
386
- role="presentation"
384
+ class="css-dznme2-rubberbandControl"
385
+ data-testid="rubberband_controls"
387
386
  >
388
387
  <div
389
- class="MuiPaper-root MuiPaper-outlined MuiPaper-rounded css-1gfu64w-MuiPaper-root-scaleBarContainer"
388
+ class="MuiPaper-root MuiPaper-outlined MuiPaper-rounded css-1coqp07-MuiPaper-root-scalebarContainer"
390
389
  data-resizer="true"
391
390
  style="height: 17px; box-sizing: border-box;"
392
391
  >
393
392
  <div
394
- class="css-17t6jej-scaleBarZoomContainer"
393
+ class="css-khofof-scalebarZoomContainer"
395
394
  >
396
395
  <div
397
- class="css-1u2dss8-scaleBar"
396
+ class="css-y3821b-scalebar"
398
397
  style="left: -801px; width: 1700px; height: 17px; box-sizing: border-box;"
399
398
  >
400
399
  <div
@@ -512,7 +511,6 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
512
511
  >
513
512
  <div
514
513
  class="css-d6gpow-linearBlocks"
515
- data-testid="Blockset"
516
514
  style="left: -800px;"
517
515
  >
518
516
  <div
@@ -545,7 +543,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
545
543
  </div>
546
544
  `;
547
545
 
548
- exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
546
+ exports[`renders two tracks, two regions 1`] = `
549
547
  <div
550
548
  style="position: relative;"
551
549
  >
@@ -554,73 +552,73 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
554
552
  style="position: relative;"
555
553
  >
556
554
  <div
557
- class="css-16hdnmo-rubberBandControl"
555
+ class="css-dznme2-rubberbandControl"
558
556
  role="presentation"
559
557
  >
560
558
  <div
561
- class="css-1420449-scaleBar"
559
+ class="css-16vhz0m-scalebar"
562
560
  >
563
561
  <div
564
- class="css-1i1w1rp-scaleBarVisibleRegion"
562
+ class="css-den3n5-scalebarVisibleRegion"
565
563
  style="width: 580px; left: 0px; background: rgba(66, 165, 245, 0.3); border-color: #42a5f5;"
566
564
  />
567
565
  <div
568
- class="css-z1h6g4-scaleBarContig"
566
+ class="css-osn2dd-scalebarContig"
569
567
  style="width: 0px; left: 0px; background-color: rgb(153, 153, 153);"
570
568
  />
571
569
  <div>
572
570
  <p
573
- class="MuiTypography-root MuiTypography-body1 css-6v00mp-MuiTypography-root-scaleBarRefName"
571
+ class="MuiTypography-root MuiTypography-body1 css-1hokke9-MuiTypography-root-scalebarRefName"
574
572
  style="left: 3px; color: rgb(153, 102, 0);"
575
573
  >
576
574
  ctgA
577
575
  </p>
578
576
  <div
579
- class="css-1an6zsa-scaleBarContig-scaleBarContigForward-scaleBarBorder"
577
+ class="css-c4j89u-scalebarContig-scalebarContigForward-scalebarBorder"
580
578
  style="left: 0px; width: 72.72727272727273px; border-color: rgb(153, 102, 0);"
581
579
  />
582
580
  </div>
583
581
  <div
584
- class="css-z1h6g4-scaleBarContig"
582
+ class="css-osn2dd-scalebarContig"
585
583
  style="width: 0px; left: 72.72727272727273px; background-color: rgb(153, 153, 153);"
586
584
  />
587
585
  <div>
588
586
  <p
589
- class="MuiTypography-root MuiTypography-body1 css-6v00mp-MuiTypography-root-scaleBarRefName"
587
+ class="MuiTypography-root MuiTypography-body1 css-1hokke9-MuiTypography-root-scalebarRefName"
590
588
  style="left: 75.72727272727273px;"
591
589
  >
592
590
  ctgB
593
591
  </p>
594
592
  <div
595
- class="css-1an6zsa-scaleBarContig-scaleBarContigForward-scaleBarBorder"
593
+ class="css-c4j89u-scalebarContig-scalebarContigForward-scalebarBorder"
596
594
  style="left: 72.72727272727273px; width: 727.2727272727273px;"
597
595
  >
598
596
  <p
599
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
597
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
600
598
  style="left: 145.0909090909091px; pointer-events: none;"
601
599
  >
602
600
  1,200
603
601
  </p>
604
602
  <p
605
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
603
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
606
604
  style="left: 290.1818181818182px; pointer-events: none;"
607
605
  >
608
606
  1,400
609
607
  </p>
610
608
  <p
611
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
609
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
612
610
  style="left: 435.27272727272725px; pointer-events: none;"
613
611
  >
614
612
  1,600
615
613
  </p>
616
614
  <p
617
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
615
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
618
616
  style="left: 580.3636363636364px; pointer-events: none;"
619
617
  >
620
618
  1,800
621
619
  </p>
622
620
  <p
623
- class="MuiTypography-root MuiTypography-body2 css-23pkd3-MuiTypography-root-scaleBarLabel"
621
+ class="MuiTypography-root MuiTypography-body2 css-7mggk8-MuiTypography-root-scalebarLabel"
624
622
  style="left: 725.4545454545454px; pointer-events: none;"
625
623
  >
626
624
  2,000
@@ -628,7 +626,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
628
626
  </div>
629
627
  </div>
630
628
  <div
631
- class="css-z1h6g4-scaleBarContig"
629
+ class="css-osn2dd-scalebarContig"
632
630
  style="width: 0px; left: 800px; background-color: rgb(153, 153, 153);"
633
631
  />
634
632
  </div>
@@ -1117,20 +1115,19 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1117
1115
  </div>
1118
1116
  </div>
1119
1117
  <div
1120
- class="css-16hdnmo-rubberBandControl"
1121
- data-testid="rubberBand_controls"
1122
- role="presentation"
1118
+ class="css-dznme2-rubberbandControl"
1119
+ data-testid="rubberband_controls"
1123
1120
  >
1124
1121
  <div
1125
- class="MuiPaper-root MuiPaper-outlined MuiPaper-rounded css-1gfu64w-MuiPaper-root-scaleBarContainer"
1122
+ class="MuiPaper-root MuiPaper-outlined MuiPaper-rounded css-1coqp07-MuiPaper-root-scalebarContainer"
1126
1123
  data-resizer="true"
1127
1124
  style="height: 17px; box-sizing: border-box;"
1128
1125
  >
1129
1126
  <div
1130
- class="css-17t6jej-scaleBarZoomContainer"
1127
+ class="css-khofof-scalebarZoomContainer"
1131
1128
  >
1132
1129
  <div
1133
- class="css-1u2dss8-scaleBar"
1130
+ class="css-y3821b-scalebar"
1134
1131
  style="left: -801px; width: 1702px; height: 17px; box-sizing: border-box;"
1135
1132
  >
1136
1133
  <div
@@ -1310,7 +1307,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1310
1307
  >
1311
1308
  <div
1312
1309
  class="css-d6gpow-linearBlocks"
1313
- data-testid="Blockset"
1314
1310
  style="left: -800px;"
1315
1311
  >
1316
1312
  <div
@@ -1442,7 +1438,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1442
1438
  >
1443
1439
  <div
1444
1440
  class="css-d6gpow-linearBlocks"
1445
- data-testid="Blockset"
1446
1441
  style="left: -800px;"
1447
1442
  >
1448
1443
  <div
@@ -0,0 +1,300 @@
1
+ import React, { useRef, useEffect, useState } from 'react'
2
+ import normalizeWheel from 'normalize-wheel'
3
+
4
+ // locals
5
+ import { LinearGenomeViewModel } from '..'
6
+ import { getRelativeX } from './util'
7
+
8
+ type LGV = LinearGenomeViewModel
9
+ type Timer = ReturnType<typeof setTimeout>
10
+
11
+ export function useSideScroll(model: LGV) {
12
+ const [mouseDragging, setMouseDragging] = useState(false)
13
+ // refs are to store these variables to avoid repeated rerenders associated
14
+ // with useState/setState
15
+ const scheduled = useRef(false)
16
+
17
+ const prevX = useRef<number>(0)
18
+
19
+ useEffect(() => {
20
+ let cleanup = () => {}
21
+
22
+ function globalMouseMove(event: MouseEvent) {
23
+ event.preventDefault()
24
+ const currX = event.clientX
25
+ const distance = currX - prevX.current
26
+ if (distance) {
27
+ // use rAF to make it so multiple event handlers aren't fired per-frame
28
+ // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
29
+ if (!scheduled.current) {
30
+ scheduled.current = true
31
+ window.requestAnimationFrame(() => {
32
+ model.horizontalScroll(-distance)
33
+ scheduled.current = false
34
+ prevX.current = event.clientX
35
+ })
36
+ }
37
+ }
38
+ }
39
+
40
+ function globalMouseUp() {
41
+ prevX.current = 0
42
+ if (mouseDragging) {
43
+ setMouseDragging(false)
44
+ }
45
+ }
46
+
47
+ if (mouseDragging) {
48
+ window.addEventListener('mousemove', globalMouseMove, true)
49
+ window.addEventListener('mouseup', globalMouseUp, true)
50
+ cleanup = () => {
51
+ window.removeEventListener('mousemove', globalMouseMove, true)
52
+ window.removeEventListener('mouseup', globalMouseUp, true)
53
+ }
54
+ }
55
+ return cleanup
56
+ }, [model, mouseDragging, prevX])
57
+
58
+ function mouseDown(event: React.MouseEvent) {
59
+ if (event.shiftKey) {
60
+ return
61
+ }
62
+ // check if clicking a draggable element or a resize handle
63
+ const target = event.target as HTMLElement
64
+ if (target.draggable || target.dataset.resizer) {
65
+ return
66
+ }
67
+
68
+ // otherwise do click and drag scroll
69
+ if (event.button === 0) {
70
+ prevX.current = event.clientX
71
+ setMouseDragging(true)
72
+ }
73
+ }
74
+
75
+ // this local mouseup is used in addition to the global because sometimes
76
+ // the global add/remove are not called in time, resulting in issue #533
77
+ function mouseUp(event: React.MouseEvent) {
78
+ event.preventDefault()
79
+ setMouseDragging(false)
80
+ }
81
+ return { mouseDown, mouseUp }
82
+ }
83
+
84
+ interface AnchorPosition {
85
+ offsetX: number
86
+ clientX: number
87
+ clientY: number
88
+ }
89
+
90
+ export function useRangeSelect(
91
+ ref: React.RefObject<HTMLDivElement>,
92
+ model: LGV,
93
+ shiftOnly?: boolean,
94
+ ) {
95
+ const [startX, setStartX] = useState<number>()
96
+ const [currentX, setCurrentX] = useState<number>()
97
+
98
+ // clientX and clientY used for anchorPosition for menu
99
+ // offsetX used for calculations about width of selection
100
+ const [anchorPosition, setAnchorPosition] = useState<AnchorPosition>()
101
+ const [guideX, setGuideX] = useState<number>()
102
+ const mouseDragging = startX !== undefined && anchorPosition === undefined
103
+
104
+ useEffect(() => {
105
+ function computeOffsets(offsetX: number) {
106
+ if (startX === undefined) {
107
+ return
108
+ }
109
+ const leftPx = Math.min(startX, offsetX)
110
+ const rightPx = Math.max(startX, offsetX)
111
+ return {
112
+ leftOffset: model.pxToBp(leftPx),
113
+ rightOffset: model.pxToBp(rightPx),
114
+ }
115
+ }
116
+
117
+ function globalMouseMove(event: MouseEvent) {
118
+ if (ref.current && mouseDragging) {
119
+ const relativeX = getRelativeX(event, ref.current)
120
+ setCurrentX(relativeX)
121
+ }
122
+ }
123
+
124
+ function globalMouseUp(event: MouseEvent) {
125
+ if (startX !== undefined && ref.current) {
126
+ const { clientX, clientY } = event
127
+ const offsetX = getRelativeX(event, ref.current)
128
+ // as stated above, store both clientX/Y and offsetX for different
129
+ // purposes
130
+ setAnchorPosition({
131
+ offsetX,
132
+ clientX,
133
+ clientY,
134
+ })
135
+ const args = computeOffsets(offsetX)
136
+ if (args) {
137
+ model.setOffsets(args.leftOffset, args.rightOffset)
138
+ }
139
+ setGuideX(undefined)
140
+ }
141
+ }
142
+ if (mouseDragging) {
143
+ window.addEventListener('mousemove', globalMouseMove)
144
+ window.addEventListener('mouseup', globalMouseUp)
145
+ return () => {
146
+ window.removeEventListener('mousemove', globalMouseMove)
147
+ window.removeEventListener('mouseup', globalMouseUp)
148
+ }
149
+ }
150
+ return () => {}
151
+ }, [startX, mouseDragging, anchorPosition, model, ref])
152
+
153
+ useEffect(() => {
154
+ if (
155
+ !mouseDragging &&
156
+ currentX !== undefined &&
157
+ startX !== undefined &&
158
+ Math.abs(currentX - startX) <= 3
159
+ ) {
160
+ handleClose()
161
+ }
162
+ }, [mouseDragging, currentX, startX])
163
+
164
+ function mouseDown(event: React.MouseEvent<HTMLDivElement>) {
165
+ if (shiftOnly && !event.shiftKey) {
166
+ return
167
+ }
168
+
169
+ event.preventDefault()
170
+ event.stopPropagation()
171
+ const relativeX = getRelativeX(event, ref.current)
172
+ setStartX(relativeX)
173
+ setCurrentX(relativeX)
174
+ }
175
+
176
+ function mouseMove(event: React.MouseEvent<HTMLDivElement>) {
177
+ if (shiftOnly) {
178
+ if (event.shiftKey) {
179
+ setGuideX(getRelativeX(event, ref.current))
180
+ } else {
181
+ setGuideX(undefined)
182
+ }
183
+ } else {
184
+ setGuideX(getRelativeX(event, ref.current))
185
+ }
186
+ }
187
+
188
+ function mouseOut() {
189
+ setGuideX(undefined)
190
+ model.setOffsets(undefined, undefined)
191
+ }
192
+
193
+ function handleClose() {
194
+ setAnchorPosition(undefined)
195
+ setStartX(undefined)
196
+ setCurrentX(undefined)
197
+ }
198
+
199
+ function handleMenuItemClick(_: unknown, callback: Function) {
200
+ callback()
201
+ handleClose()
202
+ }
203
+
204
+ const open = Boolean(anchorPosition)
205
+ if (startX === undefined) {
206
+ return {
207
+ open,
208
+ guideX,
209
+ mouseDown,
210
+ mouseMove,
211
+ mouseOut,
212
+ handleMenuItemClick,
213
+ }
214
+ } else {
215
+ const right = anchorPosition ? anchorPosition.offsetX : currentX || 0
216
+ const left = right < startX ? right : startX
217
+ const width = Math.abs(right - startX)
218
+ const leftBpOffset = model.pxToBp(left)
219
+ const rightBpOffset = model.pxToBp(left + width)
220
+ const numOfBpSelected = Math.ceil(width * model.bpPerPx)
221
+
222
+ return {
223
+ open,
224
+ rubberbandOn: true,
225
+ mouseDown,
226
+ mouseMove,
227
+ mouseOut,
228
+ handleClose,
229
+ handleMenuItemClick,
230
+ leftBpOffset,
231
+ rightBpOffset,
232
+ anchorPosition,
233
+ numOfBpSelected,
234
+ width,
235
+ left,
236
+ }
237
+ }
238
+ }
239
+
240
+ export function useWheelScroll(
241
+ ref: React.RefObject<HTMLDivElement>,
242
+ model: LGV,
243
+ ) {
244
+ const delta = useRef(0)
245
+ const timeout = useRef<Timer>()
246
+ const scheduled = useRef(false)
247
+ useEffect(() => {
248
+ const curr = ref.current
249
+
250
+ // if ctrl is held down, zoom in with y-scroll
251
+ // else scroll horizontally with x-scroll
252
+ function onWheel(origEvent: WheelEvent) {
253
+ const event = normalizeWheel(origEvent)
254
+ if (origEvent.ctrlKey === true) {
255
+ origEvent.preventDefault()
256
+ delta.current += event.pixelY / 500
257
+ model.setScaleFactor(
258
+ delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current),
259
+ )
260
+ if (timeout.current) {
261
+ clearTimeout(timeout.current)
262
+ }
263
+ timeout.current = setTimeout(() => {
264
+ model.setScaleFactor(1)
265
+ model.zoomTo(
266
+ delta.current > 0
267
+ ? model.bpPerPx * (1 + delta.current)
268
+ : model.bpPerPx / (1 - delta.current),
269
+ )
270
+ delta.current = 0
271
+ }, 300)
272
+ } else {
273
+ // this is needed to stop the event from triggering "back button
274
+ // action" on MacOSX etc. but is a heuristic to avoid preventing the
275
+ // inner-track scroll behavior
276
+ if (Math.abs(event.pixelX) > Math.abs(2 * event.pixelY)) {
277
+ origEvent.preventDefault()
278
+ }
279
+ delta.current += event.pixelX
280
+ if (!scheduled.current) {
281
+ // use rAF to make it so multiple event handlers aren't fired per-frame
282
+ // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
283
+ scheduled.current = true
284
+ window.requestAnimationFrame(() => {
285
+ model.horizontalScroll(delta.current)
286
+ delta.current = 0
287
+ scheduled.current = false
288
+ })
289
+ }
290
+ }
291
+ }
292
+ if (curr) {
293
+ curr.addEventListener('wheel', onWheel)
294
+ return () => {
295
+ curr.removeEventListener('wheel', onWheel)
296
+ }
297
+ }
298
+ return () => {}
299
+ }, [model, ref])
300
+ }
@@ -1,17 +1,8 @@
1
1
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
2
2
  import { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter'
3
- import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
4
3
  import { SearchScope } from '@jbrowse/core/TextSearch/TextSearchManager'
5
- import { TextSearchManager } from '@jbrowse/core/util'
6
-
7
- export function dedupe(
8
- results: BaseResult[] = [],
9
- cb: (result: BaseResult) => string,
10
- ) {
11
- return results.filter(
12
- (elt, idx, self) => idx === self.findIndex(t => cb(t) === cb(elt)),
13
- )
14
- }
4
+ import { dedupe, TextSearchManager } from '@jbrowse/core/util'
5
+ import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
15
6
 
16
7
  export async function fetchResults({
17
8
  queryString,
@@ -63,3 +54,9 @@ export function splitLast(str: string, split: string): [string, string] {
63
54
  return [before, after]
64
55
  }
65
56
  }
57
+
58
+ export function getRelativeX<
59
+ T extends { clientX: number; target: EventTarget | null },
60
+ >(event: T, element: HTMLElement | null) {
61
+ return event.clientX - (element?.getBoundingClientRect().left || 0)
62
+ }
@@ -947,16 +947,16 @@ test('navToLocString with human assembly', async () => {
947
947
  view.setDisplayedRegions(hg38Regions.slice(0, 1))
948
948
  const w = view.width
949
949
 
950
- view.navToLocString('2')
950
+ await view.navToLocString('2')
951
951
  await waitFor(() => expect(view.bpPerPx).toBe(hg38Regions[1].end / w))
952
952
 
953
- view.navToLocString('chr3')
953
+ await view.navToLocString('chr3')
954
954
  await waitFor(() => expect(view.bpPerPx).toBe(hg38Regions[2].end / w))
955
955
 
956
- view.navToLocString('chr3:1,000,000,000-1,100,000,000')
956
+ await view.navToLocString('chr3:1,000,000,000-1,100,000,000')
957
957
  await waitFor(() => expect(view.bpPerPx).toBe(0.02))
958
958
  await waitFor(() => expect(view.offsetPx).toBe(9914777550))
959
- view.navToLocString('chr3:-1,100,000,000..-1,000,000,000')
959
+ await view.navToLocString('chr3:-1,100,000,000..-1,000,000,000')
960
960
  })
961
961
 
962
962
  test('multi region', async () => {
@@ -972,7 +972,7 @@ test('multi region', async () => {
972
972
  model.setWidth(800)
973
973
  model.setDisplayedRegions(volvoxDisplayedRegions.slice(0, 1))
974
974
 
975
- model.navToLocString('ctgA ctgB')
975
+ await model.navToLocString('ctgA ctgB')
976
976
  await waitFor(() => expect(model.displayedRegions[0].refName).toBe('ctgA'))
977
977
  await waitFor(() => expect(model.displayedRegions[1].refName).toBe('ctgB'))
978
978
  })
@@ -990,8 +990,7 @@ test('space separated locstring', async () => {
990
990
  model.setWidth(800)
991
991
  model.setDisplayedRegions(volvoxDisplayedRegions.slice(0, 1))
992
992
 
993
- model.navToLocString('ctgA 0 100')
994
-
993
+ await model.navToLocString('ctgA 0 100')
995
994
  await waitFor(() => expect(model.offsetPx).toBe(0))
996
995
  await waitFor(() => expect(model.bpPerPx).toBe(0.125))
997
996
  })
@@ -0,0 +1,18 @@
1
+ import { lazy } from 'react'
2
+ import PluginManager from '@jbrowse/core/PluginManager'
3
+ import { ViewType } from '@jbrowse/core/pluggableElementTypes'
4
+ import { stateModelFactory } from './model'
5
+
6
+ export default (pluginManager: PluginManager) => {
7
+ pluginManager.addViewType(
8
+ () =>
9
+ new ViewType({
10
+ name: 'LinearGenomeView',
11
+ displayName: 'Linear genome view',
12
+ stateModel: stateModelFactory(pluginManager),
13
+ ReactComponent: lazy(() => import('./components/LinearGenomeView')),
14
+ }),
15
+ )
16
+ }
17
+
18
+ export * from './model'