@jbrowse/plugin-linear-genome-view 1.7.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -5
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +118 -226
  3. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  4. package/dist/BaseLinearDisplay/components/Block.js +53 -74
  5. package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
  6. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
  7. package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
  8. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  9. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +145 -175
  10. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  11. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
  12. package/dist/BaseLinearDisplay/components/Tooltip.js +118 -0
  13. package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  14. package/dist/BaseLinearDisplay/index.js +13 -40
  15. package/dist/BaseLinearDisplay/index.js.map +1 -0
  16. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +20 -15
  17. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -683
  18. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  19. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
  20. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  21. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
  22. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
  23. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  24. package/dist/LinearBareDisplay/configSchema.js +11 -17
  25. package/dist/LinearBareDisplay/configSchema.js.map +1 -0
  26. package/dist/LinearBareDisplay/index.js +7 -20
  27. package/dist/LinearBareDisplay/index.js.map +1 -0
  28. package/dist/LinearBareDisplay/model.d.ts +16 -14
  29. package/dist/LinearBareDisplay/model.js +36 -42
  30. package/dist/LinearBareDisplay/model.js.map +1 -0
  31. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
  32. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
  33. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  34. package/dist/LinearBasicDisplay/configSchema.js +15 -23
  35. package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
  36. package/dist/LinearBasicDisplay/index.js +10 -22
  37. package/dist/LinearBasicDisplay/index.js.map +1 -0
  38. package/dist/LinearBasicDisplay/model.d.ts +20 -15
  39. package/dist/LinearBasicDisplay/model.js +180 -159
  40. package/dist/LinearBasicDisplay/model.js.map +1 -0
  41. package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
  42. package/dist/LinearGenomeView/components/CenterLine.js +60 -74
  43. package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
  44. package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
  45. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  46. package/dist/LinearGenomeView/components/Header.js +70 -123
  47. package/dist/LinearGenomeView/components/Header.js.map +1 -0
  48. package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  49. package/dist/LinearGenomeView/components/HelpDialog.js +62 -45
  50. package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
  51. package/dist/LinearGenomeView/components/ImportForm.js +223 -320
  52. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
  53. package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -120
  54. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  55. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
  56. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  57. package/dist/LinearGenomeView/components/MiniControls.js +64 -78
  58. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
  59. package/dist/LinearGenomeView/components/OverviewRubberBand.js +226 -293
  60. package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  61. package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +24 -8
  62. package/dist/LinearGenomeView/components/OverviewScaleBar.js +277 -365
  63. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  64. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
  65. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
  66. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  67. package/dist/LinearGenomeView/components/RubberBand.js +229 -296
  68. package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
  69. package/dist/LinearGenomeView/components/Ruler.js +45 -90
  70. package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
  71. package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -399
  72. package/dist/LinearGenomeView/components/ScaleBar.js +121 -167
  73. package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
  74. package/dist/LinearGenomeView/components/SearchBox.js +158 -205
  75. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
  76. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
  77. package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -150
  78. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  79. package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
  80. package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  81. package/dist/LinearGenomeView/components/TrackContainer.js +116 -156
  82. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
  83. package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
  84. package/dist/LinearGenomeView/components/TrackLabel.js +115 -150
  85. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
  86. package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  87. package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
  88. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
  89. package/dist/LinearGenomeView/components/VerticalGuides.d.ts +2 -3
  90. package/dist/LinearGenomeView/components/VerticalGuides.js +66 -104
  91. package/dist/LinearGenomeView/components/VerticalGuides.js.map +1 -0
  92. package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
  93. package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
  94. package/dist/LinearGenomeView/components/util.d.ts +12 -0
  95. package/dist/LinearGenomeView/components/util.js +95 -13
  96. package/dist/LinearGenomeView/components/util.js.map +1 -0
  97. package/dist/LinearGenomeView/index.d.ts +6 -11
  98. package/dist/LinearGenomeView/index.js +1163 -1387
  99. package/dist/LinearGenomeView/index.js.map +1 -0
  100. package/dist/LinearGenomeView/util.js +76 -83
  101. package/dist/LinearGenomeView/util.js.map +1 -0
  102. package/dist/index.d.ts +101 -51
  103. package/dist/index.js +225 -284
  104. package/dist/index.js.map +1 -0
  105. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
  106. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
  107. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  108. package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
  109. package/esm/BaseLinearDisplay/components/Block.js +46 -0
  110. package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
  111. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
  112. package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
  113. package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  114. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
  115. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +113 -0
  116. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  117. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
  118. package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
  119. package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  120. package/esm/BaseLinearDisplay/index.d.ts +5 -0
  121. package/esm/BaseLinearDisplay/index.js +4 -0
  122. package/esm/BaseLinearDisplay/index.js.map +1 -0
  123. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
  124. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
  125. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  126. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
  127. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
  128. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  129. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
  130. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
  131. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  132. package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
  133. package/esm/LinearBareDisplay/configSchema.js +9 -0
  134. package/esm/LinearBareDisplay/configSchema.js.map +1 -0
  135. package/esm/LinearBareDisplay/index.d.ts +2 -0
  136. package/esm/LinearBareDisplay/index.js +3 -0
  137. package/esm/LinearBareDisplay/index.js.map +1 -0
  138. package/esm/LinearBareDisplay/model.d.ts +194 -0
  139. package/esm/LinearBareDisplay/model.js +28 -0
  140. package/esm/LinearBareDisplay/model.js.map +1 -0
  141. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
  142. package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
  143. package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  144. package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
  145. package/esm/LinearBasicDisplay/configSchema.js +14 -0
  146. package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
  147. package/esm/LinearBasicDisplay/index.d.ts +2 -0
  148. package/esm/LinearBasicDisplay/index.js +3 -0
  149. package/esm/LinearBasicDisplay/index.js.map +1 -0
  150. package/esm/LinearBasicDisplay/model.d.ts +218 -0
  151. package/esm/LinearBasicDisplay/model.js +127 -0
  152. package/esm/LinearBasicDisplay/model.js.map +1 -0
  153. package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
  154. package/esm/LinearGenomeView/components/CenterLine.js +40 -0
  155. package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
  156. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
  157. package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
  158. package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  159. package/esm/LinearGenomeView/components/Header.d.ts +7 -0
  160. package/esm/LinearGenomeView/components/Header.js +81 -0
  161. package/esm/LinearGenomeView/components/Header.js.map +1 -0
  162. package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
  163. package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
  164. package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
  165. package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
  166. package/esm/LinearGenomeView/components/ImportForm.js +141 -0
  167. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
  168. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
  169. package/esm/LinearGenomeView/components/LinearGenomeView.js +67 -0
  170. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  171. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
  172. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
  173. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  174. package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
  175. package/esm/LinearGenomeView/components/MiniControls.js +25 -0
  176. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
  177. package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
  178. package/esm/LinearGenomeView/components/OverviewRubberBand.js +194 -0
  179. package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  180. package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
  181. package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
  182. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  183. package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
  184. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
  185. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  186. package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
  187. package/esm/LinearGenomeView/components/RubberBand.js +198 -0
  188. package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
  189. package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
  190. package/esm/LinearGenomeView/components/Ruler.js +50 -0
  191. package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
  192. package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
  193. package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
  194. package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
  195. package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
  196. package/esm/LinearGenomeView/components/SearchBox.js +94 -0
  197. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
  198. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
  199. package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
  200. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  201. package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
  202. package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
  203. package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  204. package/esm/LinearGenomeView/components/TrackContainer.d.ts +9 -0
  205. package/esm/LinearGenomeView/components/TrackContainer.js +109 -0
  206. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
  207. package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
  208. package/esm/LinearGenomeView/components/TrackLabel.js +89 -0
  209. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
  210. package/esm/LinearGenomeView/components/TracksContainer.d.ts +10 -0
  211. package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
  212. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
  213. package/esm/LinearGenomeView/components/VerticalGuides.d.ts +8 -0
  214. package/esm/LinearGenomeView/components/VerticalGuides.js +71 -0
  215. package/esm/LinearGenomeView/components/VerticalGuides.js.map +1 -0
  216. package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
  217. package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
  218. package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
  219. package/esm/LinearGenomeView/components/util.d.ts +14 -0
  220. package/esm/LinearGenomeView/components/util.js +17 -0
  221. package/esm/LinearGenomeView/components/util.js.map +1 -0
  222. package/esm/LinearGenomeView/index.d.ts +288 -0
  223. package/esm/LinearGenomeView/index.js +1124 -0
  224. package/esm/LinearGenomeView/index.js.map +1 -0
  225. package/esm/LinearGenomeView/util.d.ts +14 -0
  226. package/esm/LinearGenomeView/util.js +62 -0
  227. package/esm/LinearGenomeView/util.js.map +1 -0
  228. package/esm/index.d.ts +615 -0
  229. package/esm/index.js +127 -0
  230. package/esm/index.js.map +1 -0
  231. package/package.json +21 -13
  232. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +6 -90
  233. package/src/BaseLinearDisplay/components/Block.tsx +5 -5
  234. package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
  235. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
  236. package/src/BaseLinearDisplay/components/Tooltip.tsx +107 -0
  237. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +16 -8
  238. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
  239. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
  240. package/src/LinearBasicDisplay/model.ts +21 -15
  241. package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
  242. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
  243. package/src/LinearGenomeView/components/Header.tsx +12 -16
  244. package/src/LinearGenomeView/components/HelpDialog.tsx +10 -9
  245. package/src/LinearGenomeView/components/ImportForm.tsx +24 -37
  246. package/src/LinearGenomeView/components/LinearGenomeView.test.js +18 -8
  247. package/src/LinearGenomeView/components/LinearGenomeView.tsx +20 -13
  248. package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
  249. package/src/LinearGenomeView/components/OverviewRubberBand.tsx +6 -10
  250. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +103 -93
  251. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
  252. package/src/LinearGenomeView/components/RubberBand.tsx +12 -17
  253. package/src/LinearGenomeView/components/Ruler.tsx +5 -11
  254. package/src/LinearGenomeView/components/ScaleBar.tsx +27 -34
  255. package/src/LinearGenomeView/components/SearchBox.tsx +22 -32
  256. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -7
  257. package/src/LinearGenomeView/components/SequenceDialog.tsx +9 -9
  258. package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
  259. package/src/LinearGenomeView/components/TrackLabel.tsx +37 -50
  260. package/src/LinearGenomeView/components/TracksContainer.tsx +8 -13
  261. package/src/LinearGenomeView/components/VerticalGuides.tsx +9 -11
  262. package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
  263. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +504 -568
  264. package/src/LinearGenomeView/components/util.ts +43 -0
  265. package/src/LinearGenomeView/index.test.ts +21 -5
  266. package/src/LinearGenomeView/index.tsx +101 -88
  267. package/src/index.ts +36 -31
  268. package/dist/LinearBareDisplay/index.test.js +0 -33
  269. package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
  270. package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
  271. package/dist/LinearGenomeView/index.test.js +0 -1170
  272. package/dist/LinearGenomeView/util.test.js +0 -78
