@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
@@ -2,8 +2,7 @@ import { lazy } from 'react';
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
4
4
  import { ElementId, Region as MUIRegion } from '@jbrowse/core/util/types/mst';
5
- import { ReturnToImportFormDialog } from '@jbrowse/core/ui';
6
- import { assembleLocString, clamp, findLastIndex, getContainingView, getSession, isViewContainer, isSessionModelWithWidgets, isSessionWithAddTracks, localStorageGetItem, measureText, parseLocString, springAnimate, sum, } from '@jbrowse/core/util';
5
+ import { assembleLocString, clamp, findLast, getContainingView, getSession, isViewContainer, isSessionModelWithWidgets, isSessionWithAddTracks, localStorageGetItem, measureText, springAnimate, sum, } from '@jbrowse/core/util';
7
6
  import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
8
7
  import calculateStaticBlocks from '@jbrowse/core/util/calculateStaticBlocks';
9
8
  import { getParentRenderProps } from '@jbrowse/core/util/tracks';
@@ -22,13 +21,15 @@ import FolderOpenIcon from '@mui/icons-material/FolderOpen';
22
21
  import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
23
22
  import ZoomInIcon from '@mui/icons-material/ZoomIn';
24
23
  import MenuOpenIcon from '@mui/icons-material/MenuOpen';
25
- // locals
26
- import { renderToSvg } from './svgcomponents/SVGLinearGenomeView';
27
- import ExportSvgDlg from './components/ExportSvgDialog';
28
24
  import MiniControls from './components/MiniControls';
29
25
  import Header from './components/Header';
26
+ import { generateLocations, parseLocStrings } from './util';
30
27
  // lazies
28
+ const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
31
29
  const SequenceSearchDialog = lazy(() => import('./components/SequenceSearchDialog'));
