@jbrowse/plugin-linear-genome-view 2.4.2 → 2.6.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 (326) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
  2. package/dist/BaseLinearDisplay/components/Block.d.ts +3 -3
  3. package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +1 -1
  4. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +3 -3
  5. package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +5 -5
  6. package/dist/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
  7. package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  8. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +2 -2
  9. package/dist/BaseLinearDisplay/index.d.ts +5 -2
  10. package/dist/BaseLinearDisplay/index.js +7 -1
  11. package/dist/BaseLinearDisplay/index.js.map +1 -1
  12. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +107 -126
  13. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +37 -352
  14. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  15. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +99 -0
  16. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +190 -0
  17. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js.map +1 -0
  18. package/dist/BaseLinearDisplay/models/TrackHeightMixin.d.ts +30 -0
  19. package/dist/BaseLinearDisplay/models/TrackHeightMixin.js +56 -0
  20. package/dist/BaseLinearDisplay/models/TrackHeightMixin.js.map +1 -0
  21. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +2 -0
  22. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js +42 -0
  23. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js.map +1 -0
  24. package/dist/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  25. package/dist/BaseLinearDisplay/models/configSchema.js +10 -0
  26. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
  27. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +8 -0
  28. package/dist/BaseLinearDisplay/models/renderSvg.js +83 -0
  29. package/dist/BaseLinearDisplay/models/renderSvg.js.map +1 -0
  30. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +30 -22
  31. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  32. package/dist/BaseLinearDisplay/models/util.d.ts +6 -2
  33. package/dist/BaseLinearDisplay/models/util.js +4 -4
  34. package/dist/BaseLinearDisplay/models/util.js.map +1 -1
  35. package/dist/BasicTrack/configSchema.d.ts +73 -1
  36. package/dist/BasicTrack/configSchema.js +1 -0
  37. package/dist/BasicTrack/configSchema.js.map +1 -1
  38. package/dist/FeatureTrack/configSchema.d.ts +73 -1
  39. package/dist/FeatureTrack/configSchema.js +1 -0
  40. package/dist/FeatureTrack/configSchema.js.map +1 -1
  41. package/dist/LinearBareDisplay/configSchema.d.ts +29 -1
  42. package/dist/LinearBareDisplay/configSchema.js +1 -0
  43. package/dist/LinearBareDisplay/configSchema.js.map +1 -1
  44. package/dist/LinearBareDisplay/model.d.ts +106 -42
  45. package/dist/LinearBareDisplay/model.js +3 -2
  46. package/dist/LinearBareDisplay/model.js.map +1 -1
  47. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +2 -2
  48. package/dist/LinearBasicDisplay/configSchema.d.ts +29 -1
  49. package/dist/LinearBasicDisplay/configSchema.js +1 -9
  50. package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
  51. package/dist/LinearBasicDisplay/model.d.ts +124 -62
  52. package/dist/LinearBasicDisplay/model.js +1 -0
  53. package/dist/LinearBasicDisplay/model.js.map +1 -1
  54. package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -2
  55. package/dist/LinearGenomeView/components/Cytobands.d.ts +24 -24
  56. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +2 -2
  57. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +2 -2
  58. package/dist/LinearGenomeView/components/GetSequenceDialog.js +14 -16
  59. package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  60. package/dist/LinearGenomeView/components/Gridlines.d.ts +2 -2
  61. package/dist/LinearGenomeView/components/Header.d.ts +2 -2
  62. package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
  63. package/dist/LinearGenomeView/components/ImportForm.js +4 -7
  64. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  65. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +2 -2
  66. package/dist/LinearGenomeView/components/LinearGenomeView.js +28 -8
  67. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  68. package/dist/LinearGenomeView/components/MiniControls.d.ts +3 -3
  69. package/dist/LinearGenomeView/components/MiniControls.js +20 -40
  70. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
  71. package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
  72. package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
  73. package/dist/LinearGenomeView/components/OverviewScalebar.js +12 -5
  74. package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  75. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +10 -0
  76. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +22 -0
  77. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js.map +1 -0
  78. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +5 -0
  79. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +52 -0
  80. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js.map +1 -0
  81. package/dist/LinearGenomeView/components/{HelpDialog.d.ts → RefNameAutocomplete/HelpDialog.d.ts} +2 -2
  82. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js.map +1 -0
  83. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +18 -0
  84. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +111 -0
  85. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js.map +1 -0
  86. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +12 -0
  87. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js +59 -0
  88. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js.map +1 -0
  89. package/dist/LinearGenomeView/components/Rubberband.d.ts +1 -1
  90. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
  91. package/dist/LinearGenomeView/components/SearchBox.d.ts +2 -2
  92. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -4
  93. package/dist/LinearGenomeView/components/SearchResultsDialog.js +6 -82
  94. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  95. package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +9 -0
  96. package/dist/LinearGenomeView/components/SearchResultsTable.js +83 -0
  97. package/dist/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  98. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  99. package/dist/LinearGenomeView/components/TrackContainer.d.ts +3 -4
  100. package/dist/LinearGenomeView/components/TrackContainer.js +17 -67
  101. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
  102. package/dist/LinearGenomeView/components/TrackLabel.js +6 -10
  103. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
  104. package/dist/LinearGenomeView/components/TrackLabelContainer.d.ts +9 -0
  105. package/dist/LinearGenomeView/components/TrackLabelContainer.js +32 -0
  106. package/dist/LinearGenomeView/components/TrackLabelContainer.js.map +1 -0
  107. package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +10 -0
  108. package/dist/LinearGenomeView/components/TrackRenderingContainer.js +74 -0
  109. package/dist/LinearGenomeView/components/TrackRenderingContainer.js.map +1 -0
  110. package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  111. package/dist/LinearGenomeView/components/TracksContainer.js +5 -7
  112. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  113. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +2 -2
  114. package/dist/LinearGenomeView/components/ZoomControls.d.ts +2 -2
  115. package/dist/LinearGenomeView/components/util.js +1 -1
  116. package/dist/LinearGenomeView/components/util.js.map +1 -1
  117. package/dist/LinearGenomeView/model.d.ts +51 -37
  118. package/dist/LinearGenomeView/model.js +132 -209
  119. package/dist/LinearGenomeView/model.js.map +1 -1
  120. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +2 -2
  121. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +3 -5
  122. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +7 -2
  123. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -1
  124. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
  125. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -1
  126. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +2 -2
  127. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +2 -2
  128. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +2 -2
  129. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +2 -2
  130. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +2 -2
  131. package/dist/LinearGenomeView/util.d.ts +29 -0
  132. package/dist/LinearGenomeView/util.js +79 -1
  133. package/dist/LinearGenomeView/util.js.map +1 -1
  134. package/dist/index.d.ts +325 -180
  135. package/dist/index.js +6 -3
  136. package/dist/index.js.map +1 -1
  137. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
  138. package/esm/BaseLinearDisplay/components/Block.d.ts +3 -3
  139. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +1 -1
  140. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +3 -3
  141. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +5 -5
  142. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
  143. package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  144. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +2 -2
  145. package/esm/BaseLinearDisplay/index.d.ts +5 -2
  146. package/esm/BaseLinearDisplay/index.js +3 -0
  147. package/esm/BaseLinearDisplay/index.js.map +1 -1
  148. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +107 -126
  149. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +39 -331
  150. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  151. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +99 -0
  152. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +184 -0
  153. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js.map +1 -0
  154. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +30 -0
  155. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +53 -0
  156. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js.map +1 -0
  157. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +2 -0
  158. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +39 -0
  159. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js.map +1 -0
  160. package/esm/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  161. package/esm/BaseLinearDisplay/models/configSchema.js +10 -0
  162. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
  163. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +8 -0
  164. package/esm/BaseLinearDisplay/models/renderSvg.js +54 -0
  165. package/esm/BaseLinearDisplay/models/renderSvg.js.map +1 -0
  166. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +30 -22
  167. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  168. package/esm/BaseLinearDisplay/models/util.d.ts +6 -2
  169. package/esm/BaseLinearDisplay/models/util.js +2 -2
  170. package/esm/BaseLinearDisplay/models/util.js.map +1 -1
  171. package/esm/BasicTrack/configSchema.d.ts +73 -1
  172. package/esm/BasicTrack/configSchema.js +1 -0
  173. package/esm/BasicTrack/configSchema.js.map +1 -1
  174. package/esm/FeatureTrack/configSchema.d.ts +73 -1
  175. package/esm/FeatureTrack/configSchema.js +1 -0
  176. package/esm/FeatureTrack/configSchema.js.map +1 -1
  177. package/esm/LinearBareDisplay/configSchema.d.ts +29 -1
  178. package/esm/LinearBareDisplay/configSchema.js +1 -0
  179. package/esm/LinearBareDisplay/configSchema.js.map +1 -1
  180. package/esm/LinearBareDisplay/model.d.ts +106 -42
  181. package/esm/LinearBareDisplay/model.js +2 -1
  182. package/esm/LinearBareDisplay/model.js.map +1 -1
  183. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +2 -2
  184. package/esm/LinearBasicDisplay/configSchema.d.ts +29 -1
  185. package/esm/LinearBasicDisplay/configSchema.js +1 -9
  186. package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
  187. package/esm/LinearBasicDisplay/model.d.ts +124 -62
  188. package/esm/LinearBasicDisplay/model.js +1 -0
  189. package/esm/LinearBasicDisplay/model.js.map +1 -1
  190. package/esm/LinearGenomeView/components/CenterLine.d.ts +2 -2
  191. package/esm/LinearGenomeView/components/Cytobands.d.ts +24 -24
  192. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +2 -2
  193. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +2 -2
  194. package/esm/LinearGenomeView/components/GetSequenceDialog.js +15 -17
  195. package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  196. package/esm/LinearGenomeView/components/Gridlines.d.ts +2 -2
  197. package/esm/LinearGenomeView/components/Header.d.ts +2 -2
  198. package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
  199. package/esm/LinearGenomeView/components/ImportForm.js +5 -8
  200. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  201. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +2 -2
  202. package/esm/LinearGenomeView/components/LinearGenomeView.js +4 -7
  203. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  204. package/esm/LinearGenomeView/components/MiniControls.d.ts +3 -3
  205. package/esm/LinearGenomeView/components/MiniControls.js +20 -17
  206. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
  207. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
  208. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
  209. package/esm/LinearGenomeView/components/OverviewScalebar.js +12 -5
  210. package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  211. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +10 -0
  212. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +16 -0
  213. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js.map +1 -0
  214. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +5 -0
  215. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +23 -0
  216. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js.map +1 -0
  217. package/esm/LinearGenomeView/components/{HelpDialog.d.ts → RefNameAutocomplete/HelpDialog.d.ts} +2 -2
  218. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js.map +1 -0
  219. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +18 -0
  220. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +83 -0
  221. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js.map +1 -0
  222. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +12 -0
  223. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +50 -0
  224. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js.map +1 -0
  225. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  226. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
  227. package/esm/LinearGenomeView/components/SearchBox.d.ts +2 -2
  228. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -4
  229. package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -83
  230. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  231. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +9 -0
  232. package/esm/LinearGenomeView/components/SearchResultsTable.js +77 -0
  233. package/esm/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  234. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  235. package/esm/LinearGenomeView/components/TrackContainer.d.ts +3 -4
  236. package/esm/LinearGenomeView/components/TrackContainer.js +18 -68
  237. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
  238. package/esm/LinearGenomeView/components/TrackLabel.js +6 -10
  239. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
  240. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +9 -0
  241. package/esm/LinearGenomeView/components/TrackLabelContainer.js +27 -0
  242. package/esm/LinearGenomeView/components/TrackLabelContainer.js.map +1 -0
  243. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +10 -0
  244. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +49 -0
  245. package/esm/LinearGenomeView/components/TrackRenderingContainer.js.map +1 -0
  246. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  247. package/esm/LinearGenomeView/components/TracksContainer.js +5 -7
  248. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  249. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -2
  250. package/esm/LinearGenomeView/components/ZoomControls.d.ts +2 -2
  251. package/esm/LinearGenomeView/components/util.js +1 -1
  252. package/esm/LinearGenomeView/components/util.js.map +1 -1
  253. package/esm/LinearGenomeView/model.d.ts +51 -37
  254. package/esm/LinearGenomeView/model.js +129 -206
  255. package/esm/LinearGenomeView/model.js.map +1 -1
  256. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +2 -2
  257. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +3 -5
  258. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +7 -2
  259. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -1
  260. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
  261. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -1
  262. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +2 -2
  263. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +2 -2
  264. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +2 -2
  265. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +2 -2
  266. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +2 -2
  267. package/esm/LinearGenomeView/util.d.ts +29 -0
  268. package/esm/LinearGenomeView/util.js +76 -0
  269. package/esm/LinearGenomeView/util.js.map +1 -1
  270. package/esm/index.d.ts +325 -180
  271. package/esm/index.js +1 -1
  272. package/esm/index.js.map +1 -1
  273. package/package.json +3 -3
  274. package/src/BaseLinearDisplay/components/TooLargeMessage.tsx +10 -6
  275. package/src/BaseLinearDisplay/index.ts +5 -1
  276. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +50 -401
  277. package/src/BaseLinearDisplay/models/FeatureDensityMixin.tsx +213 -0
  278. package/src/BaseLinearDisplay/models/TrackHeightMixin.tsx +59 -0
  279. package/src/BaseLinearDisplay/models/autorunFeatureDensityStats.ts +46 -0
  280. package/src/BaseLinearDisplay/models/configSchema.ts +11 -0
  281. package/src/BaseLinearDisplay/models/renderSvg.tsx +101 -0
  282. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +40 -32
  283. package/src/BaseLinearDisplay/models/util.ts +10 -4
  284. package/src/BasicTrack/configSchema.ts +1 -0
  285. package/src/FeatureTrack/configSchema.ts +1 -0
  286. package/src/LinearBareDisplay/configSchema.ts +1 -0
  287. package/src/LinearBareDisplay/model.ts +2 -1
  288. package/src/LinearBasicDisplay/configSchema.ts +1 -10
  289. package/src/LinearBasicDisplay/model.ts +1 -0
  290. package/src/LinearGenomeView/components/GetSequenceDialog.tsx +15 -25
  291. package/src/LinearGenomeView/components/ImportForm.tsx +4 -14
  292. package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +3 -3
  293. package/src/LinearGenomeView/components/LinearGenomeView.tsx +6 -17
  294. package/src/LinearGenomeView/components/MiniControls.tsx +37 -38
  295. package/src/LinearGenomeView/components/OverviewScalebar.tsx +13 -6
  296. package/src/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.tsx +53 -0
  297. package/src/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.tsx +44 -0
  298. package/src/LinearGenomeView/components/RefNameAutocomplete/index.tsx +160 -0
  299. package/src/LinearGenomeView/components/RefNameAutocomplete/util.ts +65 -0
  300. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -112
  301. package/src/LinearGenomeView/components/SearchResultsTable.tsx +121 -0
  302. package/src/LinearGenomeView/components/TrackContainer.tsx +25 -104
  303. package/src/LinearGenomeView/components/TrackLabel.tsx +7 -27
  304. package/src/LinearGenomeView/components/TrackLabelContainer.tsx +48 -0
  305. package/src/LinearGenomeView/components/TrackRenderingContainer.tsx +96 -0
  306. package/src/LinearGenomeView/components/TracksContainer.tsx +9 -6
  307. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +14 -14
  308. package/src/LinearGenomeView/components/util.ts +2 -1
  309. package/src/LinearGenomeView/index.test.ts +10 -12
  310. package/src/LinearGenomeView/model.ts +175 -247
  311. package/src/LinearGenomeView/svgcomponents/SVGHeader.tsx +8 -6
  312. package/src/LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx +1 -1
  313. package/src/LinearGenomeView/util.ts +98 -0
  314. package/src/index.ts +11 -5
  315. package/dist/LinearGenomeView/components/HelpDialog.js.map +0 -1
  316. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +0 -23
  317. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +0 -182
  318. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +0 -1
  319. package/esm/LinearGenomeView/components/HelpDialog.js.map +0 -1
  320. package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +0 -23
  321. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +0 -154
  322. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +0 -1
  323. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +0 -279
  324. /package/dist/LinearGenomeView/components/{HelpDialog.js → RefNameAutocomplete/HelpDialog.js} +0 -0
  325. /package/esm/LinearGenomeView/components/{HelpDialog.js → RefNameAutocomplete/HelpDialog.js} +0 -0
  326. /package/src/LinearGenomeView/components/{HelpDialog.tsx → RefNameAutocomplete/HelpDialog.tsx} +0 -0