@@ -1,11 +1,11 @@
1
1
  import React from 'react'
2
- import { Typography, makeStyles, useTheme, alpha } from '@material-ui/core'
2
+ import { Typography, useTheme, alpha } from '@mui/material'
3
+ import { makeStyles } from 'tss-react/mui'
3
4
  import { observer } from 'mobx-react'
4
5
  import { Instance } from 'mobx-state-tree'
5
- import clsx from 'clsx'
6
6
 
7
7
  import Base1DView, { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
8
- import { getSession } from '@jbrowse/core/util'
8
+ import { getSession, getTickDisplayStr } from '@jbrowse/core/util'
9
9
  import { ContentBlock } from '@jbrowse/core/util/blockTypes'
10
10
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
11
11
 
@@ -20,60 +20,57 @@ import OverviewRubberBand from './OverviewRubberBand'
20
20
 
21
21
  const wholeSeqSpacer = 2
22
22
 
23
- const useStyles = makeStyles(theme => {
24
- return {
25
- scaleBar: {
26
- height: HEADER_OVERVIEW_HEIGHT,
27
- },
28
- scaleBarBorder: {
29
- border: '1px solid',
30
- },
31
- scaleBarContig: {
32
- backgroundColor: theme.palette.background.default,
33
- position: 'absolute',
34
- top: 0,
35
- height: HEADER_OVERVIEW_HEIGHT,
36
- },
37
- scaleBarContigForward: {
38
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M-.1 0L6 4.5L-.1 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
39
- backgroundRepeat: 'repeat',
40
- },
41
- scaleBarContigReverse: {
42
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M6 0L0 4.5L6 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
43
- backgroundRepeat: 'repeat',
44
- },
45
-
46
- scaleBarRefName: {
47
- position: 'absolute',
48
- fontWeight: 'bold',
49
- pointerEvents: 'none',
50
- zIndex: 100,
51
- },
52
- scaleBarLabel: {
53
- height: HEADER_OVERVIEW_HEIGHT,
54
- width: 1,
55
- position: 'absolute',
56
- display: 'flex',
57
- justifyContent: 'center',
58
- pointerEvents: 'none',
59
- },
60
- scaleBarVisibleRegion: {
61
- position: 'absolute',
62
- height: HEADER_OVERVIEW_HEIGHT,
63
- pointerEvents: 'none',
64
- zIndex: 100,
65
- border: '1px solid',
66
- },
67
- overview: {
68
- height: HEADER_BAR_HEIGHT,
69
- position: 'relative',
70
- },
71
- overviewSvg: {
72
- width: '100%',
73
- position: 'absolute',
74
- },
75
- }
76
- })
23
+ const useStyles = makeStyles()(theme => ({
24
+ scaleBar: {
25
+ height: HEADER_OVERVIEW_HEIGHT,
26
+ },
27
+ scaleBarBorder: {
28
+ border: '1px solid',
29
+ },
30
+ scaleBarContig: {
31
+ backgroundColor: theme.palette.background.default,
32
+ position: 'absolute',
33
+ top: 0,
34
+ height: HEADER_OVERVIEW_HEIGHT,
35
+ },
36
+ scaleBarContigForward: {
37
+ backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M-.1 0L6 4.5L-.1 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
38
+ backgroundRepeat: 'repeat',
39
+ },
40
+ scaleBarContigReverse: {
41
+ backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M6 0L0 4.5L6 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
42
+ backgroundRepeat: 'repeat',
43
+ },
44
+
45
+ scaleBarRefName: {
46
+ position: 'absolute',
47
+ fontWeight: 'bold',
48
+ pointerEvents: 'none',
49
+ zIndex: 100,
50
+ },
51
+ scaleBarLabel: {
52
+ height: HEADER_OVERVIEW_HEIGHT,
53
+ position: 'absolute',
54
+ display: 'flex',
55
+ justifyContent: 'center',
56
+ pointerEvents: 'none',
57
+ },
58
+ scaleBarVisibleRegion: {
59
+ position: 'absolute',
60
+ height: HEADER_OVERVIEW_HEIGHT,
61
+ pointerEvents: 'none',
62
+ zIndex: 100,
63
+ border: '1px solid',
64
+ },
65
+ overview: {
66
+ height: HEADER_BAR_HEIGHT,
67
+ position: 'relative',
68
+ },
69
+ overviewSvg: {
70
+ width: '100%',
71
+ position: 'absolute',
72
+ },
73
+ }))
77
74
 
78
75
  const Polygon = observer(
79
76
  ({
@@ -90,6 +87,8 @@ const Polygon = observer(
90
87
  const { interRegionPaddingWidth, offsetPx, dynamicBlocks, cytobandOffset } =
91
88
  model
92
89
  const { contentBlocks, totalWidthPxWithoutBorders } = dynamicBlocks
90
+
91
+ // @ts-ignore
93
92
  const { tertiary, primary } = theme.palette
94
93
  const polygonColor = tertiary ? tertiary.light : primary.light
95
94
 
@@ -171,6 +170,19 @@ const colorMap: { [key: string]: string | undefined } = {
171
170
  acen: '#800',
172
171
  }
173
172
 
173
+ function getCytobands(assembly: Assembly | undefined, refName: string) {
174
+ return (
175
+ assembly?.cytobands
176
+ ?.map(f => ({
177
+ refName: assembly.getCanonicalRefName(f.get('refName')),
178
+ start: f.get('start'),
179
+ end: f.get('end'),
180
+ type: f.get('type'),
181
+ }))
182
+ .filter(f => f.refName === refName) || []
183
+ )
184
+ }
185
+
174
186
  const Cytobands = observer(
175
187
  ({
176
188
  overview,
@@ -182,37 +194,30 @@ const Cytobands = observer(
182
194
  block: ContentBlock
183
195
  }) => {
184
196
  const { offsetPx, reversed } = block
185
- const cytobands = assembly?.cytobands
186
- ?.map(f => ({
187
- refName: assembly.getCanonicalRefName(f.get('refName')),
188
- start: f.get('start'),
189
- end: f.get('end'),
190
- type: f.get('type'),
191
- }))
192
- .filter(f => f.refName === block.refName)
193
- .map(f => {
194
- const { refName, start, end, type } = f
195
- return [
196
- overview.bpToPx({
197
- refName,
198
- coord: start,
199
- }),
200
- overview.bpToPx({
201
- refName,
202
- coord: end,
203
- }),
204
- type,
205
- ]
206
- })
197
+ const cytobands = getCytobands(assembly, block.refName)
198
+ const coords = cytobands.map(f => {
199
+ const { refName, start, end, type } = f
200
+ return [
201
+ overview.bpToPx({
202
+ refName,
203
+ coord: start,
204
+ }),
205
+ overview.bpToPx({
206
+ refName,
207
+ coord: end,
208
+ }),
209
+ type,
210
+ ]
211
+ })
207
212
 
208
213
  const arr = cytobands || []
209
214
  const lcap = reversed ? arr.length - 1 : 0
210
215
  const rcap = reversed ? 0 : arr.length - 1
211
216
 
212
217
  let firstCent = true
213
- return cytobands ? (
218
+ return (
214
219
  <g transform={`translate(-${offsetPx})`}>
215
- {cytobands.map(([start, end, type], index) => {
220
+ {coords.map(([start, end, type], index) => {
216
221
  const key = `${start}-${end}-${type}`
217
222
  if (type === 'acen' && firstCent) {
218
223
  firstCent = false
@@ -284,7 +289,7 @@ const Cytobands = observer(
284
289
  }
285
290
  })}
286
291
  </g>
287
- ) : null
292
+ )
288
293
  },
289
294
  )
290
295
 
@@ -300,8 +305,8 @@ const OverviewBox = observer(
300
305
  block: ContentBlock
301
306
  overview: Base1DViewModel
302
307
  }) => {
303
- const classes = useStyles()
304
- const { cytobandOffset, showCytobands } = model
308
+ const { classes, cx } = useStyles()
309
+ const { cytobandOffset, bpPerPx, showCytobands } = model
305
310
  const { start, end, reversed, refName, assemblyName } = block
306
311
  const { majorPitch } = chooseGridPitch(scale, 120, 15)
307
312
  const { assemblyManager } = getSession(model)
@@ -314,27 +319,30 @@ const OverviewBox = observer(
314
319
  tickLabels.push(reversed ? end - offsetLabel : start + offsetLabel)
315
320
  }
316
321
 
322
+ const canDisplayCytobands =
323
+ showCytobands && getCytobands(assembly, block.refName).length
324
+
317
325
  return (
318
326
  <div>
319
327
  {/* name of sequence */}
320
328
  <Typography
321
329
  style={{
322
330
  left: block.offsetPx + 3,
323
- color: showCytobands ? 'black' : refNameColor,
331
+ color: canDisplayCytobands ? 'black' : refNameColor,
324
332
  }}
325
333
  className={classes.scaleBarRefName}
326
334
  >
327
335
  {refName}
328
336
  </Typography>
329
337
  <div
330
- className={clsx(
338
+ className={cx(
331
339
  classes.scaleBarContig,
332
- showCytobands
340
+ canDisplayCytobands
333
341
  ? undefined
334
342
  : reversed
335
343
  ? classes.scaleBarContigReverse
336
344
  : classes.scaleBarContigForward,
337
- !showCytobands ? classes.scaleBarBorder : undefined,
345
+ !canDisplayCytobands ? classes.scaleBarBorder : undefined,
338
346
  )}
339
347
  style={{
340
348
  left: block.offsetPx + cytobandOffset,
@@ -342,7 +350,7 @@ const OverviewBox = observer(
342
350
  borderColor: refNameColor,
343
351
  }}
344
352
  >
345
- {!showCytobands
353
+ {!canDisplayCytobands
346
354
  ? tickLabels.map((tickLabel, labelIdx) => (
347
355
  <Typography
348
356
  key={`${JSON.stringify(block)}-${tickLabel}-${labelIdx}`}
@@ -354,12 +362,12 @@ const OverviewBox = observer(
354
362
  color: refNameColor,
355
363
  }}
356
364
  >
357
- {tickLabel.toLocaleString('en-US')}
365
+ {getTickDisplayStr(tickLabel, bpPerPx)}
358
366
  </Typography>
359
367
  ))
360
368
  : null}
361
369
 
362
- {showCytobands ? (
370
+ {canDisplayCytobands ? (
363
371
  <svg style={{ width: '100%' }}>
364
372
  <Cytobands
365
373
  overview={overview}
@@ -384,11 +392,13 @@ const ScaleBar = observer(
384
392
  overview: Base1DViewModel
385
393
  scale: number
386
394
  }) => {
387
- const classes = useStyles()
395
+ const { classes } = useStyles()
388
396
  const theme = useTheme()
389
397
  const { dynamicBlocks, showCytobands, cytobandOffset } = model
390
398
  const visibleRegions = dynamicBlocks.contentBlocks
391
399
  const overviewVisibleRegions = overview.dynamicBlocks
400
+
401
+ // @ts-ignore
392
402
  const { tertiary, primary } = theme.palette
393
403
  const scaleBarColor = tertiary ? tertiary.light : primary.light
394
404
 
@@ -459,7 +469,7 @@ function OverviewScaleBar({
459
469
  model: LGV
460
470
  children: React.ReactNode
461
471
  }) {
462
- const classes = useStyles()
472
+ const { classes } = useStyles()
463
473
  const { totalBp, width, cytobandOffset, displayedRegions } = model
464
474
 
465
475
  const overview = Base1DView.create({
@@ -5,20 +5,17 @@ import BaseResult, {
5
5
  RefSequenceResult,
6
6
  } from '@jbrowse/core/TextSearch/BaseResults'
7
7
  import {
8
+ Autocomplete,
8
9
  CircularProgress,
9
10
  IconButton,
10
11
  InputAdornment,
11
- Popper,
12
- PopperProps,
13
12
  TextField,
14
13
  TextFieldProps as TFP,
15
- Typography,
16
- } from '@material-ui/core'
14
+ } from '@mui/material'
17
15
 
18
16
  // icons
19
- import SearchIcon from '@material-ui/icons/Search'
20
- import Autocomplete from '@material-ui/lab/Autocomplete'
21
- import HelpIcon from '@material-ui/icons/Help'
17
+ import SearchIcon from '@mui/icons-material/Search'
18
+ import HelpIcon from '@mui/icons-material/Help'
22
19
 
23
20
  // locals
24
21
  import { LinearGenomeViewModel } from '..'
@@ -45,25 +42,6 @@ function filterOptions(options: Option[], searchQuery: string) {
45
42
  })
46
43
  }
47
44
 
48
- // MyPopper used to expand search results box wider if needed
49
- // xref https://stackoverflow.com/a/63583835/2129219
50
- const MyPopper = function (
51
- props: PopperProps & { style?: { width?: unknown } },
52
- ) {
53
- const { style } = props
54
- return (
55
- <Popper
56
- {...props}
57
- style={{
58
- width: 'fit-content',
59
- minWidth: Math.min(+(style?.width || 0), 200),
60
- background: 'white',
61
- }}
62
- placement="bottom-start"
63
- />
64
- )
65
- }
66
-
67
45
  function RefNameAutocomplete({
68
46
  model,
69
47
  onSelect,
@@ -164,7 +142,6 @@ function RefNameAutocomplete({
164
142
  data-testid="autocomplete"
165
143
  disableListWrap
166
144
  disableClearable
167
- PopperComponent={MyPopper}
168
145
  disabled={!assemblyName}
169
146
  freeSolo
170
147
  includeInputInList
@@ -226,11 +203,11 @@ function RefNameAutocomplete({
226
203
  const { helperText, InputProps = {} } = TextFieldProps
227
204
  return (
228
205
  <TextField
229
- onBlur={() => {
206
+ onBlur={() =>
230
207
  // this is used to restore a refName or the non-user-typed input
231
208
  // to the box on blurring
232
209
  setInputValue(inputBoxVal)
233
- }}
210
+ }
234
211
  {...params}
235
212
  {...TextFieldProps}
236
213
  helperText={helperText}
@@ -244,12 +221,13 @@ function RefNameAutocomplete({
244
221
  <CircularProgress color="inherit" size={20} />
245
222
  ) : (
246
223
  <InputAdornment position="end" style={{ marginRight: 7 }}>
247
- <SearchIcon />
224
+ <SearchIcon fontSize="small" />
248
225
  {showHelp ? (
249
226
  <IconButton
250
227
  onClick={() => setHelpDialogDisplayed(true)}
228
+ size="small"
251
229
  >
252
- <HelpIcon />
230
+ <HelpIcon fontSize="small" />
253
231
  </IconButton>
254
232
  ) : null}
255
233
  </InputAdornment>
@@ -259,23 +237,14 @@ function RefNameAutocomplete({
259
237
  ),
260
238
  }}
261
239
  placeholder="Search for location"
262
- onChange={e => {
263
- setCurrentSearch(e.target.value)
264
- }}
240
+ onChange={e => setCurrentSearch(e.target.value)}
265
241
  />
266
242
  )
267
243
  }}
268
- renderOption={option => {
269
- const { result } = option
270
- const component = result.getRenderingComponent()
271
- if (component && React.isValidElement(component)) {
272
- return component
273
- }
274
-
275
- return <Typography noWrap>{result.getDisplayString()}</Typography>
276
- }}
277
244
  getOptionLabel={option =>
278
- (typeof option === 'string' ? option : option.result.getLabel()) || ''
245
+ (typeof option === 'string'
246
+ ? option
247
+ : option.result.getDisplayString()) || ''
279
248
  }
280
249
  />
281
250
  {isHelpDialogDisplayed ? (
@@ -1,22 +1,19 @@
1
1
  import React, { useRef, useEffect, useState } from 'react'
2
2
  import { observer } from 'mobx-react'
3
- import {
4
- Popover,
5
- Tooltip,
6
- Typography,
7
- makeStyles,
8
- alpha,
9
- } from '@material-ui/core'
3
+ import { Popover, Tooltip, Typography, alpha } from '@mui/material'
4
+ import { makeStyles } from 'tss-react/mui'
10
5
  import { stringify } from '@jbrowse/core/util'
11
6
  import { Menu } from '@jbrowse/core/ui'
12
7
  import { LinearGenomeViewModel } from '..'
13
8
 
14
9
  type LGV = LinearGenomeViewModel
15
10
 
16
- const useStyles = makeStyles(theme => {
17
- const background = theme.palette.tertiary
18
- ? alpha(theme.palette.tertiary.main, 0.7)
19
- : alpha(theme.palette.primary.main, 0.7)
11
+ const useStyles = makeStyles()(theme => {
12
+ // @ts-ignore
13
+ const { primary, tertiary } = theme.palette
14
+ const background = tertiary
15
+ ? alpha(tertiary.main, 0.7)
16
+ : alpha(primary.main, 0.7)
20
17
  return {
21
18
  rubberBand: {
22
19
  height: '100%',
@@ -32,9 +29,7 @@ const useStyles = makeStyles(theme => {
32
29
  minHeight: 8,
33
30
  },
34
31
  rubberBandText: {
35
- color: theme.palette.tertiary
36
- ? theme.palette.tertiary.contrastText
37
- : theme.palette.primary.contrastText,
32
+ color: tertiary ? tertiary.contrastText : primary.contrastText,
38
33
  },
39
34
  popover: {
40
35
  mouseEvents: 'none',
@@ -56,7 +51,7 @@ const useStyles = makeStyles(theme => {
56
51
 
57
52
  const VerticalGuide = observer(
58
53
  ({ model, coordX }: { model: LGV; coordX: number }) => {
59
- const classes = useStyles()
54
+ const { classes } = useStyles()
60
55
  return (
61
56
  <Tooltip
62
57
  open
@@ -93,10 +88,10 @@ function RubberBand({
93
88
  clientX: number
94
89
  clientY: number
95
90
  }>()
96
- const [guideX, setGuideX] = useState<number | undefined>()
91
+ const [guideX, setGuideX] = useState<number>()
97
92
  const controlsRef = useRef<HTMLDivElement>(null)
98
93
  const rubberBandRef = useRef(null)
99
- const classes = useStyles()
94
+ const { classes } = useStyles()
100
95
  const mouseDragging = startX !== undefined && anchorPosition === undefined
101
96
 
102
97
  const { setOffsets, pxToBp } = model
@@ -1,17 +1,11 @@
1
- import { makeStyles } from '@material-ui/core/styles'
1
+ import { makeStyles } from 'tss-react/mui'
2
2
  import { observer } from 'mobx-react'
3
3
  import ReactPropTypes from 'prop-types'
4
4
  import React from 'react'
5
5
  import { makeTicks } from '../util'
6
+ import { getTickDisplayStr } from '@jbrowse/core/util'
6
7
 
7
- function mathPower(num: number): string {
8
- if (num < 999) {
9
- return String(num)
10
- }
11
- return `${mathPower(~~(num / 1000))},${`00${~~(num % 1000)}`.substr(-3, 3)}`
12
- }
13
-
14
- const useStyles = makeStyles((/* theme */) => ({
8
+ const useStyles = makeStyles()((/* theme */) => ({
15
9
  majorTickLabel: {
16
10
  fontSize: '11px',
17
11
  // fill: theme.palette.text.primary,
@@ -41,7 +35,7 @@ function Ruler({
41
35
  major: boolean
42
36
  minor: boolean
43
37
  }) {
44
- const classes = useStyles()
38
+ const { classes } = useStyles()
45
39
  const ticks = makeTicks(start, end, bpPerPx, major, minor)
46
40
  return (
47
41
  <>
@@ -75,7 +69,7 @@ function Ruler({
75
69
  style={{ fontSize: '11px' }}
76
70
  className={classes.majorTickLabel}
77
71
  >
78
- {mathPower(tick.base + 1)}
72
+ {getTickDisplayStr(tick.base + 1, bpPerPx)}
79
73
  </text>
80
74
  )
81
75
  })}
@@ -1,10 +1,10 @@
1
- import { Paper, Typography, makeStyles } from '@material-ui/core'
1
+ import { Paper, Typography } from '@mui/material'
2
+ import { makeStyles } from 'tss-react/mui'
2
3
  import {
3
4
  ContentBlock,
4
5
  ElidedBlock,
5
6
  InterRegionPaddingBlock,
6
7
  } from '@jbrowse/core/util/blockTypes'
7
- import clsx from 'clsx'
8
8
  import { observer } from 'mobx-react'
9
9
  import React from 'react'
10
10
  import { LinearGenomeViewModel } from '..'
@@ -14,10 +14,11 @@ import {
14
14
  InterRegionPaddingBlock as InterRegionPaddingBlockComponent,
15
15
  } from '../../BaseLinearDisplay/components/Block'
16
16
  import { makeTicks } from '../util'
17
+ import { getTickDisplayStr } from '@jbrowse/core/util'
17
18
 
18
19
  type LGV = LinearGenomeViewModel
19
20
 
20
- const useStyles = makeStyles(theme => ({
21
+ const useStyles = makeStyles()(theme => ({
21
22
  scaleBarContainer: {
22
23
  overflow: 'hidden',
23
24
  position: 'relative',
@@ -59,7 +60,7 @@ const useStyles = makeStyles(theme => ({
59
60
  }))
60
61
 
61
62
  const RenderedRefNameLabels = observer(({ model }: { model: LGV }) => {
62
- const classes = useStyles()
63
+ const { classes } = useStyles()
63
64
 
64
65
  // find the block that needs pinning to the left side for context
65
66
  let lastLeftBlock = 0
@@ -94,29 +95,23 @@ const RenderedRefNameLabels = observer(({ model }: { model: LGV }) => {
94
95
  })
95
96
 
96
97
  const RenderedScaleBarLabels = observer(({ model }: { model: LGV }) => {
97
- const classes = useStyles()
98
+ const { classes } = useStyles()
99
+ const { bpPerPx, staticBlocks } = model
98
100
 
99
101
  return (
100
102
  <>
101
- {model.staticBlocks.map((block, index) => {
103
+ {staticBlocks.map((block, index) => {
104
+ const { reversed, start, end, key, widthPx } = block
102
105
  if (block instanceof ContentBlock) {
103
- const ticks = makeTicks(
104
- block.start,
105
- block.end,
106
- model.bpPerPx,
107
- true,
108
- false,
109
- )
106
+ const ticks = makeTicks(start, end, bpPerPx, true, false)
110
107
 
111
108
  return (
112
- <ContentBlockComponent key={`${block.key}-${index}`} block={block}>
109
+ <ContentBlockComponent key={`${key}-${index}`} block={block}>
113
110
  {ticks.map(tick => {
114
111
  if (tick.type === 'major') {
115
112
  const x =
116
- (block.reversed
117
- ? block.end - tick.base
118
- : tick.base - block.start) / model.bpPerPx
119
- const baseNumber = (tick.base + 1).toLocaleString('en-US')
113
+ (reversed ? end - tick.base : tick.base - start) / bpPerPx
114
+ const baseNumber = tick.base + 1
120
115
  return (
121
116
  <div
122
117
  key={tick.base}
@@ -125,7 +120,7 @@ const RenderedScaleBarLabels = observer(({ model }: { model: LGV }) => {
125
120
  >
126
121
  {baseNumber ? (
127
122
  <Typography className={classes.majorTickLabel}>
128
- {baseNumber}
123
+ {getTickDisplayStr(baseNumber, bpPerPx)}
129
124
  </Typography>
130
125
  ) : null}
131
126
  </div>
@@ -137,13 +132,13 @@ const RenderedScaleBarLabels = observer(({ model }: { model: LGV }) => {
137
132
  )
138
133
  }
139
134
  if (block instanceof ElidedBlock) {
140
- return <ElidedBlockComponent key={block.key} width={block.widthPx} />
135
+ return <ElidedBlockComponent key={key} width={widthPx} />
141
136
  }
142
137
  if (block instanceof InterRegionPaddingBlock) {
143
138
  return (
144
139
  <InterRegionPaddingBlockComponent
145
- key={block.key}
146
- width={block.widthPx}
140
+ key={key}
141
+ width={widthPx}
147
142
  style={{ background: 'none' }}
148
143
  boundary={block.variant === 'boundary'}
149
144
  />
@@ -155,23 +150,21 @@ const RenderedScaleBarLabels = observer(({ model }: { model: LGV }) => {
155
150
  )
156
151
  })
157
152
 
158
- const ScaleBar = React.forwardRef(
159
- (
160
- {
161
- model,
162
- style,
163
- className,
164
- ...other
165
- }: { model: LGV; style?: React.CSSProperties; className?: string },
166
- ref,
167
- ) => {
168
- const classes = useStyles()
153
+ interface ScaleBarProps {
154
+ model: LGV
155
+ style?: React.CSSProperties
156
+ className?: string
157
+ }
158
+
159
+ const ScaleBar = React.forwardRef<HTMLDivElement, ScaleBarProps>(
160
+ ({ model, style, className, ...other }, ref) => {
161
+ const { classes, cx } = useStyles()
169
162
 
170
163
  const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx
171
164
  return (
172
165
  <Paper
173
166
  data-resizer="true" // used to avoid click-and-drag scrolls on trackscontainer
174
- className={clsx(classes.scaleBarContainer, className)}
167
+ className={cx(classes.scaleBarContainer, className)}
175
168
  variant="outlined"
176
169
  ref={ref}
177
170
  style={style}