@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
@@ -31,7 +31,6 @@ const react_1 = require("react");
31
31
  const configuration_1 = require("@jbrowse/core/configuration");
32
32
  const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
33
33
  const mst_1 = require("@jbrowse/core/util/types/mst");
34
- const ui_1 = require("@jbrowse/core/ui");
35
34
  const util_1 = require("@jbrowse/core/util");
36
35
  const calculateDynamicBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateDynamicBlocks"));
37
36
  const calculateStaticBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateStaticBlocks"));
@@ -51,13 +50,15 @@ const FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
51
50
  const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
52
51
  const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
53
52
  const MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
54
- // locals
55
- const SVGLinearGenomeView_1 = require("./svgcomponents/SVGLinearGenomeView");
56
- const ExportSvgDialog_1 = __importDefault(require("./components/ExportSvgDialog"));
57
53
  const MiniControls_1 = __importDefault(require("./components/MiniControls"));
58
54
  const Header_1 = __importDefault(require("./components/Header"));
55
+ const util_2 = require("./util");
59
56
  // lazies
57
+ const ReturnToImportFormDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ReturnToImportFormDialog'))));
60
58
  const SequenceSearchDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SequenceSearchDialog'))));
59
+ const ExportSvgDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ExportSvgDialog'))));
60
+ const GetSequenceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/GetSequenceDialog'))));
61
+ const SearchResultsDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SearchResultsDialog'))));
61
62
  function calculateVisibleLocStrings(contentBlocks) {
62
63
  if (!contentBlocks.length) {
63
64
  return '';
@@ -80,6 +81,7 @@ exports.SPACING = 7;
80
81
  exports.WIDGET_HEIGHT = 32;
81
82
  /**
82
83
  * #stateModel LinearGenomeView
84
+ * #category view
83
85
  */
84
86
  function stateModelFactory(pluginManager) {
85
87
  return mobx_state_tree_1.types
@@ -137,7 +139,8 @@ function stateModelFactory(pluginManager) {
137
139
  trackSelectorType: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration(['hierarchical']), 'hierarchical'),
138
140
  /**
139
141
  * #property
140
- * how to display the track labels, can be "overlapping", "offset", or "hidden"
142
+ * how to display the track labels, can be "overlapping", "offset", or
143
+ * "hidden"
141
144
  */
142
145
  trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('lgv-trackLabels') || 'overlapping'),
143
146
  /**
@@ -165,15 +168,11 @@ function stateModelFactory(pluginManager) {
165
168
  // which is basically like an onLoad
166
169
  afterDisplayedRegionsSetCallbacks: [],
167
170
  scaleFactor: 1,
168
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
169
171
  trackRefs: {},
170
172
  coarseDynamicBlocks: [],
171
173
  coarseTotalBp: 0,
172
174
  leftOffset: undefined,
173
175
  rightOffset: undefined,
174
- searchResults: undefined,
175
- searchQuery: undefined,
176
- seqDialogDisplayed: false,
177
176
  }))
178
177
  .views(self => ({
179
178
  /**
@@ -246,12 +245,6 @@ function stateModelFactory(pluginManager) {
246
245
  get hasDisplayedRegions() {
247
246
  return self.displayedRegions.length > 0;
248
247
  },
249
- /**
250
- * #getter
251
- */
252
- get isSearchDialogDisplayed() {
253
- return self.searchResults !== undefined;
254
- },
255
248
  /**
256
249
  * #getter
257
250
  */
@@ -486,7 +479,9 @@ function stateModelFactory(pluginManager) {
486
479
  },
487
480
  /**
488
481
  * #action
489
- * sets offsets used in the get sequence dialog
482
+ * sets offsets of rubberband, used in the get sequence dialog can call
483
+ * view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
484
+ * the selected regions from the offsets
490
485
  */
491
486
  setOffsets(left, right) {
492
487
  self.leftOffset = left;
@@ -495,15 +490,17 @@ function stateModelFactory(pluginManager) {
495
490
  /**
496
491
  * #action
497
492
  */
498
- setSearchResults(results, query) {
499
- self.searchResults = results;
500
- self.searchQuery = query;
501
- },
502
- /**
503
- * #action
504
- */
505
- setGetSequenceDialogOpen(open) {
506
- self.seqDialogDisplayed = open;
493
+ setSearchResults(searchResults, searchQuery, assemblyName) {
494
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
495
+ SearchResultsDialog,
496
+ {
497
+ model: self,
498
+ searchResults,
499
+ searchQuery,
500
+ handleClose,
501
+ assemblyName,
502
+ },
503
+ ]);
507
504
  },
508
505
  /**
509
506
  * #action
@@ -650,10 +647,13 @@ function stateModelFactory(pluginManager) {
650
647
  /**
651
648
  * #method
652
649
  * Helper method for the fetchSequence.
653
- * Retrieves the corresponding regions that were selected by the rubberband
650
+ * Retrieves the corresponding regions that were selected by the
651
+ * rubberband
654
652
  *
655
- * @param leftOffset - `object as {start, end, index, offset}`, offset = start of user drag
656
- * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
653
+ * @param leftOffset - `object as {start, end, index, offset}`, offset = start
654
+ * of user drag
655
+ * @param rightOffset - `object as {start, end, index, offset}`,
656
+ * offset = end of user drag
657
657
  * @returns array of Region[]
658
658
  */
659
659
  getSelectedRegions(leftOffset, rightOffset) {
@@ -672,7 +672,8 @@ function stateModelFactory(pluginManager) {
672
672
  },
673
673
  /**
674
674
  * #action
675
- * schedule something to be run after the next time displayedRegions is set
675
+ * schedule something to be run after the next time displayedRegions is
676
+ * set
676
677
  */
677
678
  afterDisplayedRegionsSet(cb) {
678
679
  self.afterDisplayedRegionsSetCallbacks.push(cb);
@@ -756,8 +757,8 @@ function stateModelFactory(pluginManager) {
756
757
  * creates an svg export and save using FileSaver
757
758
  */
758
759
  async exportSvg(opts = {}) {
759
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
760
- const html = await (0, SVGLinearGenomeView_1.renderToSvg)(self, opts);
760
+ const { renderToSvg } = await Promise.resolve().then(() => __importStar(require('./svgcomponents/SVGLinearGenomeView')));
761
+ const html = await renderToSvg(self, opts);
761
762
  const blob = new Blob([html], { type: 'image/svg+xml' });
762
763
  (0, file_saver_1.saveAs)(blob, opts.filename || 'image.svg');
763
764
  },
@@ -824,8 +825,8 @@ function stateModelFactory(pluginManager) {
824
825
  },
825
826
  /**
826
827
  * #getter
827
- * the cytoband is displayed to the right of the chromosome name,
828
- * and that offset is calculated manually with this method
828
+ * the cytoband is displayed to the right of the chromosome name, and
829
+ * that offset is calculated manually with this method
829
830
  */
830
831
  get cytobandOffset() {
831
832
  return this.showCytobands
@@ -846,7 +847,7 @@ function stateModelFactory(pluginManager) {
846
847
  label: 'Return to import form',
847
848
  onClick: () => {
848
849
  (0, util_1.getSession)(self).queueDialog(handleClose => [
849
- ui_1.ReturnToImportFormDialog,
850
+ ReturnToImportFormDialog,
850
851
  { model: self, handleClose },
851
852
  ]);
852
853
  },
@@ -870,7 +871,7 @@ function stateModelFactory(pluginManager) {
870
871
  icon: PhotoCamera_1.default,
871
872
  onClick: () => {
872
873
  (0, util_1.getSession)(self).queueDialog(handleClose => [
873
- ExportSvgDialog_1.default,
874
+ ExportSvgDialog,
874
875
  { model: self, handleClose },
875
876
  ]);
876
877
  },
@@ -982,10 +983,9 @@ function stateModelFactory(pluginManager) {
982
983
  * #getter
983
984
  * static blocks are an important concept jbrowse uses to avoid
984
985
  * re-rendering when you scroll to the side. when you horizontally
985
- * scroll to the right, old blocks to the left may be removed, and
986
- * new blocks may be instantiated on the right. tracks may use the
987
- * static blocks to render their data for the region represented by
988
- * the block
986
+ * scroll to the right, old blocks to the left may be removed, and new
987
+ * blocks may be instantiated on the right. tracks may use the static
988
+ * blocks to render their data for the region represented by the block
989
989
  */
990
990
  get staticBlocks() {
991
991
  const ret = (0, calculateStaticBlocks_1.default)(self);
@@ -1000,7 +1000,7 @@ function stateModelFactory(pluginManager) {
1000
1000
  * #getter
1001
1001
  * dynamic blocks represent the exact coordinates of the currently
1002
1002
  * visible genome regions on the screen. they are similar to static
1003
- * blocks, but statcic blocks can go offscreen while dynamic blocks
1003
+ * blocks, but static blocks can go offscreen while dynamic blocks
1004
1004
  * represent exactly what is on screen
1005
1005
  */
1006
1006
  get dynamicBlocks() {
@@ -1019,8 +1019,8 @@ function stateModelFactory(pluginManager) {
1019
1019
  },
1020
1020
  /**
1021
1021
  * #getter
1022
- * a single "combo-locstring" representing all the regions visible
1023
- * on the screen
1022
+ * a single "combo-locstring" representing all the regions visible on
1023
+ * the screen
1024
1024
  */
1025
1025
  get visibleLocStrings() {
1026
1026
  return calculateVisibleLocStrings(this.dynamicBlocks.contentBlocks);
@@ -1062,8 +1062,8 @@ function stateModelFactory(pluginManager) {
1062
1062
  .actions(self => ({
1063
1063
  /**
1064
1064
  * #action
1065
- * offset is the base-pair-offset in the displayed region, index is the index of the
1066
- * displayed region in the linear genome view
1065
+ * offset is the base-pair-offset in the displayed region, index is the
1066
+ * index of the displayed region in the linear genome view
1067
1067
  *
1068
1068
  * @param start - object as `{start, end, offset, index}`
1069
1069
  * @param end - object as `{start, end, offset, index}`
@@ -1073,76 +1073,38 @@ function stateModelFactory(pluginManager) {
1073
1073
  },
1074
1074
  /**
1075
1075
  * #action
1076
- * navigate to the given locstring
1076
+ * Navigate to the given locstring, will change displayed regions if
1077
+ * needed, and wait for assemblies to be initialized
1077
1078
  *
1078
- * @param locString - e.g. "chr1:1-100"
1079
- * @param optAssemblyName - (optional) the assembly name to use when navigating to the locstring
1079
+ * @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
1080
+ * @param optAssemblyName - (optional) the assembly name to use when
1081
+ * navigating to the locstring
1080
1082
  */
1081
- async navToLocString(locString, optAssemblyName) {
1083
+ async navToLocString(input, optAssemblyName) {
1082
1084
  const { assemblyNames } = self;
1083
1085
  const { assemblyManager } = (0, util_1.getSession)(self);
1084
1086
  const { isValidRefName } = assemblyManager;
1085
- await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
1086
1087
  const assemblyName = optAssemblyName || assemblyNames[0];
1087
- let parsedLocStrings;
1088
- const inputs = locString
1089
- .split(/(\s+)/)
1090
- .map(f => f.trim())
1091
- .filter(f => !!f);
1092
1088
  if (assemblyName) {
1089
+ // wait before isValidRefName can be called
1093
1090
  await assemblyManager.waitForAssembly(assemblyName);
1094
1091
  }
1095
- // first try interpreting as a whitespace-separated sequence of
1096
- // multiple locstrings
1097
- try {
1098
- parsedLocStrings = inputs.map(loc => (0, util_1.parseLocString)(loc, ref => isValidRefName(ref, assemblyName)));
1099
- }
1100
- catch (e) {
1101
- // if this fails, try interpreting as a whitespace-separated refname,
1102
- // start, end if start and end are integer inputs
1103
- const [refName, start, end] = inputs;
1104
- if (`${e}`.match(/Unknown reference sequence/) &&
1105
- Number.isInteger(+start) &&
1106
- Number.isInteger(+end)) {
1107
- parsedLocStrings = [
1108
- (0, util_1.parseLocString)(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
1109
- ];
1110
- }
1111
- else {
1112
- throw e;
1113
- }
1114
- }
1115
- const locations = await Promise.all(parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(async (region) => {
1116
- const asmName = region.assemblyName || assemblyName;
1117
- const asm = await assemblyManager.waitForAssembly(asmName);
1118
- const { refName } = region;
1119
- if (!asm) {
1120
- throw new Error(`assembly ${asmName} not found`);
1121
- }
1122
- const { regions } = asm;
1123
- if (!regions) {
1124
- throw new Error(`regions not loaded yet for ${asmName}`);
1125
- }
1126
- const canonicalRefName = asm.getCanonicalRefName(region.refName);
1127
- if (!canonicalRefName) {
1128
- throw new Error(`Could not find refName ${refName} in ${asm.name}`);
1129
- }
1130
- const parentRegion = regions.find(r => r.refName === canonicalRefName);
1131
- if (!parentRegion) {
1132
- throw new Error(`Could not find refName ${refName} in ${asmName}`);
1133
- }
1134
- return {
1135
- ...region,
1136
- assemblyName: asmName,
1137
- parentRegion,
1138
- };
1139
- }));
1092
+ return this.navToLocations((0, util_2.parseLocStrings)(input, assemblyName, isValidRefName), assemblyName);
1093
+ },
1094
+ /**
1095
+ * #action
1096
+ * Similar to `navToLocString`, but accepts parsed location objects
1097
+ * instead of strings. Will try to perform `setDisplayedRegions` if
1098
+ * changing regions
1099
+ */
1100
+ async navToLocations(parsedLocStrings, assemblyName) {
1101
+ const { assemblyManager } = (0, util_1.getSession)(self);
1102
+ await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
1103
+ const locations = await (0, util_2.generateLocations)(parsedLocStrings, assemblyManager, assemblyName);
1140
1104
  if (locations.length === 1) {
1141
1105
  const loc = locations[0];
1142
- self.setDisplayedRegions([
1143
- { reversed: loc.reversed, ...loc.parentRegion },
1144
- ]);
1145
- const { start, end, parentRegion } = loc;
1106
+ const { reversed, parentRegion, start, end } = loc;
1107
+ self.setDisplayedRegions([{ reversed, ...parentRegion }]);
1146
1108
  this.navTo({
1147
1109
  ...loc,
1148
1110
  start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
@@ -1159,10 +1121,10 @@ function stateModelFactory(pluginManager) {
1159
1121
  /**
1160
1122
  * #action
1161
1123
  * Navigate to a location based on its refName and optionally start, end,
1162
- * and assemblyName. Can handle if there are multiple displayedRegions
1163
- * from same refName. Only navigates to a location if it is entirely
1164
- * within a displayedRegion. Navigates to the first matching location
1165
- * encountered.
1124
+ * and assemblyName. Will not try to change displayed regions, use
1125
+ * `navToLocations` instead. Only navigates to a location if it is
1126
+ * entirely within a displayedRegion. Navigates to the first matching
1127
+ * location encountered.
1166
1128
  *
1167
1129
  * Throws an error if navigation was unsuccessful
1168
1130
  *
@@ -1173,105 +1135,65 @@ function stateModelFactory(pluginManager) {
1173
1135
  },
1174
1136
  /**
1175
1137
  * #action
1138
+ * Navigate to a location based on its refName and optionally start, end,
1139
+ * and assemblyName. Will not try to change displayed regions, use
1140
+ * navToLocations instead. Only navigates to a location if it is entirely
1141
+ * within a displayedRegion. Navigates to the first matching location
1142
+ * encountered.
1143
+ *
1144
+ * Throws an error if navigation was unsuccessful
1145
+ *
1146
+ * @param locations - proposed location to navigate to
1176
1147
  */
1177
1148
  navToMultiple(locations) {
1178
- const firstLocation = locations[0];
1179
- let { refName } = firstLocation;
1180
- const { start, end, assemblyName = self.assemblyNames[0], } = firstLocation;
1181
- if (start !== undefined && end !== undefined && start > end) {
1182
- throw new Error(`start "${start + 1}" is greater than end "${end}"`);
1149
+ if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
1150
+ throw new Error('found start greater than end');
1183
1151
  }
1184
- const session = (0, util_1.getSession)(self);
1185
- const { assemblyManager } = session;
1186
- const assembly = assemblyManager.get(assemblyName);
1187
- if (assembly) {
1188
- const canonicalRefName = assembly.getCanonicalRefName(refName);
1189
- if (canonicalRefName) {
1190
- refName = canonicalRefName;
1191
- }
1152
+ const f1 = locations.at(0);
1153
+ const f2 = locations.at(-1);
1154
+ if (!f1 || !f2) {
1155
+ return;
1192
1156
  }
1193
- let s = start;
1194
- let e = end;
1195
- let refNameMatched = false;
1196
- const predicate = (r) => {
1197
- if (refName === r.refName) {
1198
- refNameMatched = true;
1199
- if (s === undefined) {
1200
- s = r.start;
1201
- }
1202
- if (e === undefined) {
1203
- e = r.end;
1204
- }
1205
- if (s >= r.start && s <= r.end && e <= r.end && e >= r.start) {
1206
- return true;
1207
- }
1208
- s = start;
1209
- e = end;
1210
- }
1211
- return false;
1212
- };
1213
- const lastIndex = (0, util_1.findLastIndex)(self.displayedRegions, predicate);
1214
- let index;
1215
- while (index !== lastIndex) {
1216
- try {
1217
- const previousIndex = index;
1218
- index = self.displayedRegions
1219
- .slice(previousIndex === undefined ? 0 : previousIndex + 1)
1220
- .findIndex(predicate);
1221
- if (previousIndex !== undefined) {
1222
- index += previousIndex + 1;
1223
- }
1224
- if (!refNameMatched) {
1225
- throw new Error(`could not find a region with refName "${refName}"`);
1226
- }
1227
- if (s === undefined) {
1228
- throw new Error(`could not find a region with refName "${refName}" that contained an end position ${e}`);
1229
- }
1230
- if (e === undefined) {
1231
- throw new Error(`could not find a region with refName "${refName}" that contained a start position ${s + 1}`);
1232
- }
1233
- if (index === -1) {
1234
- throw new Error(`could not find a region that completely contained "${(0, util_1.assembleLocString)(firstLocation)}"`);
1235
- }
1236
- if (locations.length === 1) {
1237
- const f = self.displayedRegions[index];
1238
- this.moveTo({ index, offset: f.reversed ? f.end - e : s - f.start }, { index, offset: f.reversed ? f.end - s : e - f.start });
1239
- return;
1240
- }
1241
- let idx = 0;
1242
- let start = 0;
1243
- let end = 0;
1244
- for (idx; idx < locations.length; idx++) {
1245
- const location = locations[idx];
1246
- const region = self.displayedRegions[index + idx];
1247
- start = location.start || region.start;
1248
- end = location.end || region.end;
1249
- if (location.refName !== region.refName) {
1250
- throw new Error(`Entered location ${(0, util_1.assembleLocString)(location)} does not match with displayed regions`);
1251
- }
1252
- }
1253
- idx -= 1;
1254
- const startDisplayedRegion = self.displayedRegions[index];
1255
- const endDisplayedRegion = self.displayedRegions[index + idx];
1256
- this.moveTo({
1257
- index,
1258
- offset: startDisplayedRegion.reversed
1259
- ? startDisplayedRegion.end - e
1260
- : s - startDisplayedRegion.start,
1261
- }, {
1262
- index: index + idx,
1263
- offset: endDisplayedRegion.reversed
1264
- ? endDisplayedRegion.end - start
1265
- : end - endDisplayedRegion.start,
1266
- });
1267
- return;
1268
- }
1269
- catch (error) {
1270
- if (index === lastIndex) {
1271
- throw error;
1272
- }
1273
- }
1157
+ const a = self.assemblyNames[0];
1158
+ const { assemblyManager } = (0, util_1.getSession)(self);
1159
+ const assembly1 = assemblyManager.get(f1.assemblyName || a);
1160
+ const assembly2 = assemblyManager.get(f2.assemblyName || a);
1161
+ const ref1 = (assembly1 === null || assembly1 === void 0 ? void 0 : assembly1.getCanonicalRefName(f1.refName)) || f1.refName;
1162
+ const ref2 = (assembly2 === null || assembly2 === void 0 ? void 0 : assembly2.getCanonicalRefName(f2.refName)) || f2.refName;
1163
+ const r1 = self.displayedRegions.find(r => r.refName === ref1);
1164
+ const r2 = (0, util_1.findLast)(self.displayedRegions, r => r.refName === ref2);
1165
+ if (!r1) {
1166
+ throw new Error(`could not find a region with refName "${ref1}"`);
1167
+ }
1168
+ if (!r2) {
1169
+ throw new Error(`could not find a region with refName "${ref2}"`);
1170
+ }
1171
+ const s1 = f1.start === undefined ? r1.start : f1.start;
1172
+ const e1 = f1.end === undefined ? r1.end : f1.end;
1173
+ const s2 = f2.start === undefined ? r2.start : f2.start;
1174
+ const e2 = f2.end === undefined ? r2.end : f2.end;
1175
+ const index = self.displayedRegions.findIndex(r => ref1 === r.refName &&
1176
+ s1 >= r.start &&
1177
+ s1 <= r.end &&
1178
+ e1 <= r.end &&
1179
+ e1 >= r.start);
1180
+ const index2 = self.displayedRegions.findIndex(r => ref2 === r.refName &&
1181
+ s2 >= r.start &&
1182
+ s2 <= r.end &&
1183
+ e2 <= r.end &&
1184
+ e2 >= r.start);
1185
+ if (index === -1 || index2 === -1) {
1186
+ throw new Error(`could not find a region that contained "${locations.map(l => (0, util_1.assembleLocString)(l))}"`);
1274
1187
  }
1188
+ const sd = self.displayedRegions[index];
1189
+ const ed = self.displayedRegions[index2];
1190
+ this.moveTo({
1191
+ index,
1192
+ offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
1193
+ }, {
1194
+ index: index2,
1195
+ offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
1196
+ });
1275
1197
  },
1276
1198
  }))
1277
1199
  .views(self => ({
@@ -1283,15 +1205,16 @@ function stateModelFactory(pluginManager) {
1283
1205
  {
1284
1206
  label: 'Zoom to region',
1285
1207
  icon: ZoomIn_1.default,
1286
- onClick: () => {
1287
- const { leftOffset, rightOffset } = self;
1288
- self.moveTo(leftOffset, rightOffset);
1289
- },
1208
+ onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1290
1209
  },
1291
1210
  {
1292
1211
  label: 'Get sequence',
1293
1212
  icon: MenuOpen_1.default,
1294
- onClick: () => self.setGetSequenceDialogOpen(true),
1213
+ onClick: () => (0, util_1.getSession)(self).queueDialog(handleClose => [
1214
+ GetSequenceDialog,
1215
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1216
+ { model: self, handleClose },
1217
+ ]),
1295
1218
  },
1296
1219
  ];
1297
1220
  },
@@ -1315,7 +1238,7 @@ function stateModelFactory(pluginManager) {
1315
1238
  coord,
1316
1239
  regionNumber,
1317
1240
  });
1318
- if (centerPx) {
1241
+ if (centerPx !== undefined) {
1319
1242
  self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2));
1320
1243
  }
1321
1244
  },
@@ -1345,6 +1268,6 @@ var SearchBox_1 = require("./components/SearchBox");
1345
1268
  Object.defineProperty(exports, "SearchBox", { enumerable: true, get: function () { return __importDefault(SearchBox_1).default; } });
1346
1269
  var ZoomControls_1 = require("./components/ZoomControls");
1347
1270
  Object.defineProperty(exports, "ZoomControls", { enumerable: true, get: function () { return __importDefault(ZoomControls_1).default; } });
1348
- var SVGLinearGenomeView_2 = require("./svgcomponents/SVGLinearGenomeView");
1349
- Object.defineProperty(exports, "renderToSvg", { enumerable: true, get: function () { return SVGLinearGenomeView_2.renderToSvg; } });
1271
+ var SVGLinearGenomeView_1 = require("./svgcomponents/SVGLinearGenomeView");
1272
+ Object.defineProperty(exports, "renderToSvg", { enumerable: true, get: function () { return SVGLinearGenomeView_1.renderToSvg; } });
1350
1273
  //# sourceMappingURL=model.js.map