@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
@@ -16,6 +16,8 @@ import {
16
16
  } from './Block'
17
17
  import { LinearGenomeViewModel } from '../../LinearGenomeView'
18
18
 
19
+ type LGV = LinearGenomeViewModel
20
+
19
21
  const useStyles = makeStyles()({
20
22
  linearBlocks: {
21
23
  whiteSpace: 'nowrap',
@@ -37,70 +39,72 @@ const useStyles = makeStyles()({
37
39
  boxSizing: 'border-box',
38
40
  },
39
41
  })
40
- const RenderedBlocks = observer(
41
- ({ model }: { model: BaseLinearDisplayModel }) => {
42
- const { classes } = useStyles()
43
- const { blockDefinitions, blockState } = model
44
- return (
45
- <>
46
- {blockDefinitions.map(block => {
47
- if (block instanceof ContentBlock) {
48
- const state = blockState.get(block.key)
49
42
 
50
- return (
51
- <ContentBlockComponent
52
- block={block}
53
- key={`${model.id}-${block.key}`}
54
- >
55
- {state && state.ReactComponent ? (
56
- <state.ReactComponent model={state} />
57
- ) : null}
58
- {state && state.maxHeightReached ? (
59
- <div
60
- className={classes.heightOverflowed}
61
- style={{
62
- top: state.layout.getTotalHeight() - 16,
63
- pointerEvents: 'none',
64
- height: 16,
65
- }}
66
- >
67
- Max height reached
68
- </div>
69
- ) : null}
70
- </ContentBlockComponent>
71
- )
72
- }
73
- if (block instanceof ElidedBlock) {
74
- return (
75
- <ElidedBlockComponent
76
- key={`${model.id}-${block.key}`}
77
- width={block.widthPx}
78
- />
79
- )
80
- }
81
- if (block instanceof InterRegionPaddingBlock) {
82
- return (
83
- <InterRegionPaddingBlockComponent
84
- key={block.key}
85
- width={block.widthPx}
86
- style={{ background: 'none' }}
87
- boundary={block.variant === 'boundary'}
88
- />
89
- )
90
- }
91
- throw new Error(`invalid block type ${typeof block}`)
92
- })}
93
- </>
94
- )
95
- },
96
- )
43
+ const RenderedBlocks = observer(function ({
44
+ model,
45
+ }: {
46
+ model: BaseLinearDisplayModel
47
+ }) {
48
+ const { classes } = useStyles()
49
+ const { blockDefinitions, blockState } = model
50
+ return (
51
+ <>
52
+ {blockDefinitions.map(block => {
53
+ if (block instanceof ContentBlock) {
54
+ const state = blockState.get(block.key)
55
+
56
+ return (
57
+ <ContentBlockComponent
58
+ block={block}
59
+ key={`${model.id}-${block.key}`}
60
+ >
61
+ {state && state.ReactComponent ? (
62
+ <state.ReactComponent model={state} />
63
+ ) : null}
64
+ {state && state.maxHeightReached ? (
65
+ <div
66
+ className={classes.heightOverflowed}
67
+ style={{
68
+ top: state.layout.getTotalHeight() - 16,
69
+ pointerEvents: 'none',
70
+ height: 16,
71
+ }}
72
+ >
73
+ Max height reached
74
+ </div>
75
+ ) : null}
76
+ </ContentBlockComponent>
77
+ )
78
+ }
79
+ if (block instanceof ElidedBlock) {
80
+ return (
81
+ <ElidedBlockComponent
82
+ key={`${model.id}-${block.key}`}
83
+ width={block.widthPx}
84
+ />
85
+ )
86
+ }
87
+ if (block instanceof InterRegionPaddingBlock) {
88
+ return (
89
+ <InterRegionPaddingBlockComponent
90
+ key={block.key}
91
+ width={block.widthPx}
92
+ style={{ background: 'none' }}
93
+ boundary={block.variant === 'boundary'}
94
+ />
95
+ )
96
+ }
97
+ throw new Error(`invalid block type ${typeof block}`)
98
+ })}
99
+ </>
100
+ )
101
+ })
97
102
  function LinearBlocks({ model }: { model: BaseLinearDisplayModel }) {
98
103
  const { classes } = useStyles()
99
104
  const { blockDefinitions } = model
100
- const viewModel = getContainingView(model) as LinearGenomeViewModel
105
+ const viewModel = getContainingView(model) as LGV
101
106
  return (
102
107
  <div
103
- data-testid="Blockset"
104
108
  className={classes.linearBlocks}
105
109
  style={{
106
110
  left: blockDefinitions.offsetPx - viewModel.offsetPx,
@@ -1,4 +1,4 @@
1
- export { baseLinearDisplayConfigSchema } from './models/baseLinearDisplayConfigSchema'
1
+ export { default as baseLinearDisplayConfigSchema } from './models/configSchema'
2
2
  export { BaseLinearDisplay } from './models/BaseLinearDisplayModel'
3
3
  export type { BlockModel } from './models/serverSideRenderedBlock'
4
4
  export type {
@@ -8,4 +8,5 @@ export type {
8
8
  export {
9
9
  default as BaseLinearDisplayComponent,
10
10
  Tooltip,
11
+ BlockMsg,
11
12
  } from './components/BaseLinearDisplay'
@@ -11,12 +11,13 @@ import {
11
11
  getViewParams,
12
12
  isSelectionContainer,
13
13
  isSessionModelWithWidgets,
14
+ isFeature,
15
+ Feature,
14
16
  } from '@jbrowse/core/util'
15
17
  import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
16
18
  import { BaseBlock } from '@jbrowse/core/util/blockTypes'
17
19
  import { Region } from '@jbrowse/core/util/types'
18
20
  import CompositeMap from '@jbrowse/core/util/compositeMap'
19
- import { Feature, isFeature } from '@jbrowse/core/util/simpleFeature'
20
21
  import {
21
22
  getParentRenderProps,
22
23
  getRpcSessionId,
@@ -28,9 +29,9 @@ import { addDisposer, isAlive, types, Instance } from 'mobx-state-tree'
28
29
  import MenuOpenIcon from '@mui/icons-material/MenuOpen'
29
30
 
30
31
  // locals
31
- import TooLargeMessage from './TooLargeMessage'
32
32
  import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
33
33
  import { Tooltip } from '../components/BaseLinearDisplay'
34
+ import TooLargeMessage from '../components/TooLargeMessage'
34
35
  import BlockState, { renderBlockData } from './serverSideRenderedBlock'
35
36
 
36
37
  type LGV = LinearGenomeViewModel
@@ -104,10 +105,10 @@ function stateModelFactory() {
104
105
  )
105
106
  .volatile(() => ({
106
107
  currBpPerPx: 0,
108
+ scrollTop: 0,
107
109
  message: '',
108
110
  featureIdUnderMouse: undefined as undefined | string,
109
111
  contextMenuFeature: undefined as undefined | Feature,
110
- scrollTop: 0,
111
112
  estimatedRegionStatsP: undefined as undefined | Promise<Stats>,
112
113
  estimatedRegionStats: undefined as undefined | Stats,
113
114
  }))
@@ -2,13 +2,13 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
2
 
3
3
  /**
4
4
  * #config BaseLinearDisplay
5
- * BaseLinearDisplay is a "base" config that is extended by classes like
6
- * "LinearBasicDisplay" (used for feature tracks, etc) and "LinearBareDisplay"
5
+ * `BaseLinearDisplay` is a "base" config that is extended by classes like
6
+ * `LinearBasicDisplay` (used for feature tracks, etc) and `LinearBareDisplay`
7
7
  * (more stripped down than even the basic display, not commonly used)
8
8
  */
9
9
  function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
10
10
 
11
- export const baseLinearDisplayConfigSchema = ConfigurationSchema(
11
+ const baseLinearDisplayConfigSchema = ConfigurationSchema(
12
12
  'BaseLinearDisplay',
13
13
  {
14
14
  /**
@@ -37,3 +37,5 @@ export const baseLinearDisplayConfigSchema = ConfigurationSchema(
37
37
  explicitIdentifier: 'displayId',
38
38
  },
39
39
  )
40
+
41
+ export default baseLinearDisplayConfigSchema
@@ -173,7 +173,7 @@ const blockState = types
173
173
  const { rpcManager } = getSession(self)
174
174
  const { rendererType } = display
175
175
  const { renderArgs } = renderBlockData(cast(self))
176
- // renderArgs can be undefined if an error occured in this block
176
+ // renderArgs can be undefined if an error occurred in this block
177
177
  if (renderArgs) {
178
178
  rendererType
179
179
  .freeResourcesInClient(
@@ -0,0 +1,24 @@
1
+ export interface RenderProps {
2
+ rendererType: any // eslint-disable-line @typescript-eslint/no-explicit-any
3
+ renderArgs: { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any
4
+ renderProps: { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any
5
+ displayError: unknown
6
+ rpcManager: { call: Function }
7
+ cannotBeRenderedReason: string
8
+ }
9
+
10
+ export interface ErrorProps {
11
+ displayError: string
12
+ }
13
+
14
+ export function getDisplayStr(totalBytes: number) {
15
+ let displayBp
16
+ if (Math.floor(totalBytes / 1000000) > 0) {
17
+ displayBp = `${parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
18
+ } else if (Math.floor(totalBytes / 1000) > 0) {
19
+ displayBp = `${parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
20
+ } else {
21
+ displayBp = `${Math.floor(totalBytes)} bytes`
22
+ }
23
+ return displayBp
24
+ }
@@ -5,17 +5,14 @@ import {
5
5
  import PluginManager from '@jbrowse/core/PluginManager'
6
6
  import configSchemaF from './configSchema'
7
7
 
8
- export default (pluginManager: PluginManager) => {
9
- pluginManager.addTrackType(() => {
10
- const configSchema = configSchemaF(pluginManager)
8
+ export default (pm: PluginManager) => {
9
+ pm.addTrackType(() => {
10
+ const configSchema = configSchemaF(pm)
11
11
  return new TrackType({
12
12
  name: 'FeatureTrack',
13
+ displayName: 'Feature track',
13
14
  configSchema,
14
- stateModel: createBaseTrackModel(
15
- pluginManager,
16
- 'FeatureTrack',
17
- configSchema,
18
- ),
15
+ stateModel: createBaseTrackModel(pm, 'FeatureTrack', configSchema),
19
16
  })
20
17
  })
21
18
  }
@@ -0,0 +1,66 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { AbstractSessionModel, when } from '@jbrowse/core/util'
3
+ import { LinearGenomeViewModel } from '../LinearGenomeView'
4
+
5
+ type LGV = LinearGenomeViewModel
6
+
7
+ export default (pluginManager: PluginManager) => {
8
+ pluginManager.addToExtensionPoint(
9
+ 'LaunchView-LinearGenomeView',
10
+ // @ts-ignore
11
+ async ({
12
+ session,
13
+ assembly,
14
+ loc,
15
+ tracks = [],
16
+ }: {
17
+ session: AbstractSessionModel
18
+ assembly?: string
19
+ loc: string
20
+ tracks?: string[]
21
+ }) => {
22
+ try {
23
+ const { assemblyManager } = session
24
+ const view = session.addView('LinearGenomeView', {}) as LGV
25
+
26
+ await when(() => !!view.volatileWidth)
27
+
28
+ if (!assembly) {
29
+ throw new Error(
30
+ 'No assembly provided when launching linear genome view',
31
+ )
32
+ }
33
+
34
+ const asm = await assemblyManager.waitForAssembly(assembly)
35
+ if (!asm) {
36
+ throw new Error(
37
+ `Assembly "${assembly}" not found when launching linear genome view`,
38
+ )
39
+ }
40
+
41
+ await view.navToLocString(loc, assembly)
42
+
43
+ const idsNotFound = [] as string[]
44
+ tracks.forEach(track => {
45
+ try {
46
+ view.showTrack(track)
47
+ } catch (e) {
48
+ if (`${e}`.match('Could not resolve identifier')) {
49
+ idsNotFound.push(track)
50
+ } else {
51
+ throw e
52
+ }
53
+ }
54
+ })
55
+ if (idsNotFound.length) {
56
+ throw new Error(
57
+ `Could not resolve identifiers: ${idsNotFound.join(',')}`,
58
+ )
59
+ }
60
+ } catch (e) {
61
+ session.notify(`${e}`, 'error')
62
+ throw e
63
+ }
64
+ },
65
+ )
66
+ }
@@ -1,2 +1,23 @@
1
- export { configSchemaFactory } from './configSchema'
2
- export { stateModelFactory } from './model'
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
3
+
4
+ // locals
5
+ import { configSchemaFactory } from './configSchema'
6
+ import { stateModelFactory } from './model'
7
+ import { BaseLinearDisplayComponent } from '../BaseLinearDisplay/'
8
+
9
+ export default (pluginManager: PluginManager) => {
10
+ pluginManager.addDisplayType(() => {
11
+ const configSchema = configSchemaFactory(pluginManager)
12
+ return new DisplayType({
13
+ name: 'LinearBareDisplay',
14
+ configSchema,
15
+ stateModel: stateModelFactory(configSchema),
16
+ trackType: 'BasicTrack',
17
+ viewType: 'LinearGenomeView',
18
+ ReactComponent: BaseLinearDisplayComponent,
19
+ })
20
+ })
21
+ }
22
+
23
+ export { configSchemaFactory, stateModelFactory }
@@ -1,29 +1,20 @@
1
1
  import React, { useState } from 'react'
2
2
  import { observer } from 'mobx-react'
3
+ import { Dialog } from '@jbrowse/core/ui'
3
4
  import {
4
5
  Button,
5
- Dialog,
6
6
  DialogActions,
7
7
  DialogContent,
8
- DialogTitle,
9
- IconButton,
10
8
  Typography,
11
9
  TextField,
12
10
  } from '@mui/material'
13
11
  import { makeStyles } from 'tss-react/mui'
14
12
 
15
- import CloseIcon from '@mui/icons-material/Close'
16
-
17
13
  const useStyles = makeStyles()(theme => ({
18
14
  root: {
19
15
  width: 500,
20
16
  },
21
- closeButton: {
22
- position: 'absolute',
23
- right: theme.spacing(1),
24
- top: theme.spacing(1),
25
- color: theme.palette.grey[500],
26
- },
17
+
27
18
  field: {
28
19
  margin: theme.spacing(2),
29
20
  },
@@ -44,23 +35,7 @@ function SetMaxHeightDlg({
44
35
  const [max, setMax] = useState(`${maxHeight}`)
45
36
 
46
37
  return (
47
- <Dialog
48
- open
49
- onClose={handleClose}
50
- aria-labelledby="alert-dialog-title"
51
- aria-describedby="alert-dialog-description"
52
- >
53
- <DialogTitle id="alert-dialog-title">
54
- Filter options
55
- <IconButton
56
- aria-label="close"
57
- className={classes.closeButton}
58
- onClick={handleClose}
59
- size="large"
60
- >
61
- <CloseIcon />
62
- </IconButton>
63
- </DialogTitle>
38
+ <Dialog open onClose={handleClose} title="Set max height">
64
39
  <DialogContent className={classes.root}>
65
40
  <Typography>
66
41
  Set max height for the track. For example, you can increase this if
@@ -1,2 +1,24 @@
1
- export { default as modelFactory } from './model'
2
- export { default as configSchema } from './configSchema'
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
3
+ import { BaseLinearDisplayComponent } from '../BaseLinearDisplay'
4
+
5
+ // locals
6
+ import configSchema from './configSchema'
7
+ import modelFactory from './model'
8
+
9
+ export default (pluginManager: PluginManager) => {
10
+ pluginManager.addDisplayType(() => {
11
+ const config = configSchema(pluginManager)
12
+ return new DisplayType({
13
+ name: 'LinearBasicDisplay',
14
+ displayName: 'Basic deature display',
15
+ configSchema: config,
16
+ stateModel: modelFactory(config),
17
+ trackType: 'FeatureTrack',
18
+ viewType: 'LinearGenomeView',
19
+ ReactComponent: BaseLinearDisplayComponent,
20
+ })
21
+ })
22
+ }
23
+
24
+ export { modelFactory, configSchema }
@@ -18,7 +18,8 @@ const SetMaxHeightDlg = lazy(() => import('./components/SetMaxHeight'))
18
18
 
19
19
  /**
20
20
  * #stateModel LinearBasicDisplay
21
- * used by `FeatureTrack`, has simple settings like "show/hide feature labels", etc.
21
+ * used by `FeatureTrack`, has simple settings like "show/hide feature labels",
22
+ * etc.
22
23
  */
23
24
  function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
24
25
  return types
@@ -1,6 +1,7 @@
1
1
  # Key LinearGenomeView state fields
2
2
 
3
- - displayedRegions - array of { refName, start, end }, tiled in the display left to right
3
+ - displayedRegions - array of { refName, start, end }, tiled in the display left
4
+ to right
4
5
  - offsetPx - the offset in px of the left edge of the view
5
6
  - bpPerPx - ratio of basepairs to screen pixels
6
7
  - width - width in px of the view
@@ -1,31 +1,17 @@
1
1
  import React, { useState } from 'react'
2
- import { makeStyles } from 'tss-react/mui'
3
2
  import {
4
3
  Button,
5
4
  Checkbox,
6
5
  CircularProgress,
7
- Dialog,
8
6
  DialogActions,
9
7
  DialogContent,
10
- DialogTitle,
11
8
  FormControlLabel,
12
- IconButton,
13
9
  TextField,
14
10
  Typography,
15
11
  } from '@mui/material'
16
- import { ErrorMessage } from '@jbrowse/core/ui'
17
- import CloseIcon from '@mui/icons-material/Close'
12
+ import { Dialog, ErrorMessage } from '@jbrowse/core/ui'
18
13
  import { ExportSvgOptions } from '..'
19
14
 
20
- const useStyles = makeStyles()(theme => ({
21
- closeButton: {
22
- position: 'absolute',
23
- right: theme.spacing(1),
24
- top: theme.spacing(1),
25
- color: theme.palette.grey[500],
26
- },
27
- }))
28
-
29
15
  function LoadingMessage() {
30
16
  return (
31
17
  <div>
@@ -48,15 +34,8 @@ export default function ExportSvgDlg({
48
34
  const [loading, setLoading] = useState(false)
49
35
  const [filename, setFilename] = useState('jbrowse.svg')
50
36
  const [error, setError] = useState<unknown>()
51
- const { classes } = useStyles()
52
37
  return (
53
- <Dialog open onClose={handleClose}>
54
- <DialogTitle>
55
- Export SVG
56
- <IconButton className={classes.closeButton} onClick={handleClose}>
57
- <CloseIcon />
58
- </IconButton>
59
- </DialogTitle>
38
+ <Dialog open onClose={handleClose} title="Export SVG">
60
39
  <DialogContent>
61
40
  {error ? (
62
41
  <ErrorMessage error={error} />
@@ -4,12 +4,8 @@ import {
4
4
  Button,
5
5
  CircularProgress,
6
6
  Container,
7
- Dialog,
8
7
  DialogActions,
9
8
  DialogContent,
10
- DialogTitle,
11
- Divider,
12
- IconButton,
13
9
  TextField,
14
10
  Typography,
15
11
  } from '@mui/material'
@@ -17,31 +13,25 @@ import { observer } from 'mobx-react'
17
13
  import { saveAs } from 'file-saver'
18
14
  import { getConf } from '@jbrowse/core/configuration'
19
15
  import copy from 'copy-to-clipboard'
16
+ import { Dialog } from '@jbrowse/core/ui'
20
17
  import { getSession, Feature, Region } from '@jbrowse/core/util'
21
18
  import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings'
22
19
 
23
20
  // icons
24
21
  import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons'
25
- import CloseIcon from '@mui/icons-material/Close'
26
22
  import GetAppIcon from '@mui/icons-material/GetApp'
27
23
 
28
24
  // locals
29
25
  import { LinearGenomeViewModel } from '..'
30
26
 
31
- const useStyles = makeStyles()(theme => ({
32
- closeButton: {
33
- position: 'absolute',
34
- right: theme.spacing(1),
35
- top: theme.spacing(1),
36
- color: theme.palette.grey[500],
37
- },
27
+ const useStyles = makeStyles()({
38
28
  dialogContent: {
39
29
  width: '80em',
40
30
  },
41
31
  textAreaFont: {
42
32
  fontFamily: 'Courier New',
43
33
  },
44
- }))
34
+ })
45
35
 
46
36
  type LGV = LinearGenomeViewModel
47
37
 
@@ -106,6 +96,7 @@ function SequenceDialog({
106
96
  let active = true
107
97
  const controller = new AbortController()
108
98
 
99
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
109
100
  ;(async () => {
110
101
  try {
111
102
  if (regionsSelected.length > 0) {
@@ -157,24 +148,15 @@ function SequenceDialog({
157
148
  const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false
158
149
 
159
150
  return (
160
- <Dialog maxWidth="xl" open onClose={handleClose}>
161
- <DialogTitle>
162
- Reference sequence
163
- {handleClose ? (
164
- <IconButton
165
- className={classes.closeButton}
166
- onClick={() => {
167
- handleClose()
168
- model.setOffsets(undefined, undefined)
169
- }}
170
- size="large"
171
- >
172
- <CloseIcon />
173
- </IconButton>
174
- ) : null}
175
- </DialogTitle>
176
- <Divider />
177
-
151
+ <Dialog
152
+ maxWidth="xl"
153
+ open
154
+ onClose={() => {
155
+ handleClose()
156
+ model.setOffsets(undefined, undefined)
157
+ }}
158
+ title="Reference sequence"
159
+ >
178
160
  <DialogContent>
179
161
  {error ? <Typography color="error">{`${error}`}</Typography> : null}
180
162
  {loading && !error ? (
@@ -16,7 +16,7 @@ import {
16
16
  SPACING,
17
17
  HEADER_BAR_HEIGHT,
18
18
  } from '..'
19
- import OverviewScaleBar from './OverviewScaleBar'
19
+ import OverviewScalebar from './OverviewScalebar'
20
20
  import ZoomControls from './ZoomControls'
21
21
  import SearchBox from './SearchBox'
22
22
 
@@ -123,9 +123,9 @@ const LinearGenomeViewHeader = observer(({ model }: { model: LGV }) => {
123
123
  model.hideHeaderOverview ? (
124
124
  <Controls model={model} />
125
125
  ) : (
126
- <OverviewScaleBar model={model}>
126
+ <OverviewScalebar model={model}>
127
127
  <Controls model={model} />
128
- </OverviewScaleBar>
128
+ </OverviewScalebar>
129
129
  )
130
130
  ) : null
131
131
  })