30
+ const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'));
31
+ const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog'));
32
+ const SearchResultsDialog = lazy(() => import('./components/SearchResultsDialog'));
32
33
  function calculateVisibleLocStrings(contentBlocks) {
33
34
  if (!contentBlocks.length) {
34
35
  return '';
@@ -51,6 +52,7 @@ export const SPACING = 7;
51
52
  export const WIDGET_HEIGHT = 32;
52
53
  /**
53
54
  * #stateModel LinearGenomeView
55
+ * #category view
54
56
  */
55
57
  export function stateModelFactory(pluginManager) {
56
58
  return types
@@ -108,7 +110,8 @@ export function stateModelFactory(pluginManager) {
108
110
  trackSelectorType: types.optional(types.enumeration(['hierarchical']), 'hierarchical'),
109
111
  /**
110
112
  * #property
111
- * how to display the track labels, can be "overlapping", "offset", or "hidden"
113
+ * how to display the track labels, can be "overlapping", "offset", or
114
+ * "hidden"
112
115
  */
113
116
  trackLabels: types.optional(types.string, () => localStorageGetItem('lgv-trackLabels') || 'overlapping'),
114
117
  /**
@@ -136,15 +139,11 @@ export function stateModelFactory(pluginManager) {
136
139
  // which is basically like an onLoad
137
140
  afterDisplayedRegionsSetCallbacks: [],
138
141
  scaleFactor: 1,
139
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
140
142
  trackRefs: {},
141
143
  coarseDynamicBlocks: [],
142
144
  coarseTotalBp: 0,
143
145
  leftOffset: undefined,
144
146
  rightOffset: undefined,
145
- searchResults: undefined,
146
- searchQuery: undefined,
147
- seqDialogDisplayed: false,
148
147
  }))
149
148
  .views(self => ({
150
149
  /**
@@ -217,12 +216,6 @@ export function stateModelFactory(pluginManager) {
217
216
  get hasDisplayedRegions() {
218
217
  return self.displayedRegions.length > 0;
219
218
  },
220
- /**
221
- * #getter
222
- */
223
- get isSearchDialogDisplayed() {
224
- return self.searchResults !== undefined;
225
- },
226
219
  /**
227
220
  * #getter
228
221
  */
@@ -457,7 +450,9 @@ export function stateModelFactory(pluginManager) {
457
450
  },
458
451
  /**
459
452
  * #action
460
- * sets offsets used in the get sequence dialog
453
+ * sets offsets of rubberband, used in the get sequence dialog can call
454
+ * view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
455
+ * the selected regions from the offsets
461
456
  */
462
457
  setOffsets(left, right) {
463
458
  self.leftOffset = left;
@@ -466,15 +461,17 @@ export function stateModelFactory(pluginManager) {
466
461
  /**
467
462
  * #action
468
463
  */
469
- setSearchResults(results, query) {
470
- self.searchResults = results;
471
- self.searchQuery = query;
472
- },
473
- /**
474
- * #action
475
- */
476
- setGetSequenceDialogOpen(open) {
477
- self.seqDialogDisplayed = open;
464
+ setSearchResults(searchResults, searchQuery, assemblyName) {
465
+ getSession(self).queueDialog(handleClose => [
466
+ SearchResultsDialog,
467
+ {
468
+ model: self,
469
+ searchResults,
470
+ searchQuery,
471
+ handleClose,
472
+ assemblyName,
473
+ },
474
+ ]);
478
475
  },
479
476
  /**
480
477
  * #action
@@ -621,10 +618,13 @@ export function stateModelFactory(pluginManager) {
621
618
  /**
622
619
  * #method
623
620
  * Helper method for the fetchSequence.
624
- * Retrieves the corresponding regions that were selected by the rubberband
621
+ * Retrieves the corresponding regions that were selected by the
622
+ * rubberband
625
623
  *
626
- * @param leftOffset - `object as {start, end, index, offset}`, offset = start of user drag
627
- * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
624
+ * @param leftOffset - `object as {start, end, index, offset}`, offset = start
625
+ * of user drag
626
+ * @param rightOffset - `object as {start, end, index, offset}`,
627
+ * offset = end of user drag
628
628
  * @returns array of Region[]
629
629
  */
630
630
  getSelectedRegions(leftOffset, rightOffset) {
@@ -643,7 +643,8 @@ export function stateModelFactory(pluginManager) {
643
643
  },
644
644
  /**
645
645
  * #action
646
- * schedule something to be run after the next time displayedRegions is set
646
+ * schedule something to be run after the next time displayedRegions is
647
+ * set
647
648
  */
648
649
  afterDisplayedRegionsSet(cb) {
649
650
  self.afterDisplayedRegionsSetCallbacks.push(cb);
@@ -727,7 +728,7 @@ export function stateModelFactory(pluginManager) {
727
728
  * creates an svg export and save using FileSaver
728
729
  */
729
730
  async exportSvg(opts = {}) {
730
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
731
+ const { renderToSvg } = await import('./svgcomponents/SVGLinearGenomeView');
731
732
  const html = await renderToSvg(self, opts);
732
733
  const blob = new Blob([html], { type: 'image/svg+xml' });
733
734
  saveAs(blob, opts.filename || 'image.svg');
@@ -795,8 +796,8 @@ export function stateModelFactory(pluginManager) {
795
796
  },
796
797
  /**
797
798
  * #getter
798
- * the cytoband is displayed to the right of the chromosome name,
799
- * and that offset is calculated manually with this method
799
+ * the cytoband is displayed to the right of the chromosome name, and
800
+ * that offset is calculated manually with this method
800
801
  */
801
802
  get cytobandOffset() {
802
803
  return this.showCytobands
@@ -841,7 +842,7 @@ export function stateModelFactory(pluginManager) {
841
842
  icon: PhotoCameraIcon,
842
843
  onClick: () => {
843
844
  getSession(self).queueDialog(handleClose => [
844
- ExportSvgDlg,
845
+ ExportSvgDialog,
845
846
  { model: self, handleClose },
846
847
  ]);
847
848
  },
@@ -953,10 +954,9 @@ export function stateModelFactory(pluginManager) {
953
954
  * #getter
954
955
  * static blocks are an important concept jbrowse uses to avoid
955
956
  * re-rendering when you scroll to the side. when you horizontally
956
- * scroll to the right, old blocks to the left may be removed, and
957
- * new blocks may be instantiated on the right. tracks may use the
958
- * static blocks to render their data for the region represented by
959
- * the block
957
+ * scroll to the right, old blocks to the left may be removed, and new
958
+ * blocks may be instantiated on the right. tracks may use the static
959
+ * blocks to render their data for the region represented by the block
960
960
  */
961
961
  get staticBlocks() {
962
962
  const ret = calculateStaticBlocks(self);
@@ -971,7 +971,7 @@ export function stateModelFactory(pluginManager) {
971
971
  * #getter
972
972
  * dynamic blocks represent the exact coordinates of the currently
973
973
  * visible genome regions on the screen. they are similar to static
974
- * blocks, but statcic blocks can go offscreen while dynamic blocks
974
+ * blocks, but static blocks can go offscreen while dynamic blocks
975
975
  * represent exactly what is on screen
976
976
  */
977
977
  get dynamicBlocks() {
@@ -990,8 +990,8 @@ export function stateModelFactory(pluginManager) {
990
990
  },
991
991
  /**
992
992
  * #getter
993
- * a single "combo-locstring" representing all the regions visible
994
- * on the screen
993
+ * a single "combo-locstring" representing all the regions visible on
994
+ * the screen
995
995
  */
996
996
  get visibleLocStrings() {
997
997
  return calculateVisibleLocStrings(this.dynamicBlocks.contentBlocks);
@@ -1033,8 +1033,8 @@ export function stateModelFactory(pluginManager) {
1033
1033
  .actions(self => ({
1034
1034
  /**
1035
1035
  * #action
1036
- * offset is the base-pair-offset in the displayed region, index is the index of the
1037
- * displayed region in the linear genome view
1036
+ * offset is the base-pair-offset in the displayed region, index is the
1037
+ * index of the displayed region in the linear genome view
1038
1038
  *
1039
1039
  * @param start - object as `{start, end, offset, index}`
1040
1040
  * @param end - object as `{start, end, offset, index}`
@@ -1044,76 +1044,38 @@ export function stateModelFactory(pluginManager) {
1044
1044
  },
1045
1045
  /**
1046
1046
  * #action
1047
- * navigate to the given locstring
1047
+ * Navigate to the given locstring, will change displayed regions if
1048
+ * needed, and wait for assemblies to be initialized
1048
1049
  *
1049
- * @param locString - e.g. "chr1:1-100"
1050
- * @param optAssemblyName - (optional) the assembly name to use when navigating to the locstring
1050
+ * @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
1051
+ * @param optAssemblyName - (optional) the assembly name to use when
1052
+ * navigating to the locstring
1051
1053
  */
1052
- async navToLocString(locString, optAssemblyName) {
1054
+ async navToLocString(input, optAssemblyName) {
1053
1055
  const { assemblyNames } = self;
1054
1056
  const { assemblyManager } = getSession(self);
1055
1057
  const { isValidRefName } = assemblyManager;
1056
- await when(() => self.volatileWidth !== undefined);
1057
1058
  const assemblyName = optAssemblyName || assemblyNames[0];
1058
- let parsedLocStrings;
1059
- const inputs = locString
1060
- .split(/(\s+)/)
1061
- .map(f => f.trim())
1062
- .filter(f => !!f);
1063
1059
  if (assemblyName) {
1060
+ // wait before isValidRefName can be called
1064
1061
  await assemblyManager.waitForAssembly(assemblyName);
1065
1062
  }
1066
- // first try interpreting as a whitespace-separated sequence of
1067
- // multiple locstrings
1068
- try {
1069
- parsedLocStrings = inputs.map(loc => parseLocString(loc, ref => isValidRefName(ref, assemblyName)));
1070
- }
1071
- catch (e) {
1072
- // if this fails, try interpreting as a whitespace-separated refname,
1073
- // start, end if start and end are integer inputs
1074
- const [refName, start, end] = inputs;
1075
- if (`${e}`.match(/Unknown reference sequence/) &&
1076
- Number.isInteger(+start) &&
1077
- Number.isInteger(+end)) {
1078
- parsedLocStrings = [
1079
- parseLocString(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
1080
- ];
1081
- }
1082
- else {
1083
- throw e;
1084
- }
1085
- }
1086
- const locations = await Promise.all(parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(async (region) => {
1087
- const asmName = region.assemblyName || assemblyName;
1088
- const asm = await assemblyManager.waitForAssembly(asmName);
1089
- const { refName } = region;
1090
- if (!asm) {
1091
- throw new Error(`assembly ${asmName} not found`);
1092
- }
1093
- const { regions } = asm;
1094
- if (!regions) {
1095
- throw new Error(`regions not loaded yet for ${asmName}`);
1096
- }
1097
- const canonicalRefName = asm.getCanonicalRefName(region.refName);
1098
- if (!canonicalRefName) {
1099
- throw new Error(`Could not find refName ${refName} in ${asm.name}`);
1100
- }
1101
- const parentRegion = regions.find(r => r.refName === canonicalRefName);
1102
- if (!parentRegion) {
1103
- throw new Error(`Could not find refName ${refName} in ${asmName}`);
1104
- }
1105
- return {
1106
- ...region,
1107
- assemblyName: asmName,
1108
- parentRegion,
1109
- };
1110
- }));
1063
+ return this.navToLocations(parseLocStrings(input, assemblyName, isValidRefName), assemblyName);
1064
+ },
1065
+ /**
1066
+ * #action
1067
+ * Similar to `navToLocString`, but accepts parsed location objects
1068
+ * instead of strings. Will try to perform `setDisplayedRegions` if
1069
+ * changing regions
1070
+ */
1071
+ async navToLocations(parsedLocStrings, assemblyName) {
1072
+ const { assemblyManager } = getSession(self);
1073
+ await when(() => self.volatileWidth !== undefined);
1074
+ const locations = await generateLocations(parsedLocStrings, assemblyManager, assemblyName);
1111
1075
  if (locations.length === 1) {
1112
1076
  const loc = locations[0];
1113
- self.setDisplayedRegions([
1114
- { reversed: loc.reversed, ...loc.parentRegion },
1115
- ]);
1116
- const { start, end, parentRegion } = loc;
1077
+ const { reversed, parentRegion, start, end } = loc;
1078
+ self.setDisplayedRegions([{ reversed, ...parentRegion }]);
1117
1079
  this.navTo({
1118
1080
  ...loc,
1119
1081
  start: clamp(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
@@ -1130,10 +1092,10 @@ export function stateModelFactory(pluginManager) {
1130
1092
  /**
1131
1093
  * #action
1132
1094
  * Navigate to a location based on its refName and optionally start, end,
1133
- * and assemblyName. Can handle if there are multiple displayedRegions
1134
- * from same refName. Only navigates to a location if it is entirely
1135
- * within a displayedRegion. Navigates to the first matching location
1136
- * encountered.
1095
+ * and assemblyName. Will not try to change displayed regions, use
1096
+ * `navToLocations` instead. Only navigates to a location if it is
1097
+ * entirely within a displayedRegion. Navigates to the first matching
1098
+ * location encountered.
1137
1099
  *
1138
1100
  * Throws an error if navigation was unsuccessful
1139
1101
  *
@@ -1144,105 +1106,65 @@ export function stateModelFactory(pluginManager) {
1144
1106
  },
1145
1107
  /**
1146
1108
  * #action
1109
+ * Navigate to a location based on its refName and optionally start, end,
1110
+ * and assemblyName. Will not try to change displayed regions, use
1111
+ * navToLocations instead. Only navigates to a location if it is entirely
1112
+ * within a displayedRegion. Navigates to the first matching location
1113
+ * encountered.
1114
+ *
1115
+ * Throws an error if navigation was unsuccessful
1116
+ *
1117
+ * @param locations - proposed location to navigate to
1147
1118
  */
1148
1119
  navToMultiple(locations) {
1149
- const firstLocation = locations[0];
1150
- let { refName } = firstLocation;
1151
- const { start, end, assemblyName = self.assemblyNames[0], } = firstLocation;
1152
- if (start !== undefined && end !== undefined && start > end) {
1153
- throw new Error(`start "${start + 1}" is greater than end "${end}"`);
1120
+ if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
1121
+ throw new Error('found start greater than end');
1154
1122
  }
1155
- const session = getSession(self);
1156
- const { assemblyManager } = session;
1157
- const assembly = assemblyManager.get(assemblyName);
1158
- if (assembly) {
1159
- const canonicalRefName = assembly.getCanonicalRefName(refName);
1160
- if (canonicalRefName) {
1161
- refName = canonicalRefName;
1162
- }
1123
+ const f1 = locations.at(0);
1124
+ const f2 = locations.at(-1);
1125
+ if (!f1 || !f2) {
1126
+ return;
1163
1127
  }
1164
- let s = start;
1165
- let e = end;
1166
- let refNameMatched = false;
1167
- const predicate = (r) => {
1168
- if (refName === r.refName) {
1169
- refNameMatched = true;
1170
- if (s === undefined) {
1171
- s = r.start;
1172
- }
1173
- if (e === undefined) {
1174
- e = r.end;
1175
- }
1176
- if (s >= r.start && s <= r.end && e <= r.end && e >= r.start) {
1177
- return true;
1178
- }
1179
- s = start;
1180
- e = end;
1181
- }
1182
- return false;
1183
- };
1184
- const lastIndex = findLastIndex(self.displayedRegions, predicate);
1185
- let index;
1186
- while (index !== lastIndex) {
1187
- try {
1188
- const previousIndex = index;
1189
- index = self.displayedRegions
1190
- .slice(previousIndex === undefined ? 0 : previousIndex + 1)
1191
- .findIndex(predicate);
1192
- if (previousIndex !== undefined) {
1193
- index += previousIndex + 1;
1194
- }
1195
- if (!refNameMatched) {
1196
- throw new Error(`could not find a region with refName "${refName}"`);
1197
- }
1198
- if (s === undefined) {
1199
- throw new Error(`could not find a region with refName "${refName}" that contained an end position ${e}`);
1200
- }
1201
- if (e === undefined) {
1202
- throw new Error(`could not find a region with refName "${refName}" that contained a start position ${s + 1}`);
1203
- }
1204
- if (index === -1) {
1205
- throw new Error(`could not find a region that completely contained "${assembleLocString(firstLocation)}"`);
1206
- }
1207
- if (locations.length === 1) {
1208
- const f = self.displayedRegions[index];
1209
- this.moveTo({ index, offset: f.reversed ? f.end - e : s - f.start }, { index, offset: f.reversed ? f.end - s : e - f.start });
1210
- return;
1211
- }
1212
- let idx = 0;
1213
- let start = 0;
1214
- let end = 0;
1215
- for (idx; idx < locations.length; idx++) {
1216
- const location = locations[idx];
1217
- const region = self.displayedRegions[index + idx];
1218
- start = location.start || region.start;
1219
- end = location.end || region.end;
1220
- if (location.refName !== region.refName) {
1221
- throw new Error(`Entered location ${assembleLocString(location)} does not match with displayed regions`);
1222
- }
1223
- }
1224
- idx -= 1;
1225
- const startDisplayedRegion = self.displayedRegions[index];
1226
- const endDisplayedRegion = self.displayedRegions[index + idx];
1227
- this.moveTo({
1228
- index,
1229
- offset: startDisplayedRegion.reversed
1230
- ? startDisplayedRegion.end - e
1231
- : s - startDisplayedRegion.start,
1232
- }, {
1233
- index: index + idx,
1234
- offset: endDisplayedRegion.reversed
1235
- ? endDisplayedRegion.end - start
1236
- : end - endDisplayedRegion.start,
1237
- });
1238
- return;
1239
- }
1240
- catch (error) {
1241
- if (index === lastIndex) {
1242
- throw error;
1243
- }
1244
- }
1128
+ const a = self.assemblyNames[0];
1129
+ const { assemblyManager } = getSession(self);
1130
+ const assembly1 = assemblyManager.get(f1.assemblyName || a);
1131
+ const assembly2 = assemblyManager.get(f2.assemblyName || a);
1132
+ const ref1 = (assembly1 === null || assembly1 === void 0 ? void 0 : assembly1.getCanonicalRefName(f1.refName)) || f1.refName;
1133
+ const ref2 = (assembly2 === null || assembly2 === void 0 ? void 0 : assembly2.getCanonicalRefName(f2.refName)) || f2.refName;
1134
+ const r1 = self.displayedRegions.find(r => r.refName === ref1);
1135
+ const r2 = findLast(self.displayedRegions, r => r.refName === ref2);
1136
+ if (!r1) {
1137
+ throw new Error(`could not find a region with refName "${ref1}"`);
1138
+ }
1139
+ if (!r2) {
1140
+ throw new Error(`could not find a region with refName "${ref2}"`);
1141
+ }
1142
+ const s1 = f1.start === undefined ? r1.start : f1.start;
1143
+ const e1 = f1.end === undefined ? r1.end : f1.end;
1144
+ const s2 = f2.start === undefined ? r2.start : f2.start;
1145
+ const e2 = f2.end === undefined ? r2.end : f2.end;
1146
+ const index = self.displayedRegions.findIndex(r => ref1 === r.refName &&
1147
+ s1 >= r.start &&
1148
+ s1 <= r.end &&
1149
+ e1 <= r.end &&
1150
+ e1 >= r.start);
1151
+ const index2 = self.displayedRegions.findIndex(r => ref2 === r.refName &&
1152
+ s2 >= r.start &&
1153
+ s2 <= r.end &&
1154
+ e2 <= r.end &&
1155
+ e2 >= r.start);
1156
+ if (index === -1 || index2 === -1) {
1157
+ throw new Error(`could not find a region that contained "${locations.map(l => assembleLocString(l))}"`);
1245
1158
  }
1159
+ const sd = self.displayedRegions[index];
1160
+ const ed = self.displayedRegions[index2];
1161
+ this.moveTo({
1162
+ index,
1163
+ offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
1164
+ }, {
1165
+ index: index2,
1166
+ offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
1167
+ });
1246
1168
  },
1247
1169
  }))
1248
1170
  .views(self => ({
@@ -1254,15 +1176,16 @@ export function stateModelFactory(pluginManager) {
1254
1176
  {
1255
1177
  label: 'Zoom to region',
1256
1178
  icon: ZoomInIcon,
1257
- onClick: () => {
1258
- const { leftOffset, rightOffset } = self;
1259
- self.moveTo(leftOffset, rightOffset);
1260
- },
1179
+ onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1261
1180
  },
1262
1181
  {
1263
1182
  label: 'Get sequence',
1264
1183
  icon: MenuOpenIcon,
1265
- onClick: () => self.setGetSequenceDialogOpen(true),
1184
+ onClick: () => getSession(self).queueDialog(handleClose => [
1185
+ GetSequenceDialog,
1186
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1187
+ { model: self, handleClose },
1188
+ ]),
1266
1189
  },
1267
1190
  ];
1268
1191
  },
@@ -1286,7 +1209,7 @@ export function stateModelFactory(pluginManager) {
1286
1209
  coord,
1287
1210
  regionNumber,
1288
1211
  });
1289
- if (centerPx) {
1212
+ if (centerPx !== undefined) {
1290
1213
  self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2));
1291
1214
  }
1292
1215
  },