@jbrowse/plugin-linear-genome-view 2.3.4 → 2.4.1

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 -3
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -4
  3. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  4. package/dist/BaseLinearDisplay/components/Block.js +1 -1
  5. package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
  6. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +11 -11
  7. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  8. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +82 -7
  9. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +43 -28
  10. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  11. package/dist/BaseLinearDisplay/models/configSchema.js +8 -0
  12. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
  13. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  14. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +9 -5
  15. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  16. package/dist/BaseLinearDisplay/models/util.js +2 -2
  17. package/dist/BaseLinearDisplay/models/util.js.map +1 -1
  18. package/dist/LaunchLinearGenomeView/index.js +1 -1
  19. package/dist/LaunchLinearGenomeView/index.js.map +1 -1
  20. package/dist/LinearBareDisplay/index.d.ts +2 -3
  21. package/dist/LinearBareDisplay/index.js +4 -2
  22. package/dist/LinearBareDisplay/index.js.map +1 -1
  23. package/dist/LinearBareDisplay/model.d.ts +61 -3
  24. package/dist/LinearBasicDisplay/index.d.ts +2 -3
  25. package/dist/LinearBasicDisplay/index.js +4 -2
  26. package/dist/LinearBasicDisplay/index.js.map +1 -1
  27. package/dist/LinearBasicDisplay/model.d.ts +82 -14
  28. package/dist/LinearGenomeView/components/CenterLine.js +2 -2
  29. package/dist/LinearGenomeView/components/CenterLine.js.map +1 -1
  30. package/dist/LinearGenomeView/components/Cytobands.d.ts +118 -0
  31. package/dist/LinearGenomeView/components/Cytobands.js +92 -0
  32. package/dist/LinearGenomeView/components/Cytobands.js.map +1 -0
  33. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
  34. package/dist/LinearGenomeView/components/ExportSvgDialog.js +24 -3
  35. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
  36. package/dist/LinearGenomeView/components/Gridlines.js +1 -1
  37. package/dist/LinearGenomeView/components/Gridlines.js.map +1 -1
  38. package/dist/LinearGenomeView/components/Header.js +3 -4
  39. package/dist/LinearGenomeView/components/Header.js.map +1 -1
  40. package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
  41. package/dist/LinearGenomeView/components/ImportForm.js +15 -19
  42. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  43. package/dist/LinearGenomeView/components/LinearGenomeView.js +1 -1
  44. package/dist/LinearGenomeView/components/MiniControls.js +5 -4
  45. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
  46. package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +3 -4
  47. package/dist/LinearGenomeView/components/OverviewRubberband.js +8 -11
  48. package/dist/LinearGenomeView/components/OverviewRubberband.js.map +1 -1
  49. package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +4 -119
  50. package/dist/LinearGenomeView/components/OverviewScalebar.js +19 -103
  51. package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  52. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +2 -1
  53. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +35 -31
  54. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  55. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
  56. package/dist/LinearGenomeView/components/RubberbandSpan.js +4 -18
  57. package/dist/LinearGenomeView/components/RubberbandSpan.js.map +1 -1
  58. package/dist/LinearGenomeView/components/SearchBox.js +3 -3
  59. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
  60. package/dist/LinearGenomeView/components/TrackLabel.js +6 -7
  61. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
  62. package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  63. package/dist/LinearGenomeView/components/TracksContainer.js +9 -8
  64. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  65. package/dist/LinearGenomeView/components/ZoomControls.js +5 -4
  66. package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -1
  67. package/dist/LinearGenomeView/components/hooks.d.ts +6 -1
  68. package/dist/LinearGenomeView/components/hooks.js +1 -1
  69. package/dist/LinearGenomeView/components/hooks.js.map +1 -1
  70. package/dist/LinearGenomeView/components/util.d.ts +6 -0
  71. package/dist/LinearGenomeView/components/util.js +11 -1
  72. package/dist/LinearGenomeView/components/util.js.map +1 -1
  73. package/dist/LinearGenomeView/index.js +8 -6
  74. package/dist/LinearGenomeView/index.js.map +1 -1
  75. package/dist/LinearGenomeView/model.d.ts +18 -12
  76. package/dist/LinearGenomeView/model.js +31 -34
  77. package/dist/LinearGenomeView/model.js.map +1 -1
  78. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +6 -0
  79. package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +13 -0
  80. package/dist/LinearGenomeView/svgcomponents/SVGBackground.js.map +1 -0
  81. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +10 -0
  82. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +55 -0
  83. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -0
  84. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
  85. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +57 -0
  86. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -0
  87. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +8 -0
  88. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +13 -0
  89. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js.map +1 -0
  90. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +8 -0
  91. package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +51 -0
  92. package/dist/LinearGenomeView/svgcomponents/SVGRuler.js.map +1 -0
  93. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +8 -0
  94. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +22 -0
  95. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js.map +1 -0
  96. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +8 -0
  97. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +16 -0
  98. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js.map +1 -0
  99. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +23 -0
  100. package/dist/LinearGenomeView/svgcomponents/SVGTracks.js +30 -0
  101. package/dist/LinearGenomeView/svgcomponents/SVGTracks.js.map +1 -0
  102. package/dist/LinearGenomeView/util.js +2 -2
  103. package/dist/LinearGenomeView/util.js.map +1 -1
  104. package/dist/index.d.ts +157 -44
  105. package/dist/index.js +21 -13
  106. package/dist/index.js.map +1 -1
  107. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -3
  108. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +2 -3
  109. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +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/ServerSideRenderedBlockContent.js +11 -11
  113. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  114. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +82 -7
  115. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +44 -29
  116. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  117. package/esm/BaseLinearDisplay/models/configSchema.js +8 -0
  118. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
  119. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  120. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +9 -5
  121. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  122. package/esm/BaseLinearDisplay/models/util.js +2 -2
  123. package/esm/BaseLinearDisplay/models/util.js.map +1 -1
  124. package/esm/LaunchLinearGenomeView/index.js +1 -1
  125. package/esm/LaunchLinearGenomeView/index.js.map +1 -1
  126. package/esm/LinearBareDisplay/index.d.ts +2 -3
  127. package/esm/LinearBareDisplay/index.js +2 -1
  128. package/esm/LinearBareDisplay/index.js.map +1 -1
  129. package/esm/LinearBareDisplay/model.d.ts +61 -3
  130. package/esm/LinearBasicDisplay/index.d.ts +2 -3
  131. package/esm/LinearBasicDisplay/index.js +2 -1
  132. package/esm/LinearBasicDisplay/index.js.map +1 -1
  133. package/esm/LinearBasicDisplay/model.d.ts +82 -14
  134. package/esm/LinearGenomeView/components/CenterLine.js +2 -2
  135. package/esm/LinearGenomeView/components/CenterLine.js.map +1 -1
  136. package/esm/LinearGenomeView/components/Cytobands.d.ts +118 -0
  137. package/esm/LinearGenomeView/components/Cytobands.js +87 -0
  138. package/esm/LinearGenomeView/components/Cytobands.js.map +1 -0
  139. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
  140. package/esm/LinearGenomeView/components/ExportSvgDialog.js +25 -4
  141. package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
  142. package/esm/LinearGenomeView/components/Gridlines.js +1 -1
  143. package/esm/LinearGenomeView/components/Gridlines.js.map +1 -1
  144. package/esm/LinearGenomeView/components/Header.js +5 -6
  145. package/esm/LinearGenomeView/components/Header.js.map +1 -1
  146. package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
  147. package/esm/LinearGenomeView/components/ImportForm.js +16 -20
  148. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  149. package/esm/LinearGenomeView/components/LinearGenomeView.js +1 -1
  150. package/esm/LinearGenomeView/components/MiniControls.js +5 -4
  151. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
  152. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -4
  153. package/esm/LinearGenomeView/components/OverviewRubberband.js +8 -11
  154. package/esm/LinearGenomeView/components/OverviewRubberband.js.map +1 -1
  155. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +4 -119
  156. package/esm/LinearGenomeView/components/OverviewScalebar.js +16 -100
  157. package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  158. package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +2 -1
  159. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +36 -32
  160. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  161. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
  162. package/esm/LinearGenomeView/components/RubberbandSpan.js +5 -20
  163. package/esm/LinearGenomeView/components/RubberbandSpan.js.map +1 -1
  164. package/esm/LinearGenomeView/components/SearchBox.js +3 -3
  165. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
  166. package/esm/LinearGenomeView/components/TrackLabel.js +6 -7
  167. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
  168. package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  169. package/esm/LinearGenomeView/components/TracksContainer.js +9 -8
  170. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  171. package/esm/LinearGenomeView/components/ZoomControls.js +5 -4
  172. package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -1
  173. package/esm/LinearGenomeView/components/hooks.d.ts +6 -1
  174. package/esm/LinearGenomeView/components/hooks.js +1 -1
  175. package/esm/LinearGenomeView/components/hooks.js.map +1 -1
  176. package/esm/LinearGenomeView/components/util.d.ts +6 -0
  177. package/esm/LinearGenomeView/components/util.js +9 -0
  178. package/esm/LinearGenomeView/components/util.js.map +1 -1
  179. package/esm/LinearGenomeView/index.js +8 -6
  180. package/esm/LinearGenomeView/index.js.map +1 -1
  181. package/esm/LinearGenomeView/model.d.ts +18 -12
  182. package/esm/LinearGenomeView/model.js +24 -28
  183. package/esm/LinearGenomeView/model.js.map +1 -1
  184. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +6 -0
  185. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +7 -0
  186. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js.map +1 -0
  187. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +10 -0
  188. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +49 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +12 -0
  191. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +47 -0
  192. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -0
  193. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +8 -0
  194. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +7 -0
  195. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js.map +1 -0
  196. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +8 -0
  197. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +45 -0
  198. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js.map +1 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +8 -0
  200. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +16 -0
  201. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js.map +1 -0
  202. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +8 -0
  203. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +10 -0
  204. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js.map +1 -0
  205. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +23 -0
  206. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +24 -0
  207. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js.map +1 -0
  208. package/esm/LinearGenomeView/util.js +2 -2
  209. package/esm/LinearGenomeView/util.js.map +1 -1
  210. package/esm/index.d.ts +157 -44
  211. package/esm/index.js +9 -5
  212. package/esm/index.js.map +1 -1
  213. package/package.json +3 -3
  214. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -3
  215. package/src/BaseLinearDisplay/components/Block.tsx +1 -1
  216. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +11 -12
  217. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +55 -40
  218. package/src/BaseLinearDisplay/models/configSchema.ts +8 -0
  219. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +15 -22
  220. package/src/BaseLinearDisplay/models/util.ts +2 -2
  221. package/src/LaunchLinearGenomeView/index.ts +1 -1
  222. package/src/LinearBareDisplay/index.ts +2 -1
  223. package/src/LinearBasicDisplay/index.ts +2 -1
  224. package/src/LinearGenomeView/components/CenterLine.tsx +2 -2
  225. package/src/LinearGenomeView/components/Cytobands.tsx +154 -0
  226. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +56 -4
  227. package/src/LinearGenomeView/components/Gridlines.tsx +1 -1
  228. package/src/LinearGenomeView/components/Header.tsx +6 -13
  229. package/src/LinearGenomeView/components/ImportForm.tsx +17 -26
  230. package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +8 -11
  231. package/src/LinearGenomeView/components/LinearGenomeView.tsx +1 -1
  232. package/src/LinearGenomeView/components/MiniControls.tsx +6 -7
  233. package/src/LinearGenomeView/components/OverviewRubberband.tsx +40 -49
  234. package/src/LinearGenomeView/components/OverviewScalebar.tsx +222 -385
  235. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +50 -48
  236. package/src/LinearGenomeView/components/RubberbandSpan.tsx +8 -25
  237. package/src/LinearGenomeView/components/SearchBox.tsx +3 -2
  238. package/src/LinearGenomeView/components/TrackLabel.tsx +76 -76
  239. package/src/LinearGenomeView/components/TracksContainer.tsx +8 -8
  240. package/src/LinearGenomeView/components/ZoomControls.tsx +3 -4
  241. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +1230 -1200
  242. package/src/LinearGenomeView/components/hooks.ts +7 -1
  243. package/src/LinearGenomeView/components/util.ts +13 -0
  244. package/src/LinearGenomeView/index.test.ts +12 -13
  245. package/src/LinearGenomeView/index.ts +8 -9
  246. package/src/LinearGenomeView/model.ts +41 -36
  247. package/src/LinearGenomeView/svgcomponents/SVGBackground.tsx +21 -0
  248. package/src/LinearGenomeView/svgcomponents/SVGHeader.tsx +93 -0
  249. package/src/LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx +114 -0
  250. package/src/LinearGenomeView/svgcomponents/SVGRegionSeparators.tsx +31 -0
  251. package/src/LinearGenomeView/svgcomponents/SVGRuler.tsx +125 -0
  252. package/src/LinearGenomeView/svgcomponents/SVGScalebar.tsx +57 -0
  253. package/src/LinearGenomeView/svgcomponents/SVGTrackLabel.tsx +47 -0
  254. package/src/LinearGenomeView/svgcomponents/SVGTracks.tsx +67 -0
  255. package/src/LinearGenomeView/util.test.ts +7 -4
  256. package/src/LinearGenomeView/util.ts +3 -3
  257. package/src/index.ts +22 -23
  258. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +0 -4
  259. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +0 -141
  260. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +0 -1
  261. package/dist/LinearGenomeView/components/Ruler.d.ts +0 -11
  262. package/dist/LinearGenomeView/components/Ruler.js +0 -39
  263. package/dist/LinearGenomeView/components/Ruler.js.map +0 -1
  264. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +0 -4
  265. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +0 -134
  266. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +0 -1
  267. package/esm/LinearGenomeView/components/Ruler.d.ts +0 -11
  268. package/esm/LinearGenomeView/components/Ruler.js +0 -34
  269. package/esm/LinearGenomeView/components/Ruler.js.map +0 -1
  270. package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +0 -307
  271. package/src/LinearGenomeView/components/Ruler.tsx +0 -78
