@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,45 +1,19 @@
1
1
  import React from 'react'
2
- import {
3
- Button,
4
- Dialog,
5
- DialogActions,
6
- DialogContent,
7
- DialogTitle,
8
- Divider,
9
- IconButton,
10
- } from '@mui/material'
11
- import { makeStyles } from 'tss-react/mui'
12
- import CloseIcon from '@mui/icons-material/Close'
13
-
14
- const useStyles = makeStyles()(theme => ({
15
- closeButton: {
16
- position: 'absolute',
17
- right: theme.spacing(1),
18
- top: theme.spacing(1),
19
- color: theme.palette.grey[500],
20
- },
21
- }))
2
+ import { Button, DialogActions, DialogContent, Divider } from '@mui/material'
3
+ import { Dialog } from '@jbrowse/core/ui'
22
4
 
23
5
  export default function HelpDialog({
24
6
  handleClose,
25
7
  }: {
26
8
  handleClose: () => void
27
9
  }) {
28
- const { classes } = useStyles()
29
10
  return (
30
- <Dialog open maxWidth="xl" onClose={handleClose}>
31
- <DialogTitle>
32
- Using the search box
33
- {handleClose ? (
34
- <IconButton
35
- className={classes.closeButton}
36
- onClick={() => handleClose()}
37
- >
38
- <CloseIcon />
39
- </IconButton>
40
- ) : null}
41
- </DialogTitle>
42
- <Divider />
11
+ <Dialog
12
+ open
13
+ maxWidth="xl"
14
+ onClose={handleClose}
15
+ title="Using the search box"
16
+ >
43
17
  <DialogContent>
44
18
  <h3>Searching</h3>
45
19
  <ul>
@@ -62,11 +62,11 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
62
62
  setValue(r0)
63
63
  }, [r0, selectedAsm])
64
64
 