@@ -3,11 +3,11 @@ import { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration'
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'
4
4
  import { Region } from '@jbrowse/core/util/types'
5
5
  import { ElementId, Region as MUIRegion } from '@jbrowse/core/util/types/mst'
6
- import { MenuItem, ReturnToImportFormDialog } from '@jbrowse/core/ui'
6
+ import { MenuItem } from '@jbrowse/core/ui'
7
7
  import {
8
8
  assembleLocString,
9
9
  clamp,
10
- findLastIndex,
10
+ findLast,
11
11
  getContainingView,
12
12
  getSession,
13
13
  isViewContainer,
@@ -15,9 +15,9 @@ import {
15
15
  isSessionWithAddTracks,
16
16
  localStorageGetItem,
17
17
  measureText,
18
- parseLocString,
19
18
  springAnimate,
20
19
  sum,
20
+ ParsedLocString,
21
21
  } from '@jbrowse/core/util'
22
22
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
23
23
  import { BlockSet, BaseBlock } from '@jbrowse/core/util/blockTypes'
@@ -51,17 +51,22 @@ import PhotoCameraIcon from '@mui/icons-material/PhotoCamera'
51
51
  import ZoomInIcon from '@mui/icons-material/ZoomIn'
52
52
  import MenuOpenIcon from '@mui/icons-material/MenuOpen'
53
53
 
54
- // locals
55
- import { renderToSvg } from './svgcomponents/SVGLinearGenomeView'
56
-
57
- import ExportSvgDlg from './components/ExportSvgDialog'
58
54
  import MiniControls from './components/MiniControls'
59
55
  import Header from './components/Header'
56
+ import { generateLocations, parseLocStrings } from './util'
60
57
 
61
58
  // lazies
59
+ const ReturnToImportFormDialog = lazy(
60
+ () => import('@jbrowse/core/ui/ReturnToImportFormDialog'),
61
+ )
62
62
  const SequenceSearchDialog = lazy(
63
63
  () => import('./components/SequenceSearchDialog'),
64
64
  )
65
+ const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'))
66
+ const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog'))
67
+ const SearchResultsDialog = lazy(
68
+ () => import('./components/SearchResultsDialog'),
69
+ )
65
70
 
66
71
  export interface BpOffset {
67
72
  refName?: string
@@ -124,6 +129,7 @@ export const WIDGET_HEIGHT = 32
124
129
 
125
130
  /**
126
131
  * #stateModel LinearGenomeView
132
+ * #category view
127
133
  */
128
134
  export function stateModelFactory(pluginManager: PluginManager) {
129
135
  return types
@@ -198,7 +204,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
198
204
 
199
205
  /**
200
206
  * #property
201
- * how to display the track labels, can be "overlapping", "offset", or "hidden"
207
+ * how to display the track labels, can be "overlapping", "offset", or
208
+ * "hidden"
202
209
  */
203
210
  trackLabels: types.optional(
204
211
  types.string,
@@ -242,15 +249,11 @@ export function stateModelFactory(pluginManager: PluginManager) {
242
249
  // which is basically like an onLoad
243
250
  afterDisplayedRegionsSetCallbacks: [] as Function[],
244
251
  scaleFactor: 1,
245
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
- trackRefs: {} as { [key: string]: any },
252
+ trackRefs: {} as { [key: string]: HTMLDivElement },
247
253
  coarseDynamicBlocks: [] as BaseBlock[],
248
254
  coarseTotalBp: 0,
249
255
  leftOffset: undefined as undefined | BpOffset,
250
256
  rightOffset: undefined as undefined | BpOffset,
251
- searchResults: undefined as undefined | BaseResult[],
252
- searchQuery: undefined as undefined | string,
253
- seqDialogDisplayed: false,
254
257
  }))
255
258
  .views(self => ({
256
259
  /**
@@ -332,13 +335,6 @@ export function stateModelFactory(pluginManager: PluginManager) {
332
335
  return self.displayedRegions.length > 0
333
336
  },
334
337
 
335
- /**
336
- * #getter
337
- */
338
- get isSearchDialogDisplayed() {
339
- return self.searchResults !== undefined
340
- },
341
-
342
338
  /**
343
339
  * #getter
344
340
  */
@@ -605,7 +601,9 @@ export function stateModelFactory(pluginManager: PluginManager) {
605
601
 
606
602
  /**
607
603
  * #action
608
- * sets offsets used in the get sequence dialog
604
+ * sets offsets of rubberband, used in the get sequence dialog can call
605
+ * view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
606
+ * the selected regions from the offsets
609
607
  */
610
608
  setOffsets(left?: BpOffset, right?: BpOffset) {
611
609
  self.leftOffset = left
@@ -615,16 +613,21 @@ export function stateModelFactory(pluginManager: PluginManager) {
615
613
  /**
616
614
  * #action
617
615
  */
618
- setSearchResults(results?: BaseResult[], query?: string) {
619
- self.searchResults = results
620
- self.searchQuery = query
621
- },
622
-
623
- /**
624
- * #action
625
- */
626
- setGetSequenceDialogOpen(open: boolean) {
627
- self.seqDialogDisplayed = open
616
+ setSearchResults(
617
+ searchResults: BaseResult[],
618
+ searchQuery: string,
619
+ assemblyName?: string,
620
+ ) {
621
+ getSession(self).queueDialog(handleClose => [
622
+ SearchResultsDialog,
623
+ {
624
+ model: self as LinearGenomeViewModel,
625
+ searchResults,
626
+ searchQuery,
627
+ handleClose,
628
+ assemblyName,
629
+ },
630
+ ])
628
631
  },
629
632
 
630
633
  /**
@@ -797,10 +800,13 @@ export function stateModelFactory(pluginManager: PluginManager) {
797
800
  /**
798
801
  * #method
799
802
  * Helper method for the fetchSequence.
800
- * Retrieves the corresponding regions that were selected by the rubberband
803
+ * Retrieves the corresponding regions that were selected by the
804
+ * rubberband
801
805
  *
802
- * @param leftOffset - `object as {start, end, index, offset}`, offset = start of user drag
803
- * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
806
+ * @param leftOffset - `object as {start, end, index, offset}`, offset = start
807
+ * of user drag
808
+ * @param rightOffset - `object as {start, end, index, offset}`,
809
+ * offset = end of user drag
804
810
  * @returns array of Region[]
805
811
  */
806
812
  getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset) {
@@ -822,7 +828,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
822
828
 
823
829
  /**
824
830
  * #action
825
- * schedule something to be run after the next time displayedRegions is set
831
+ * schedule something to be run after the next time displayedRegions is
832
+ * set
826
833
  */
827
834
  afterDisplayedRegionsSet(cb: Function) {
828
835
  self.afterDisplayedRegionsSetCallbacks.push(cb)
@@ -915,8 +922,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
915
922
  * creates an svg export and save using FileSaver
916
923
  */
917
924
  async exportSvg(opts: ExportSvgOptions = {}) {
918
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
919
- const html = await renderToSvg(self as any, opts)
925
+ const { renderToSvg } = await import(
926
+ './svgcomponents/SVGLinearGenomeView'
927
+ )
928
+ const html = await renderToSvg(self as LinearGenomeViewModel, opts)
920
929
  const blob = new Blob([html], { type: 'image/svg+xml' })
921
930
  saveAs(blob, opts.filename || 'image.svg')
922
931
  },
@@ -999,8 +1008,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
999
1008
  },
1000
1009
  /**
1001
1010
  * #getter
1002
- * the cytoband is displayed to the right of the chromosome name,
1003
- * and that offset is calculated manually with this method
1011
+ * the cytoband is displayed to the right of the chromosome name, and
1012
+ * that offset is calculated manually with this method
1004
1013
  */
1005
1014
  get cytobandOffset() {
1006
1015
  return this.showCytobands
@@ -1045,7 +1054,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
1045
1054
  icon: PhotoCameraIcon,
1046
1055
  onClick: () => {
1047
1056
  getSession(self).queueDialog(handleClose => [
1048
- ExportSvgDlg,
1057
+ ExportSvgDialog,
1049
1058
  { model: self, handleClose },
1050
1059
  ])
1051
1060
  },
@@ -1162,10 +1171,9 @@ export function stateModelFactory(pluginManager: PluginManager) {
1162
1171
  * #getter
1163
1172
  * static blocks are an important concept jbrowse uses to avoid
1164
1173
  * re-rendering when you scroll to the side. when you horizontally
1165
- * scroll to the right, old blocks to the left may be removed, and
1166
- * new blocks may be instantiated on the right. tracks may use the
1167
- * static blocks to render their data for the region represented by
1168
- * the block
1174
+ * scroll to the right, old blocks to the left may be removed, and new
1175
+ * blocks may be instantiated on the right. tracks may use the static
1176
+ * blocks to render their data for the region represented by the block
1169
1177
  */
1170
1178
  get staticBlocks() {
1171
1179
  const ret = calculateStaticBlocks(self)
@@ -1180,7 +1188,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
1180
1188
  * #getter
1181
1189
  * dynamic blocks represent the exact coordinates of the currently
1182
1190
  * visible genome regions on the screen. they are similar to static
1183
- * blocks, but statcic blocks can go offscreen while dynamic blocks
1191
+ * blocks, but static blocks can go offscreen while dynamic blocks
1184
1192
  * represent exactly what is on screen
1185
1193
  */
1186
1194
  get dynamicBlocks() {
@@ -1203,8 +1211,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
1203
1211
 
1204
1212
  /**
1205
1213
  * #getter
1206
- * a single "combo-locstring" representing all the regions visible
1207
- * on the screen
1214
+ * a single "combo-locstring" representing all the regions visible on
1215
+ * the screen
1208
1216
  */
1209
1217
  get visibleLocStrings() {
1210
1218
  return calculateVisibleLocStrings(this.dynamicBlocks.contentBlocks)
@@ -1258,8 +1266,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
1258
1266
  .actions(self => ({
1259
1267
  /**
1260
1268
  * #action
1261
- * offset is the base-pair-offset in the displayed region, index is the index of the
1262
- * displayed region in the linear genome view
1269
+ * offset is the base-pair-offset in the displayed region, index is the
1270
+ * index of the displayed region in the linear genome view
1263
1271
  *
1264
1272
  * @param start - object as `{start, end, offset, index}`
1265
1273
  * @param end - object as `{start, end, offset, index}`
@@ -1270,91 +1278,52 @@ export function stateModelFactory(pluginManager: PluginManager) {
1270
1278
 
1271
1279
  /**
1272
1280
  * #action
1273
- * navigate to the given locstring
1281
+ * Navigate to the given locstring, will change displayed regions if
1282
+ * needed, and wait for assemblies to be initialized
1274
1283
  *
1275
- * @param locString - e.g. "chr1:1-100"
1276
- * @param optAssemblyName - (optional) the assembly name to use when navigating to the locstring
1284
+ * @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
1285
+ * @param optAssemblyName - (optional) the assembly name to use when
1286
+ * navigating to the locstring
1277
1287
  */
1278
- async navToLocString(locString: string, optAssemblyName?: string) {
1288
+ async navToLocString(input: string, optAssemblyName?: string) {
1279
1289
  const { assemblyNames } = self
1280
1290
  const { assemblyManager } = getSession(self)
1281
1291
  const { isValidRefName } = assemblyManager
1282
- await when(() => self.volatileWidth !== undefined)
1283
1292
  const assemblyName = optAssemblyName || assemblyNames[0]
1284
- let parsedLocStrings
1285
- const inputs = locString
1286
- .split(/(\s+)/)
1287
- .map(f => f.trim())
1288
- .filter(f => !!f)
1289
-
1290
1293
  if (assemblyName) {
1294
+ // wait before isValidRefName can be called
1291
1295
  await assemblyManager.waitForAssembly(assemblyName)
1292
1296
  }
1293
1297
 
1294
- // first try interpreting as a whitespace-separated sequence of
1295
- // multiple locstrings
1296
- try {
1297
- parsedLocStrings = inputs.map(loc =>
1298
- parseLocString(loc, ref => isValidRefName(ref, assemblyName)),
1299
- )
1300
- } catch (e) {
1301
- // if this fails, try interpreting as a whitespace-separated refname,
1302
- // start, end if start and end are integer inputs
1303
- const [refName, start, end] = inputs
1304
- if (
1305
- `${e}`.match(/Unknown reference sequence/) &&
1306
- Number.isInteger(+start) &&
1307
- Number.isInteger(+end)
1308
- ) {
1309
- parsedLocStrings = [
1310
- parseLocString(refName + ':' + start + '..' + end, ref =>
1311
- isValidRefName(ref, assemblyName),
1312
- ),
1313
- ]
1314
- } else {
1315
- throw e
1316
- }
1317
- }
1298
+ return this.navToLocations(
1299
+ parseLocStrings(input, assemblyName, isValidRefName),
1300
+ assemblyName,
1301
+ )
1302
+ },
1318
1303
 
1319
- const locations = await Promise.all(
1320
- parsedLocStrings?.map(async region => {
1321
- const asmName = region.assemblyName || assemblyName
1322
- const asm = await assemblyManager.waitForAssembly(asmName)
1323
- const { refName } = region
1324
- if (!asm) {
1325
- throw new Error(`assembly ${asmName} not found`)
1326
- }
1327
- const { regions } = asm
1328
- if (!regions) {
1329
- throw new Error(`regions not loaded yet for ${asmName}`)
1330
- }
1331
- const canonicalRefName = asm.getCanonicalRefName(region.refName)
1332
- if (!canonicalRefName) {
1333
- throw new Error(
1334
- `Could not find refName ${refName} in ${asm.name}`,
1335
- )
1336
- }
1337
- const parentRegion = regions.find(
1338
- r => r.refName === canonicalRefName,
1339
- )
1340
- if (!parentRegion) {
1341
- throw new Error(`Could not find refName ${refName} in ${asmName}`)
1342
- }
1304
+ /**
1305
+ * #action
1306
+ * Similar to `navToLocString`, but accepts parsed location objects
1307
+ * instead of strings. Will try to perform `setDisplayedRegions` if
1308
+ * changing regions
1309
+ */
1310
+ async navToLocations(
1311
+ parsedLocStrings: ParsedLocString[],
1312
+ assemblyName?: string,
1313
+ ) {
1314
+ const { assemblyManager } = getSession(self)
1315
+ await when(() => self.volatileWidth !== undefined)
1343
1316
 
1344
- return {
1345
- ...region,
1346
- assemblyName: asmName,
1347
- parentRegion,
1348
- }
1349
- }),
1317
+ const locations = await generateLocations(
1318
+ parsedLocStrings,
1319
+ assemblyManager,
1320
+ assemblyName,
1350
1321
  )
1351
1322
 
1352
1323
  if (locations.length === 1) {
1353
1324
  const loc = locations[0]
1354
- self.setDisplayedRegions([
1355
- { reversed: loc.reversed, ...loc.parentRegion },
1356
- ])
1357
- const { start, end, parentRegion } = loc
1325
+ const { reversed, parentRegion, start, end } = loc
1326
+ self.setDisplayedRegions([{ reversed, ...parentRegion }])
1358
1327
 
1359
1328
  this.navTo({
1360
1329
  ...loc,
@@ -1373,10 +1342,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
1373
1342
  /**
1374
1343
  * #action
1375
1344
  * Navigate to a location based on its refName and optionally start, end,
1376
- * and assemblyName. Can handle if there are multiple displayedRegions
1377
- * from same refName. Only navigates to a location if it is entirely
1378
- * within a displayedRegion. Navigates to the first matching location
1379
- * encountered.
1345
+ * and assemblyName. Will not try to change displayed regions, use
1346
+ * `navToLocations` instead. Only navigates to a location if it is
1347
+ * entirely within a displayedRegion. Navigates to the first matching
1348
+ * location encountered.
1380
1349
  *
1381
1350
  * Throws an error if navigation was unsuccessful
1382
1351
  *
@@ -1388,132 +1357,89 @@ export function stateModelFactory(pluginManager: PluginManager) {
1388
1357
 
1389
1358
  /**
1390
1359
  * #action
1360
+ * Navigate to a location based on its refName and optionally start, end,
1361
+ * and assemblyName. Will not try to change displayed regions, use
1362
+ * navToLocations instead. Only navigates to a location if it is entirely
1363
+ * within a displayedRegion. Navigates to the first matching location
1364
+ * encountered.
1365
+ *
1366
+ * Throws an error if navigation was unsuccessful
1367
+ *
1368
+ * @param locations - proposed location to navigate to
1391
1369
  */
1392
1370
  navToMultiple(locations: NavLocation[]) {
1393
- const firstLocation = locations[0]
1394
- let { refName } = firstLocation
1395
- const {
1396
- start,
1397
- end,
1398
- assemblyName = self.assemblyNames[0],
1399
- } = firstLocation
1400
-
1401
- if (start !== undefined && end !== undefined && start > end) {
1402
- throw new Error(`start "${start + 1}" is greater than end "${end}"`)
1371
+ if (
1372
+ locations.some(
1373
+ l =>
1374
+ l.start !== undefined && l.end !== undefined && l.start > l.end,
1375
+ )
1376
+ ) {
1377
+ throw new Error('found start greater than end')
1403
1378
  }
1404
- const session = getSession(self)
1405
- const { assemblyManager } = session
1406
- const assembly = assemblyManager.get(assemblyName)
1407
- if (assembly) {
1408
- const canonicalRefName = assembly.getCanonicalRefName(refName)
1409
- if (canonicalRefName) {
1410
- refName = canonicalRefName
1411
- }
1379
+ const f1 = locations.at(0)
1380
+ const f2 = locations.at(-1)
1381
+ if (!f1 || !f2) {
1382
+ return
1412
1383
  }
1413
- let s = start
1414
- let e = end
1415
- let refNameMatched = false
1416
- const predicate = (r: Region) => {
1417
- if (refName === r.refName) {
1418
- refNameMatched = true
1419
- if (s === undefined) {
1420
- s = r.start
1421
- }
1422
- if (e === undefined) {
1423
- e = r.end
1424
- }
1425
- if (s >= r.start && s <= r.end && e <= r.end && e >= r.start) {
1426
- return true
1427
- }
1428
- s = start
1429
- e = end
1430
- }
1431
- return false
1384
+ const a = self.assemblyNames[0]
1385
+ const { assemblyManager } = getSession(self)
1386
+ const assembly1 = assemblyManager.get(f1.assemblyName || a)
1387
+ const assembly2 = assemblyManager.get(f2.assemblyName || a)
1388
+ const ref1 = assembly1?.getCanonicalRefName(f1.refName) || f1.refName
1389
+ const ref2 = assembly2?.getCanonicalRefName(f2.refName) || f2.refName
1390
+ const r1 = self.displayedRegions.find(r => r.refName === ref1)
1391
+ const r2 = findLast(self.displayedRegions, r => r.refName === ref2)
1392
+ if (!r1) {
1393
+ throw new Error(`could not find a region with refName "${ref1}"`)
1394
+ }
1395
+ if (!r2) {
1396
+ throw new Error(`could not find a region with refName "${ref2}"`)
1432
1397
  }
1433
1398
 
1434
- const lastIndex = findLastIndex(self.displayedRegions, predicate)
1435
- let index
1436
- while (index !== lastIndex) {
1437
- try {
1438
- const previousIndex: number | undefined = index
1439
- index = self.displayedRegions
1440
- .slice(previousIndex === undefined ? 0 : previousIndex + 1)
1441
- .findIndex(predicate)
1442
- if (previousIndex !== undefined) {
1443
- index += previousIndex + 1
1444
- }
1445
- if (!refNameMatched) {
1446
- throw new Error(
1447
- `could not find a region with refName "${refName}"`,
1448
- )
1449
- }
1450
- if (s === undefined) {
1451
- throw new Error(
1452
- `could not find a region with refName "${refName}" that contained an end position ${e}`,
1453
- )
1454
- }
1455
- if (e === undefined) {
1456
- throw new Error(
1457
- `could not find a region with refName "${refName}" that contained a start position ${
1458
- s + 1
1459
- }`,
1460
- )
1461
- }
1462
- if (index === -1) {
1463
- throw new Error(
1464
- `could not find a region that completely contained "${assembleLocString(
1465
- firstLocation,
1466
- )}"`,
1467
- )
1468
- }
1469
- if (locations.length === 1) {
1470
- const f = self.displayedRegions[index]
1471
- this.moveTo(
1472
- { index, offset: f.reversed ? f.end - e : s - f.start },
1473
- { index, offset: f.reversed ? f.end - s : e - f.start },
1474
- )
1475
- return
1476
- }
1477
- let idx = 0
1478
- let start = 0
1479
- let end = 0
1480
- for (idx; idx < locations.length; idx++) {
1481
- const location = locations[idx]
1482
- const region = self.displayedRegions[index + idx]
1483
- start = location.start || region.start
1484
- end = location.end || region.end
1485
- if (location.refName !== region.refName) {
1486
- throw new Error(
1487
- `Entered location ${assembleLocString(
1488
- location,
1489
- )} does not match with displayed regions`,
1490
- )
1491
- }
1492
- }
1493
- idx -= 1
1494
- const startDisplayedRegion = self.displayedRegions[index]
1495
- const endDisplayedRegion = self.displayedRegions[index + idx]
1496
- this.moveTo(
1497
- {
1498
- index,
1499
- offset: startDisplayedRegion.reversed
1500
- ? startDisplayedRegion.end - e
1501
- : s - startDisplayedRegion.start,
1502
- },
1503
- {
1504
- index: index + idx,
1505
- offset: endDisplayedRegion.reversed
1506
- ? endDisplayedRegion.end - start
1507
- : end - endDisplayedRegion.start,
1508
- },
1509
- )
1510
- return
1511
- } catch (error) {
1512
- if (index === lastIndex) {
1513
- throw error
1514
- }
1515
- }
1399
+ const s1 = f1.start === undefined ? r1.start : f1.start
1400
+ const e1 = f1.end === undefined ? r1.end : f1.end
1401
+ const s2 = f2.start === undefined ? r2.start : f2.start
1402
+ const e2 = f2.end === undefined ? r2.end : f2.end
1403
+
1404
+ const index = self.displayedRegions.findIndex(
1405
+ r =>
1406
+ ref1 === r.refName &&
1407
+ s1 >= r.start &&
1408
+ s1 <= r.end &&
1409
+ e1 <= r.end &&
1410
+ e1 >= r.start,
1411
+ )
1412
+
1413
+ const index2 = self.displayedRegions.findIndex(
1414
+ r =>
1415
+ ref2 === r.refName &&
1416
+ s2 >= r.start &&
1417
+ s2 <= r.end &&
1418
+ e2 <= r.end &&
1419
+ e2 >= r.start,
1420
+ )
1421
+
1422
+ if (index === -1 || index2 === -1) {
1423
+ throw new Error(
1424
+ `could not find a region that contained "${locations.map(l =>
1425
+ assembleLocString(l),
1426
+ )}"`,
1427
+ )
1516
1428
  }
1429
+
1430
+ const sd = self.displayedRegions[index]
1431
+ const ed = self.displayedRegions[index2]
1432
+
1433
+ this.moveTo(
1434
+ {
1435
+ index,
1436
+ offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
1437
+ },
1438
+ {
1439
+ index: index2,
1440
+ offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
1441
+ },
1442
+ )
1517
1443
  },
1518
1444
  }))
1519
1445
  .views(self => ({
@@ -1525,15 +1451,17 @@ export function stateModelFactory(pluginManager: PluginManager) {
1525
1451
  {
1526
1452
  label: 'Zoom to region',
1527
1453
  icon: ZoomInIcon,
1528
- onClick: () => {
1529
- const { leftOffset, rightOffset } = self
1530
- self.moveTo(leftOffset, rightOffset)
1531
- },
1454
+ onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1532
1455
  },
1533
1456
  {
1534
1457
  label: 'Get sequence',
1535
1458
  icon: MenuOpenIcon,
1536
- onClick: () => self.setGetSequenceDialogOpen(true),
1459
+ onClick: () =>
1460
+ getSession(self).queueDialog(handleClose => [
1461
+ GetSequenceDialog,
1462
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1463
+ { model: self as any, handleClose },
1464
+ ]),
1537
1465
  },
1538
1466
  ]
1539
1467
  },
@@ -1567,7 +1495,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
1567
1495
  coord,
1568
1496
  regionNumber,
1569
1497
  })
1570
- if (centerPx) {
1498
+ if (centerPx !== undefined) {
1571
1499
  self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2))
1572
1500
  }
1573
1501
  },
@@ -10,15 +10,13 @@ import { Polygon } from '../components/OverviewScalebar'
10
10
  import SVGRuler from './SVGRuler'
11
11
  import SVGScalebar from './SVGScalebar'
12
12
 
13
- type LGV = LinearGenomeViewModel
14
-
15
13
  export default function SVGHeader({
16
14
  model,
17
15
  fontSize,
18
16
  cytobandHeight,
19
17
  rulerHeight,
20
18
  }: {
21
- model: LGV
19
+ model: LinearGenomeViewModel
22
20
  rulerHeight: number
23
21
  fontSize: number
24
22
  cytobandHeight: number
@@ -35,19 +33,23 @@ export default function SVGHeader({
35
33
  minimumBlockWidth: model.minimumBlockWidth,
36
34
  })
37
35
  const visibleRegions = model.dynamicBlocks.contentBlocks
36
+ if (!visibleRegions.length) {
37
+ return null
38
+ }
38
39
 
39
40
  overview.setVolatileWidth(width)
40
41
  overview.showAllRegions()
41
42
  const block = overview.dynamicBlocks.contentBlocks[0]
42
-
43
- const first = visibleRegions[0]
43
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
+ const first = visibleRegions.at(0)!
45
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
46
+ const last = visibleRegions.at(-1)!
44
47
  const firstOverviewPx =
45
48
  overview.bpToPx({
46
49
  ...first,
47
50
  coord: first.reversed ? first.end : first.start,
48
51
  }) || 0
49
52
 
50
- const last = visibleRegions[visibleRegions.length - 1]
51
53
  const lastOverviewPx =
52
54
  overview.bpToPx({
53
55
  ...last,
@@ -59,7 +59,7 @@ export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
59
59
  const displayResults = await Promise.all(
60
60
  tracks.map(async track => {
61
61
  const display = track.displays[0]
62
- await when(() => (display.ready !== undefined ? display.ready : true))
62
+ await when(() => !display.renderProps().notReady)
63
63
  return { track, result: await display.renderSvg({ ...opts, theme }) }
64
64
  }),
65
65
  )