@@ -6,10 +6,14 @@ import {
6
6
  DialogActions,
7
7
  DialogContent,
8
8
  FormControlLabel,
9
+ MenuItem,
9
10
  TextField,
10
11
  Typography,
11
12
  } from '@mui/material'
12
13
  import { Dialog, ErrorMessage } from '@jbrowse/core/ui'
14
+ import { getSession, useLocalStorage } from '@jbrowse/core/util'
15
+
16
+ // locals
13
17
  import { ExportSvgOptions } from '..'
14
18
 
15
19
  function LoadingMessage() {
@@ -21,19 +25,28 @@ function LoadingMessage() {
21
25
  )
22
26
  }
23
27
 
28
+ function useSvgLocal<T>(key: string, val: T) {
29
+ return useLocalStorage('svg-' + key, val)
30
+ }
31
+
24
32
  export default function ExportSvgDlg({
25
33
  model,
26
34
  handleClose,
27
35
  }: {
28
- model: { exportSvg(opts: ExportSvgOptions): void }
36
+ model: { exportSvg(opts: ExportSvgOptions): Promise<void> }
29
37
  handleClose: () => void
30
38
  }) {
31
- // @ts-ignore
39
+ const session = getSession(model)
32
40
  const offscreenCanvas = typeof OffscreenCanvas !== 'undefined'
33
41
  const [rasterizeLayers, setRasterizeLayers] = useState(offscreenCanvas)
34
42
  const [loading, setLoading] = useState(false)
35
- const [filename, setFilename] = useState('jbrowse.svg')
36
43
  const [error, setError] = useState<unknown>()
44
+ const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg')
45
+ const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset')
46
+ const [themeName, setThemeName] = useSvgLocal(
47
+ 'theme',
48
+ session.themeName || 'default',
49
+ )
37
50
  return (
38
51
  <Dialog open onClose={handleClose} title="Export SVG">
39
52
  <DialogContent>
@@ -47,6 +60,40 @@ export default function ExportSvgDlg({
47
60
  value={filename}
48
61
  onChange={event => setFilename(event.target.value)}
49
62
  />
63
+ <br />
64
+ <TextField
65
+ select
66
+ label="Track label positioning"
67
+ variant="outlined"
68
+ style={{ width: 150 }}
69
+ value={trackLabels}
70
+ onChange={event => setTrackLabels(event.target.value)}
71
+ >
72
+ <MenuItem value="offset">Offset</MenuItem>
73
+ <MenuItem value="overlay">Overlay</MenuItem>
74
+ <MenuItem value="left">Left</MenuItem>
75
+ <MenuItem value="none">None</MenuItem>
76
+ </TextField>
77
+ <br />
78
+ {session.allThemes ? (
79
+ <TextField
80
+ select
81
+ label="Theme"
82
+ variant="outlined"
83
+ value={themeName}
84
+ onChange={event => setThemeName(event.target.value)}
85
+ >
86
+ {Object.entries(session.allThemes()).map(([key, val]) => (
87
+ <MenuItem key={key} value={key}>
88
+ {
89
+ // @ts-expect-error
90
+ val.name || '(Unknown name)'
91
+ }
92
+ </MenuItem>
93
+ ))}
94
+ </TextField>
95
+ ) : null}
96
+
50
97
  {offscreenCanvas ? (
51
98
  <FormControlLabel
52
99
  control={
@@ -80,7 +127,12 @@ export default function ExportSvgDlg({
80
127
  setLoading(true)
81
128
  setError(undefined)
82
129
  try {
83
- await model.exportSvg({ rasterizeLayers, filename })
130
+ await model.exportSvg({
131
+ rasterizeLayers,
132
+ filename,
133
+ trackLabels,
134
+ themeName,
135
+ })
84
136
  handleClose()
85
137
  } catch (e) {
86
138
  console.error(e)
@@ -38,7 +38,7 @@ const useStyles = makeStyles()(theme => ({
38
38
  width: 1,
39
39
  },
40
40
  majorTick: {
41
- background: theme.palette.text.secondary,
41
+ background: theme.palette.action.disabled,
42
42
  },
43
43
  minorTick: {
44
44
  background: theme.palette.divider,
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { observer } from 'mobx-react'
3
- import { Button, FormGroup, Typography, alpha } from '@mui/material'
3
+ import { Button, IconButton, FormGroup, Typography, alpha } from '@mui/material'
4
4
  import { makeStyles } from 'tss-react/mui'
5
5
  import { getBpDisplayStr } from '@jbrowse/core/util'
6
6
 
@@ -10,12 +10,7 @@ import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
10
10
  import ArrowBackIcon from '@mui/icons-material/ArrowBack'
11
11
 
12
12
  // locals
13
- import {
14
- LinearGenomeViewModel,
15
- WIDGET_HEIGHT,
16
- SPACING,
17
- HEADER_BAR_HEIGHT,
18
- } from '..'
13
+ import { LinearGenomeViewModel, SPACING } from '..'
19
14
  import OverviewScalebar from './OverviewScalebar'
20
15
  import ZoomControls from './ZoomControls'
21
16
  import SearchBox from './SearchBox'
@@ -23,7 +18,6 @@ import SearchBox from './SearchBox'
23
18
  type LGV = LinearGenomeViewModel
24
19
  const useStyles = makeStyles()(theme => ({
25
20
  headerBar: {
26
- height: HEADER_BAR_HEIGHT,
27
21
  display: 'flex',
28
22
  },
29
23
  headerForm: {
@@ -36,7 +30,7 @@ const useStyles = makeStyles()(theme => ({
36
30
 
37
31
  panButton: {
38
32
  background: alpha(theme.palette.background.paper, 0.8),
39
- height: WIDGET_HEIGHT,
33
+ color: theme.palette.text.primary,
40
34
  margin: SPACING,
41
35
  },
42
36
  bp: {
@@ -47,7 +41,7 @@ const useStyles = makeStyles()(theme => ({
47
41
  toggleButton: {
48
42
  height: 44,
49
43
  border: 'none',
50
- margin: theme.spacing(0.5),
44
+ marginLeft: theme.spacing(4),
51
45
  },
52
46
  buttonSpacer: {
53
47
  marginRight: theme.spacing(2),
@@ -57,15 +51,14 @@ const useStyles = makeStyles()(theme => ({
57
51
  const HeaderButtons = observer(({ model }: { model: LGV }) => {
58
52
  const { classes } = useStyles()
59
53
  return (
60
- <Button
54
+ <IconButton
61
55
  onClick={model.activateTrackSelector}
62
56
  className={classes.toggleButton}
63
57
  title="Open track selector"
64
58
  value="track_select"
65
- color="secondary"
66
59
  >
67
60
  <TrackSelectorIcon className={classes.buttonSpacer} />
68
- </Button>
61
+ </IconButton>
69
62
  )
70
63
  })
71
64
 
@@ -4,10 +4,10 @@ import { observer } from 'mobx-react'
4
4
  import { getSession } from '@jbrowse/core/util'
5
5
  import {
6
6
  Button,
7
- CircularProgress,
8
7
  FormControl,
9
8
  Container,
10
9
  Grid,
10
+ CircularProgress,
11
11
  } from '@mui/material'
12
12
  import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui'
13
13
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
@@ -19,6 +19,8 @@ import CloseIcon from '@mui/icons-material/Close'
19
19
  import RefNameAutocomplete from './RefNameAutocomplete'
20
20
  import { fetchResults, splitLast } from './util'
21
21
  import { LinearGenomeViewModel } from '..'
22
+
23
+ // lazies
22
24
  const SearchResultsDialog = lazy(() => import('./SearchResultsDialog'))
23
25
 
24
26
  const useStyles = makeStyles()(theme => ({
@@ -35,29 +37,29 @@ const useStyles = makeStyles()(theme => ({
35
37
 
36
38
  type LGV = LinearGenomeViewModel
37
39
 
38
- const ImportForm = observer(({ model }: { model: LGV }) => {
40
+ export default observer(function ({ model }: { model: LGV }) {
39
41
  const { classes } = useStyles()
40
42
  const session = getSession(model)
41
43
  const { assemblyNames, assemblyManager, textSearchManager } = session
42
44
  const { rankSearchResults, isSearchDialogDisplayed, error } = model
43
45
  const [selectedAsm, setSelectedAsm] = useState(assemblyNames[0])
44
46
  const [option, setOption] = useState<BaseResult>()
45
-
46
47
  const searchScope = model.searchScope(selectedAsm)
47
-
48
48
  const assembly = assemblyManager.get(selectedAsm)
49
49
  const assemblyError = assemblyNames.length
50
50
  ? assembly?.error
51
51
  : 'No configured assemblies'
52
- const regions = assembly?.regions || []
53
52
  const displayError = assemblyError || error
54
53
  const [value, setValue] = useState('')
55
- const r0 = regions[0]?.refName
54
+ const regions = assembly?.regions
55
+ const assemblyLoaded = !!regions
56
+ const r0 = regions ? regions[0]?.refName : ''
56
57
 
57
- // useEffect resets to an "initial state" of displaying first region from assembly
58
- // after assembly change. needs to react to selectedAsm as well as r0 because changing
59
- // assembly will run setValue('') and then r0 may not change if assembly names are the
60
- // same across assemblies, but it still needs to be reset
58
+ // useEffect resets to an "initial state" of displaying first region from
59
+ // assembly after assembly change. needs to react to selectedAsm as well as
60
+ // r0 because changing assembly will run setValue('') and then r0 may not
61
+ // change if assembly names are the same across assemblies, but it still
62
+ // needs to be reset
61
63
  useEffect(() => {
62
64
  setValue(r0)
63
65
  }, [r0, selectedAsm])
@@ -89,7 +91,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
89
91
  const allRefs = assembly?.allRefNamesWithLowerCase || []
90
92
  if (
91
93
  allRefs.includes(input) ||
92
- (allRefs.includes(ref) && !Number.isNaN(parseInt(rest, 10)))
94
+ (allRefs.includes(ref) && !Number.isNaN(Number.parseInt(rest, 10)))
93
95
  ) {
94
96
  await model.navToLocString(input, selectedAsm)
95
97
  } else {
@@ -142,10 +144,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
142
144
  <Grid item>
143
145
  <FormControl>
144
146
  <AssemblySelector
145
- onChange={val => {
146
- setSelectedAsm(val)
147
- setValue('')
148
- }}
147
+ onChange={val => setSelectedAsm(val)}
149
148
  localStorageKey="lgv"
150
149
  session={session}
151
150
  selected={selectedAsm}
@@ -156,7 +155,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
156
155
  {selectedAsm ? (
157
156
  assemblyError ? (
158
157
  <CloseIcon style={{ color: 'red' }} />
159
- ) : value ? (
158
+ ) : assemblyLoaded ? (
160
159
  <FormControl>
161
160
  <RefNameAutocomplete
162
161
  fetchResults={queryString =>
@@ -169,9 +168,8 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
169
168
  })
170
169
  }
171
170
  model={model}
172
- assemblyName={assemblyError ? undefined : selectedAsm}
171
+ assemblyName={selectedAsm}
173
172
  value={value}
174
- // note: minWidth 270 accommodates full width of helperText
175
173
  minWidth={270}
176
174
  onChange={str => setValue(str)}
177
175
  onSelect={val => setOption(val)}
@@ -179,16 +177,11 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
179
177
  variant: 'outlined',
180
178
  helperText:
181
179
  'Enter sequence name, feature name, or location',
182
- style: { minWidth: '175px' },
183
180
  }}
184
181
  />
185
182
  </FormControl>
186
183
  ) : (
187
- <CircularProgress
188
- role="progressbar"
189
- size={20}
190
- disableShrink
191
- />
184
+ <CircularProgress size={20} disableShrink />
192
185
  )
193
186
  ) : null}
194
187
  </Grid>
@@ -232,5 +225,3 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
232
225
  </div>
233
226
  )
234
227
  })
235
-
236
- export default ImportForm
@@ -1,7 +1,6 @@
1
1
  import React from 'react'
2
2
  import { fireEvent, render, waitFor } from '@testing-library/react'
3
3
  import { createTestSession } from '@jbrowse/web/src/rootModel'
4
- import '@testing-library/jest-dom/extend-expect'
5
4
  import 'requestidlecallback-polyfill'
6
5
 
7
6
  // locals
@@ -81,9 +80,8 @@ test('renders one track, one region', async () => {
81
80
  })
82
81
  const model = session.views[0]
83
82
  model.setWidth(800)
84
- const { container, queryByText, getByPlaceholderText, findByText } = render(
85
- <LinearGenomeView model={model} />,
86
- )
83
+ const { container, queryAllByTestId, getByPlaceholderText, findByText } =
84
+ render(<LinearGenomeView model={model} />)
87
85
  await findByText('Foo Track')
88
86
  // test needs to wait until it's updated to display 100 bp in the header to
89
87
  // make snapshot pass
@@ -94,8 +92,9 @@ test('renders one track, one region', async () => {
94
92
  (getByPlaceholderText('Search for location') as HTMLInputElement).value,
95
93
  ).toEqual('ctgA:1..100')
96
94
  })
97
- await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
98
- expect(container.firstChild).toMatchSnapshot()
95
+ await waitFor(() => expect(queryAllByTestId('svgfeatures').length).toBe(1))
96
+ // snapshot has no features rendered
97
+ expect(container).toMatchSnapshot()
99
98
  })
100
99
 
101
100
  test('renders two tracks, two regions', async () => {
@@ -158,13 +157,11 @@ test('renders two tracks, two regions', async () => {
158
157
  })
159
158
  const model = session.views[0]
160
159
  model.setWidth(800)
161
- const { container, findByText, queryByText, findAllByTestId } = render(
160
+ const { container, findByText, queryAllByTestId } = render(
162
161
  <LinearGenomeView model={model} />,
163
162
  )
164
163
  await findByText('Foo Track')
165
164
  await findByText('798bp')
166
- await findAllByTestId('svgfeatures', {}, { timeout: 10000 })
167
- await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
168
-
169
- expect(container.firstChild).toMatchSnapshot()
165
+ await waitFor(() => expect(queryAllByTestId('svgfeatures').length).toBe(4))
166
+ expect(container).toMatchSnapshot()
170
167
  }, 15000)
@@ -28,7 +28,7 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
28
28
  const { classes } = useStyles()
29
29
 
30
30
  if (!initialized && !error) {
31
- return <LoadingEllipses variant="h5" />
31
+ return <LoadingEllipses variant="h6" />
32
32
  }
33
33
  if (!hasDisplayedRegions || error) {
34
34
  return <ImportForm model={model} />
@@ -1,10 +1,14 @@
1
1
  import React, { useState } from 'react'
2
2
  import { observer } from 'mobx-react'
3
3
  import { IconButton, Paper } from '@mui/material'
4
+ import Menu from '@jbrowse/core/ui/Menu'
5
+
6
+ // icons
4
7
  import ZoomIn from '@mui/icons-material/ZoomIn'
5
8
  import ZoomOut from '@mui/icons-material/ZoomOut'
6
9
  import ArrowDown from '@mui/icons-material/KeyboardArrowDown'
7
- import Menu from '@jbrowse/core/ui/Menu'
10
+
11
+ // locals
8
12
  import { LinearGenomeViewModel } from '..'
9
13
 
10
14
  const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
@@ -15,10 +19,7 @@ const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
15
19
  return hideHeader ? (
16
20
  <div style={{ position: 'absolute', right: '0px', zIndex: '1001' }}>
17
21
  <Paper style={{ background: '#aaa7' }}>
18
- <IconButton
19
- color="secondary"
20
- onClick={event => setAnchorEl(event.currentTarget)}
21
- >
22
+ <IconButton onClick={event => setAnchorEl(event.currentTarget)}>
22
23
  <ArrowDown fontSize="small" />
23
24
  </IconButton>
24
25
 
@@ -26,7 +27,6 @@ const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
26
27
  data-testid="zoom_out"
27
28
  onClick={() => model.zoom(bpPerPx * 2)}
28
29
  disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1}
29
- color="secondary"
30
30
  >
31
31
  <ZoomOut fontSize="small" />
32
32
  </IconButton>
@@ -34,7 +34,6 @@ const MiniControls = observer((props: { model: LinearGenomeViewModel }) => {
34
34
  data-testid="zoom_in"
35
35
  onClick={() => model.zoom(model.bpPerPx / 2)}
36
36
  disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1}
37
- color="secondary"
38
37
  >
39
38
  <ZoomIn fontSize="small" />
40
39
  </IconButton>
@@ -4,6 +4,8 @@ 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
+
8
+ // locals
7
9
  import { LinearGenomeViewModel } from '..'
8
10
  import RubberbandSpan from './RubberbandSpan'
9
11
  import { getRelativeX } from './util'
@@ -25,50 +27,43 @@ const useStyles = makeStyles()({
25
27
  },
26
28
  })
27
29
 
28
- const HoverTooltip = observer(
29
- ({
30
- model,
31
- open,
32
- guideX,
33
- overview,
34
- }: {
35
- model: LGV
36
- open: boolean
37
- guideX: number
38
- overview: Base1DViewModel
39
- }) => {
40
- const { classes } = useStyles()
41
- const { cytobandOffset } = model
42
- const { assemblyManager } = getSession(model)
43
-
44
- const px = overview.pxToBp(guideX - cytobandOffset)
45
- const assembly = assemblyManager.get(px.assemblyName)
46
- const cytoband = assembly?.cytobands?.find(
47
- f =>
48
- px.coord > f.get('start') &&
49
- px.coord < f.get('end') &&
50
- px.refName === assembly.getCanonicalRefName(f.get('refName')),
51
- )
30
+ const HoverTooltip = observer(function ({
31
+ model,
32
+ open,
33
+ guideX,
34
+ overview,
35
+ }: {
36
+ model: LGV
37
+ open: boolean
38
+ guideX: number
39
+ overview: Base1DViewModel
40
+ }) {
41
+ const { classes } = useStyles()
42
+ const { cytobandOffset } = model
43
+ const { assemblyManager } = getSession(model)
44
+
45
+ const px = overview.pxToBp(guideX - cytobandOffset)
46
+ const assembly = assemblyManager.get(px.assemblyName)
47
+ const cytoband = assembly?.cytobands?.find(
48
+ f =>
49
+ px.coord > f.get('start') &&
50
+ px.coord < f.get('end') &&
51
+ px.refName === assembly.getCanonicalRefName(f.get('refName')),
52
+ )
52
53
 
53
- return (
54
- <Tooltip
55
- open={open}
56
- placement="top"
57
- title={[stringify(px), cytoband?.get('name')].join(' ')}
58
- arrow
59
- >
60
- <div
61
- className={classes.guide}
62
- style={{
63
- left: guideX,
64
- }}
65
- />
66
- </Tooltip>
67
- )
68
- },
69
- )
54
+ return (
55
+ <Tooltip
56
+ open={open}
57
+ placement="top"
58
+ title={[stringify(px), cytoband?.get('name')].join(' ')}
59
+ arrow
60
+ >
61
+ <div className={classes.guide} style={{ left: guideX }} />
62
+ </Tooltip>
63
+ )
64
+ })
70
65
 
71
- function OverviewRubberband({
66
+ export default observer(function OverviewRubberband({
72
67
  model,
73
68
  overview,
74
69
  ControlComponent = <div />,
@@ -171,7 +166,6 @@ function OverviewRubberband({
171
166
  ) : null}
172
167
  <div
173
168
  className={classes.rubberbandControl}
174
- role="presentation"
175
169
  ref={controlsRef}
176
170
  onMouseDown={mouseDown}
177
171
  onMouseOut={mouseOut}
@@ -195,7 +189,7 @@ function OverviewRubberband({
195
189
  if (startX) {
196
190
  leftBpOffset = overview.pxToBp(startX - cytobandOffset)
197
191
  rightBpOffset = overview.pxToBp(startX + width - cytobandOffset)
198
- if (currentX && currentX < startX) {
192
+ if (currentX !== undefined && currentX < startX) {
199
193
  ;[leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset]
200
194
  }
201
195
  }
@@ -206,14 +200,13 @@ function OverviewRubberband({
206
200
  <RubberbandSpan
207
201
  leftBpOffset={leftBpOffset}
208
202
  rightBpOffset={rightBpOffset}
209
- width={width}
203
+ width={Math.abs(width)}
210
204
  left={left}
211
205
  />
212
206
  ) : null}
213
207
  <div
214
208
  data-testid="rubberband_controls"
215
209
  className={classes.rubberbandControl}
216
- role="presentation"
217
210
  ref={controlsRef}
218
211
  onMouseDown={mouseDown}
219
212
  onMouseOut={mouseOut}
@@ -223,6 +216,4 @@ function OverviewRubberband({
223
216
  </div>
224
217
  </div>
225
218
  )
226
- }
227
-
228
- export default observer(OverviewRubberband)
219
+ })