65
- function navToOption(option: BaseResult) {
65
+ async function navToOption(option: BaseResult) {
66
66
  const location = option.getLocation()
67
67
  const trackId = option.getTrackId()
68
68
  if (location) {
69
- model.navToLocString(location, selectedAsm)
69
+ await model.navToLocString(location, selectedAsm)
70
70
  if (trackId) {
71
71
  model.showTrack(trackId)
72
72
  }
@@ -81,7 +81,9 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
81
81
  async function handleSelectedRegion(input: string) {
82
82
  try {
83
83
  if (option?.getDisplayString() === input && option.hasLocation()) {
84
- navToOption(option)
84
+ await navToOption(option)
85
+ } else if (option?.results?.length) {
86
+ model.setSearchResults(option.results, option.getLabel())
85
87
  } else {
86
88
  const [ref, rest] = splitLast(input, ':')
87
89
  const allRefs = assembly?.allRefNamesWithLowerCase || []
@@ -89,7 +91,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
89
91
  allRefs.includes(input) ||
90
92
  (allRefs.includes(ref) && !Number.isNaN(parseInt(rest, 10)))
91
93
  ) {
92
- model.navToLocString(input, selectedAsm)
94
+ await model.navToLocString(input, selectedAsm)
93
95
  } else {
94
96
  const results = await fetchResults({
95
97
  queryString: input,
@@ -103,9 +105,9 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
103
105
  if (results.length > 1) {
104
106
  model.setSearchResults(results, input.toLowerCase())
105
107
  } else if (results.length === 1) {
106
- navToOption(results[0])
108
+ await navToOption(results[0])
107
109
  } else {
108
- model.navToLocString(input, selectedAsm)
110
+ await model.navToLocString(input, selectedAsm)
109
111
  }
110
112
  }
111
113
  }
@@ -122,11 +124,12 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
122
124
  {displayError ? <ErrorMessage error={displayError} /> : null}
123
125
  <Container className={classes.importFormContainer}>
124
126
  <form
125
- onSubmit={event => {
127
+ onSubmit={async event => {
126
128
  event.preventDefault()
127
129
  model.setError(undefined)
128
130
  if (value) {
129
- handleSelectedRegion(value)
131
+ // has it's own error handling
132
+ await handleSelectedRegion(value)
130
133
  }
131
134
  }}
132
135
  >
@@ -143,6 +146,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
143
146
  setSelectedAsm(val)
144
147
  setValue('')
145
148
  }}
149
+ localStorageKey="lgv"
146
150
  session={session}
147
151
  selected={selectedAsm}
148
152
  />
@@ -167,7 +171,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
167
171
  model={model}
168
172
  assemblyName={assemblyError ? undefined : selectedAsm}
169
173
  value={value}
170
- // note: minWidth 270 accomodates full width of helperText
174
+ // note: minWidth 270 accommodates full width of helperText
171
175
  minWidth={270}
172
176
  onChange={str => setValue(str)}
173
177
  onSelect={val => setOption(val)}
@@ -30,143 +30,141 @@ const assemblyConf = {
30
30
  },
31
31
  }
32
32
 
33
- describe('<LinearGenomeView />', () => {
34
- it('renders setup wizard', async () => {
35
- const session = createTestSession()
36
- session.addAssemblyConf(assemblyConf)
37
- session.addView('LinearGenomeView', { id: 'lgv' })
38
- const model = session.views[0]
39
- model.setWidth(800)
40
- const { findByText } = render(<LinearGenomeView model={model} />)
41
- expect(model.displayedRegions.length).toEqual(0)
42
- const elt = await findByText('Open')
43
- await waitFor(() => expect(elt.getAttribute('disabled')).toBe(null))
44
- fireEvent.click(elt)
45
- await waitFor(() => expect(model.displayedRegions.length).toEqual(1), {
46
- timeout: 15000,
47
- })
48
- }, 15000)
49
-
50
- it('renders one track, one region', async () => {
51
- const session = createTestSession()
52
- session.addAssemblyConf(assemblyConf)
53
- session.addTrackConf({
54
- trackId: 'testConfig',
55
- assemblyNames: ['volMyt1'],
56
- name: 'Foo Track',
57
- type: 'BasicTrack',
58
- adapter: { type: 'FromConfigAdapter', features: [] },
59
- })
60
- session.addView('LinearGenomeView', {
61
- type: 'LinearGenomeView',
62
- id: 'lgv',
63
- offsetPx: 0,
64
- bpPerPx: 1,
65
- tracks: [
66
- {
67
- id: 'foo',
68
- type: 'BasicTrack',
69
- height: 20,
70
- configuration: 'testConfig',
71
- displays: [
72
- {
73
- type: 'LinearBareDisplay',
74
- configuration: 'testConfig-LinearBareDisplay',
75
- },
76
- ],
77
- },
78
- ],
79
- displayedRegions: [
80
- { assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
81
- ],
82
- })
83
- const model = session.views[0]
84
- model.setWidth(800)
85
- const { container, queryByText, getByPlaceholderText, findByText } = render(
86
- <LinearGenomeView model={model} />,
87
- )
88
- await findByText('Foo Track')
89
- // test needs to wait until it's updated to display 100 bp in the header to
90
- // make snapshot pass
91
- await findByText('100bp')
33
+ test('renders setup wizard', async () => {
34
+ const session = createTestSession()
35
+ session.addAssemblyConf(assemblyConf)
36
+ session.addView('LinearGenomeView', { id: 'lgv' })
37
+ const model = session.views[0]
38
+ model.setWidth(800)
39
+ const { findByText } = render(<LinearGenomeView model={model} />)
40
+ expect(model.displayedRegions.length).toEqual(0)
41
+ const elt = await findByText('Open')
42
+ await waitFor(() => expect(elt.getAttribute('disabled')).toBe(null))
43
+ fireEvent.click(elt)
44
+ await waitFor(() => expect(model.displayedRegions.length).toEqual(1), {
45
+ timeout: 15000,
46
+ })
47
+ }, 15000)
92
48
 
93
- await waitFor(() => {
94
- expect(
95
- (getByPlaceholderText('Search for location') as HTMLInputElement).value,
96
- ).toEqual('ctgA:1..100')
97
- })
98
- await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
99
- expect(container.firstChild).toMatchSnapshot()
49
+ test('renders one track, one region', async () => {
50
+ const session = createTestSession()
51
+ session.addAssemblyConf(assemblyConf)
52
+ session.addTrackConf({
53
+ trackId: 'testConfig',
54
+ assemblyNames: ['volMyt1'],
55
+ name: 'Foo Track',
56
+ type: 'BasicTrack',
57
+ adapter: { type: 'FromConfigAdapter', features: [] },
100
58
  })
59
+ session.addView('LinearGenomeView', {
60
+ type: 'LinearGenomeView',
61
+ id: 'lgv',
62
+ offsetPx: 0,
63
+ bpPerPx: 1,
64
+ tracks: [
65
+ {
66
+ id: 'foo',
67
+ type: 'BasicTrack',
68
+ height: 20,
69
+ configuration: 'testConfig',
70
+ displays: [
71
+ {
72
+ type: 'LinearBareDisplay',
73
+ configuration: 'testConfig-LinearBareDisplay',
74
+ },
75
+ ],
76
+ },
77
+ ],
78
+ displayedRegions: [
79
+ { assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
80
+ ],
81
+ })
82
+ const model = session.views[0]
83
+ model.setWidth(800)
84
+ const { container, queryByText, getByPlaceholderText, findByText } = render(
85
+ <LinearGenomeView model={model} />,
86
+ )
87
+ await findByText('Foo Track')
88
+ // test needs to wait until it's updated to display 100 bp in the header to
89
+ // make snapshot pass
90
+ await findByText('100bp')
101
91
 
102
- it('renders two tracks, two regions', async () => {
103
- const session = createTestSession()
104
- session.addAssemblyConf(assemblyConf)
105
- session.addTrackConf({
106
- trackId: 'testConfig',
107
- name: 'Foo Track',
108
- assemblyNames: ['volMyt1'],
109
- type: 'BasicTrack',
110
- adapter: { type: 'FromConfigAdapter', features: [] },
111
- })
92
+ await waitFor(() => {
93
+ expect(
94
+ (getByPlaceholderText('Search for location') as HTMLInputElement).value,
95
+ ).toEqual('ctgA:1..100')
96
+ })
97
+ await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
98
+ expect(container.firstChild).toMatchSnapshot()
99
+ })
112
100
 
113
- session.addTrackConf({
114
- trackId: 'testConfig2',
115
- name: 'Bar Track',
116
- assemblyNames: ['volMyt1'],
117
- type: 'BasicTrack',
118
- adapter: { type: 'FromConfigAdapter', features: [] },
119
- })
120
- session.addView('LinearGenomeView', {
121
- id: 'lgv',
122
- offsetPx: 0,
123
- bpPerPx: 1,
124
- displayedRegions: [
125
- { assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
126
- {
127
- assemblyName: 'volMyt1',
128
- refName: 'ctgB',
129
- start: 1000,
130
- end: 2000,
131
- },
132
- ],
133
- tracks: [
134
- {
135
- id: 'foo',
136
- type: 'BasicTrack',
137
- height: 20,
138
- configuration: 'testConfig',
139
- displays: [
140
- {
141
- type: 'LinearBareDisplay',
142
- configuration: 'testConfig-LinearBareDisplay',
143
- },
144
- ],
145
- },
146
- {
147
- id: 'bar',
148
- type: 'BasicTrack',
149
- height: 20,
150
- configuration: 'testConfig2',
151
- displays: [
152
- {
153
- type: 'LinearBareDisplay',
154
- configuration: 'testConfig2-LinearBareDisplay',
155
- },
156
- ],
157
- },
158
- ],
159
- })
160
- const model = session.views[0]
161
- model.setWidth(800)
162
- const { container, findByText, queryByText, findAllByTestId } = render(
163
- <LinearGenomeView model={model} />,
164
- )
165
- await findByText('Foo Track')
166
- await findByText('798bp')
167
- await findAllByTestId('svgfeatures')
168
- await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
101
+ test('renders two tracks, two regions', async () => {
102
+ const session = createTestSession()
103
+ session.addAssemblyConf(assemblyConf)
104
+ session.addTrackConf({
105
+ trackId: 'testConfig',
106
+ name: 'Foo Track',
107
+ assemblyNames: ['volMyt1'],
108
+ type: 'BasicTrack',
109
+ adapter: { type: 'FromConfigAdapter', features: [] },
110
+ })
169
111
 
170
- expect(container.firstChild).toMatchSnapshot()
112
+ session.addTrackConf({
113
+ trackId: 'testConfig2',
114
+ name: 'Bar Track',
115
+ assemblyNames: ['volMyt1'],
116
+ type: 'BasicTrack',
117
+ adapter: { type: 'FromConfigAdapter', features: [] },
171
118
  })
172
- })
119
+ session.addView('LinearGenomeView', {
120
+ id: 'lgv',
121
+ offsetPx: 0,
122
+ bpPerPx: 1,
123
+ displayedRegions: [
124
+ { assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
125
+ {
126
+ assemblyName: 'volMyt1',
127
+ refName: 'ctgB',
128
+ start: 1000,
129
+ end: 2000,
130
+ },
131
+ ],
132
+ tracks: [
133
+ {
134
+ id: 'foo',
135
+ type: 'BasicTrack',
136
+ height: 20,
137
+ configuration: 'testConfig',
138
+ displays: [
139
+ {
140
+ type: 'LinearBareDisplay',
141
+ configuration: 'testConfig-LinearBareDisplay',
142
+ },
143
+ ],
144
+ },
145
+ {
146
+ id: 'bar',
147
+ type: 'BasicTrack',
148
+ height: 20,
149
+ configuration: 'testConfig2',
150
+ displays: [
151
+ {
152
+ type: 'LinearBareDisplay',
153
+ configuration: 'testConfig2-LinearBareDisplay',
154
+ },
155
+ ],
156
+ },
157
+ ],
158
+ })
159
+ const model = session.views[0]
160
+ model.setWidth(800)
161
+ const { container, findByText, queryByText, findAllByTestId } = render(
162
+ <LinearGenomeView model={model} />,
163
+ )
164
+ await findByText('Foo Track')
165
+ await findByText('798bp')
166
+ await findAllByTestId('svgfeatures', {}, { timeout: 10000 })
167
+ await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
168
+
169
+ expect(container.firstChild).toMatchSnapshot()
170
+ }, 15000)
@@ -14,11 +14,11 @@ import {
14
14
  ExportSvgOptions,
15
15
  HEADER_OVERVIEW_HEIGHT,
16
16
  } from '..'
17
- import { Polygon, Cytobands } from './OverviewScaleBar'
17
+ import { Polygon, Cytobands } from './OverviewScalebar'
18
18
 
19
19
  type LGV = LinearGenomeViewModel
20
20
 
21
- function ScaleBar({ model, fontSize }: { model: LGV; fontSize: number }) {
21
+ function Scalebar({ model, fontSize }: { model: LGV; fontSize: number }) {
22
22
  const {
23
23
  offsetPx,
24
24
  dynamicBlocks: { totalWidthPxWithoutBorders: totalWidthPx, totalBp },
@@ -178,7 +178,7 @@ const SVGHeader = ({ model }: { model: LGV }) => {
178
178
  ) : null}
179
179
 
180
180
  <g transform={`translate(0 ${fontSize + cytobandHeight})`}>
181
- <ScaleBar model={model} fontSize={fontSize} />
181
+ <Scalebar model={model} fontSize={fontSize} />
182
182
  </g>
183
183
  <g transform={`translate(0 ${rulerHeight + cytobandHeight})`}>
184
184
  <SVGRuler model={model} fontSize={fontSize} width={width} />
@@ -276,8 +276,7 @@ export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
276
276
  tracks.map(async track => {
277
277
  const display = track.displays[0]
278
278
  await when(() => (display.ready !== undefined ? display.ready : true))
279
- const result = await display.renderSvg(opts)
280
- return { track, result }
279
+ return { track, result: await display.renderSvg(opts) }
281
280
  }),
282
281
  )
283
282
 
@@ -1,51 +1,28 @@
1
1
  import React, { useRef, useEffect, useState } from 'react'
2
- import { Popover, Tooltip, Typography, alpha } from '@mui/material'
2
+ import { Tooltip } from '@mui/material'
3
3
  import { makeStyles } from 'tss-react/mui'
4
4
  import { getSession, stringify } from '@jbrowse/core/util'
5
5
  import { observer } from 'mobx-react'
6
6
  import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
7
- import { LinearGenomeViewModel, HEADER_OVERVIEW_HEIGHT } from '..'
7
+ import { LinearGenomeViewModel } from '..'
8
+ import RubberbandSpan from './RubberbandSpan'
9
+ import { getRelativeX } from './util'
8
10
 
9
11
  type LGV = LinearGenomeViewModel
10
12
 
11
- const useStyles = makeStyles()(theme => {
12
- const { tertiary, primary } = theme.palette
13
- const background = tertiary
14
- ? alpha(tertiary.main, 0.7)
15
- : alpha(primary.main, 0.7)
16
- return {
17
- rubberBand: {
18
- height: '100%',
19
- background,
20
- position: 'absolute',
21
- zIndex: 10,
22
- textAlign: 'center',
23
- overflow: 'hidden',
24
- },
25
- rubberBandControl: {
26
- cursor: 'crosshair',
27
- width: '100%',
28
- minHeight: 8,
29
- },
30
- rubberBandText: {
31
- color: tertiary ? tertiary.contrastText : primary.contrastText,
32
- },
33
- popover: {
34
- mouseEvents: 'none',
35
- cursor: 'crosshair',
36
- },
37
- paper: {
38
- paddingLeft: theme.spacing(1),
39
- paddingRight: theme.spacing(1),
40
- },
41
- guide: {
42
- pointerEvents: 'none',
43
- height: '100%',
44
- width: 1,
45
- position: 'absolute',
46
- zIndex: 10,
47
- },
48
- }
13
+ const useStyles = makeStyles()({
14
+ rubberbandControl: {
15
+ cursor: 'crosshair',
16
+ width: '100%',
17
+ minHeight: 8,
18
+ },
19
+ guide: {
20
+ pointerEvents: 'none',
21
+ height: '100%',
22
+ width: 1,
23
+ position: 'absolute',
24
+ zIndex: 10,
25
+ },
49
26
  })
50
27
 
51
28
  const HoverTooltip = observer(
@@ -91,7 +68,7 @@ const HoverTooltip = observer(
91
68
  },
92
69
  )
93
70
 
94
- function OverviewRubberBand({
71
+ function OverviewRubberband({
95
72
  model,
96
73
  overview,
97
74
  ControlComponent = <div />,
@@ -105,7 +82,6 @@ function OverviewRubberBand({
105
82
  const [currentX, setCurrentX] = useState<number>()
106
83
  const [guideX, setGuideX] = useState<number>()
107
84
  const controlsRef = useRef<HTMLDivElement>(null)
108
- const rubberBandRef = useRef<HTMLDivElement>(null)
109
85
  const { classes } = useStyles()
110
86
  const mouseDragging = startX !== undefined
111
87
 
@@ -113,8 +89,7 @@ function OverviewRubberBand({
113
89
  function globalMouseMove(event: MouseEvent) {
114
90
  const ref = controlsRef.current
115
91
  if (ref && mouseDragging) {
116
- const relativeX = event.clientX - ref.getBoundingClientRect().left
117
- setCurrentX(relativeX)
92
+ setCurrentX(getRelativeX(event, ref))
118
93
  }
119
94
  }
120
95
 
@@ -172,19 +147,11 @@ function OverviewRubberBand({
172
147
  function mouseDown(event: React.MouseEvent<HTMLDivElement>) {
173
148
  event.preventDefault()
174
149
  event.stopPropagation()
175
- if (controlsRef.current) {
176
- setStartX(
177
- event.clientX - controlsRef.current.getBoundingClientRect().left,
178
- )
179
- }
150
+ setStartX(getRelativeX(event, controlsRef.current))
180
151
  }
181
152
 
182
153
  function mouseMove(event: React.MouseEvent<HTMLDivElement>) {
183
- if (controlsRef.current) {
184
- setGuideX(
185
- event.clientX - controlsRef.current.getBoundingClientRect().left,
186
- )
187
- }
154
+ setGuideX(getRelativeX(event, controlsRef.current))
188
155
  }
189
156
 
190
157
  function mouseOut() {
@@ -203,7 +170,7 @@ function OverviewRubberBand({
203
170
  />
204
171
  ) : null}
205
172
  <div
206
- className={classes.rubberBandControl}
173
+ className={classes.rubberbandControl}
207
174
  role="presentation"
208
175
  ref={controlsRef}
209
176
  onMouseDown={mouseDown}
@@ -235,66 +202,17 @@ function OverviewRubberBand({
235
202
 
236
203
  return (
237
204
  <div style={{ position: 'relative' }}>
238
- {rubberBandRef.current ? (
239
- <>
240
- <Popover
241
- className={classes.popover}
242
- classes={{
243
- paper: classes.paper,
244
- }}
245
- open
246
- anchorEl={rubberBandRef.current}
247
- anchorOrigin={{
248
- vertical: 'top',
249
- horizontal: 'left',
250
- }}
251
- transformOrigin={{
252
- vertical: 'bottom',
253
- horizontal: 'right',
254
- }}
255
- keepMounted
256
- disableRestoreFocus
257
- >
258
- <Typography>
259
- {leftBpOffset ? stringify(leftBpOffset) : ''}
260
- </Typography>
261
- </Popover>
262
- <Popover
263
- className={classes.popover}
264
- classes={{
265
- paper: classes.paper,
266
- }}
267
- open
268
- anchorEl={rubberBandRef.current}
269
- anchorOrigin={{
270
- vertical: 'top',
271
- horizontal: 'right',
272
- }}
273
- transformOrigin={{
274
- vertical: 'bottom',
275
- horizontal: 'left',
276
- }}
277
- keepMounted
278
- disableRestoreFocus
279
- >
280
- <Typography>
281
- {rightBpOffset ? stringify(rightBpOffset) : ''}
282
- </Typography>
283
- </Popover>
284
- </>
205
+ {leftBpOffset && rightBpOffset ? (
206
+ <RubberbandSpan
207
+ leftBpOffset={leftBpOffset}
208
+ rightBpOffset={rightBpOffset}
209
+ width={width}
210
+ left={left}
211
+ />
285
212
  ) : null}
286
213
  <div
287
- ref={rubberBandRef}
288
- className={classes.rubberBand}
289
- style={{
290
- left,
291
- width: Math.abs(width),
292
- height: HEADER_OVERVIEW_HEIGHT,
293
- }}
294
- />
295
- <div
296
- data-testid="rubberBand_controls"
297
- className={classes.rubberBandControl}
214
+ data-testid="rubberband_controls"
215
+ className={classes.rubberbandControl}
298
216
  role="presentation"
299
217
  ref={controlsRef}
300
218
  onMouseDown={mouseDown}
@@ -307,4 +225,4 @@ function OverviewRubberBand({
307
225
  )
308
226
  }
309
227
 
310
- export default observer(OverviewRubberBand)
228
+ export default observer(OverviewRubberband)