@jbrowse/plugin-linear-genome-view 3.6.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/esm/BaseLinearDisplay/SVGLegend.d.ts +6 -0
  2. package/esm/BaseLinearDisplay/SVGLegend.js +17 -0
  3. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +2 -0
  4. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +11 -0
  5. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +3 -3
  6. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +13 -24
  7. package/esm/BaseLinearDisplay/components/Block.js +2 -2
  8. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +2 -2
  9. package/esm/BaseLinearDisplay/components/BlockMsg.js +11 -2
  10. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +9 -0
  11. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +42 -0
  12. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +11 -0
  13. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +40 -0
  14. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +19 -0
  15. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +45 -0
  16. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +5 -0
  17. package/esm/BaseLinearDisplay/components/FloatingLabels.js +89 -0
  18. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +8 -0
  19. package/esm/BaseLinearDisplay/components/FloatingLegend.js +43 -0
  20. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
  21. package/esm/BaseLinearDisplay/components/LinearBlocks.js +5 -42
  22. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +4 -0
  23. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +49 -0
  24. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +4 -0
  25. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +26 -0
  26. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
  27. package/esm/BaseLinearDisplay/components/MenuPage.js +24 -0
  28. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +19 -0
  29. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +48 -0
  30. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +12 -0
  31. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +22 -0
  32. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
  33. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -8
  34. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +3 -3
  35. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +2 -0
  36. package/esm/BaseLinearDisplay/components/Tooltip.js +10 -7
  37. package/esm/BaseLinearDisplay/components/types.d.ts +1 -0
  38. package/esm/BaseLinearDisplay/components/types.js +1 -0
  39. package/esm/BaseLinearDisplay/components/util.d.ts +21 -0
  40. package/esm/BaseLinearDisplay/components/util.js +116 -0
  41. package/esm/BaseLinearDisplay/index.d.ts +17 -8
  42. package/esm/BaseLinearDisplay/index.js +13 -6
  43. package/esm/BaseLinearDisplay/model.d.ts +1177 -0
  44. package/esm/BaseLinearDisplay/model.js +424 -0
  45. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +5 -5
  46. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +11 -14
  47. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +21 -0
  48. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +46 -0
  49. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +3 -3
  50. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +2 -3
  51. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
  52. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +2 -3
  53. package/esm/BaseLinearDisplay/models/calculateLabelPositions.d.ts +24 -0
  54. package/esm/BaseLinearDisplay/models/calculateLabelPositions.js +60 -0
  55. package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -2
  56. package/esm/BaseLinearDisplay/models/configSchema.js +3 -3
  57. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +3 -7
  58. package/esm/BaseLinearDisplay/models/renderSvg.js +22 -11
  59. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +37 -19
  60. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +151 -135
  61. package/esm/BaseLinearDisplay/models/util.d.ts +4 -4
  62. package/esm/BaseLinearDisplay/models/util.js +16 -13
  63. package/esm/BaseLinearDisplay/renderSvg.d.ts +3 -0
  64. package/esm/BaseLinearDisplay/renderSvg.js +59 -0
  65. package/esm/BaseLinearDisplay/types.d.ts +47 -0
  66. package/esm/BaseLinearDisplay/types.js +3 -0
  67. package/esm/BaseLinearDisplay/util.d.ts +15 -0
  68. package/esm/BaseLinearDisplay/util.js +61 -0
  69. package/esm/BasicTrack/configSchema.d.ts +16 -11
  70. package/esm/BasicTrack/index.js +1 -1
  71. package/esm/FeatureTrack/configSchema.d.ts +16 -11
  72. package/esm/FeatureTrack/index.js +1 -1
  73. package/esm/LaunchLinearGenomeView/index.js +12 -62
  74. package/esm/LinearBareDisplay/configSchema.d.ts +4 -4
  75. package/esm/LinearBareDisplay/configSchema.js +1 -1
  76. package/esm/LinearBareDisplay/index.d.ts +2 -2
  77. package/esm/LinearBareDisplay/index.js +5 -5
  78. package/esm/LinearBareDisplay/model.d.ts +959 -92
  79. package/esm/LinearBareDisplay/model.js +3 -6
  80. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +5 -0
  81. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +9 -0
  82. package/esm/LinearBasicDisplay/configSchema.d.ts +4 -4
  83. package/esm/LinearBasicDisplay/configSchema.js +1 -1
  84. package/esm/LinearBasicDisplay/index.d.ts +2 -2
  85. package/esm/LinearBasicDisplay/index.js +6 -6
  86. package/esm/LinearBasicDisplay/model.d.ts +1134 -122
  87. package/esm/LinearBasicDisplay/model.js +116 -116
  88. package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/AddFiltersDialog.js +2 -2
  89. package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/SetMaxHeightDialog.js +3 -3
  90. package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/configSchema.d.ts +4 -4
  91. package/esm/LinearFeatureDisplay/configSchema.js +11 -0
  92. package/esm/LinearFeatureDisplay/index.d.ts +3 -0
  93. package/esm/LinearFeatureDisplay/index.js +2 -0
  94. package/esm/LinearFeatureDisplay/model.d.ts +1415 -0
  95. package/esm/LinearFeatureDisplay/model.js +265 -0
  96. package/esm/LinearGenomeView/SVGErrorBox.d.ts +5 -0
  97. package/esm/LinearGenomeView/SVGErrorBox.js +4 -0
  98. package/esm/LinearGenomeView/afterAttach.d.ts +5 -0
  99. package/esm/LinearGenomeView/afterAttach.js +95 -0
  100. package/esm/LinearGenomeView/components/CenterLine.js +6 -4
  101. package/esm/LinearGenomeView/components/Cytobands.js +4 -4
  102. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
  103. package/esm/LinearGenomeView/components/ExportSvgDialog.js +5 -1
  104. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +8 -2
  105. package/esm/LinearGenomeView/components/GetSequenceDialog.js +13 -16
  106. package/esm/LinearGenomeView/components/Gridlines.js +18 -15
  107. package/esm/LinearGenomeView/components/Header.js +9 -9
  108. package/esm/LinearGenomeView/components/HeaderPanControls.js +2 -2
  109. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +4 -5
  110. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +2 -2
  111. package/esm/LinearGenomeView/components/HeaderZoomControls.js +3 -3
  112. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  113. package/esm/LinearGenomeView/components/Highlight.js +6 -6
  114. package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
  115. package/esm/LinearGenomeView/components/ImportForm.js +14 -12
  116. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +3 -3
  117. package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -7
  118. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +7 -8
  119. package/esm/LinearGenomeView/components/MiniControls.js +6 -6
  120. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +2 -2
  121. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +1 -1
  122. package/esm/LinearGenomeView/components/OverviewHighlight.js +5 -5
  123. package/esm/LinearGenomeView/components/OverviewRubberband.js +4 -4
  124. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +9 -5
  125. package/esm/LinearGenomeView/components/OverviewScalebar.js +36 -28
  126. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -5
  127. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +7 -7
  128. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +1 -1
  129. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +1 -1
  130. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +10 -10
  131. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +1 -1
  132. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +6 -4
  133. package/esm/LinearGenomeView/components/Rubberband.js +9 -7
  134. package/esm/LinearGenomeView/components/RubberbandSpan.js +4 -5
  135. package/esm/LinearGenomeView/components/Scalebar.js +8 -10
  136. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  137. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +50 -17
  138. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  139. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +13 -11
  140. package/esm/LinearGenomeView/components/SearchBox.d.ts +1 -1
  141. package/esm/LinearGenomeView/components/SearchBox.js +8 -9
  142. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +1 -1
  143. package/esm/LinearGenomeView/components/SearchResultsDialog.js +2 -2
  144. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/SearchResultsTable.js +4 -6
  146. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +6 -6
  147. package/esm/LinearGenomeView/components/TrackContainer.js +32 -20
  148. package/esm/LinearGenomeView/components/TrackLabel.js +10 -11
  149. package/esm/LinearGenomeView/components/TrackLabelContainer.js +7 -8
  150. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +1 -1
  151. package/esm/LinearGenomeView/components/TrackLabelMenu.js +80 -68
  152. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -2
  153. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +5 -5
  154. package/esm/LinearGenomeView/components/TracksContainer.js +18 -15
  155. package/esm/LinearGenomeView/components/VerticalGuide.js +5 -3
  156. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -2
  157. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +27 -2
  158. package/esm/LinearGenomeView/components/useRangeSelect.js +26 -20
  159. package/esm/LinearGenomeView/components/useWheelScroll.js +22 -12
  160. package/esm/LinearGenomeView/components/util.d.ts +2 -13
  161. package/esm/LinearGenomeView/components/util.js +12 -31
  162. package/esm/LinearGenomeView/index.d.ts +1 -1
  163. package/esm/LinearGenomeView/index.js +3 -3
  164. package/esm/LinearGenomeView/keyboardHandler.d.ts +2 -0
  165. package/esm/LinearGenomeView/keyboardHandler.js +29 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +7 -0
  167. package/esm/LinearGenomeView/menuItems.js +299 -0
  168. package/esm/LinearGenomeView/model.d.ts +92 -89
  169. package/esm/LinearGenomeView/model.js +166 -414
  170. package/esm/LinearGenomeView/svgExportUtil.d.ts +9 -0
  171. package/esm/LinearGenomeView/svgExportUtil.js +6 -0
  172. package/{dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts → esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts} +2 -2
  173. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +20 -0
  174. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +5 -5
  175. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +4 -3
  176. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +24 -12
  177. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +13 -5
  178. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +2 -2
  179. package/esm/LinearGenomeView/types.d.ts +5 -1
  180. package/esm/LinearGenomeView/util.d.ts +2 -2
  181. package/esm/LinearGenomeView/util.js +8 -6
  182. package/esm/index.d.ts +975 -94
  183. package/esm/index.js +37 -38
  184. package/esm/searchUtils.d.ts +1 -1
  185. package/esm/searchUtils.js +6 -4
  186. package/package.json +28 -33
  187. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  188. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -72
  189. package/dist/BaseLinearDisplay/components/Block.d.ts +0 -14
  190. package/dist/BaseLinearDisplay/components/Block.js +0 -50
  191. package/dist/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  192. package/dist/BaseLinearDisplay/components/BlockErrorMessage.js +0 -27
  193. package/dist/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
  194. package/dist/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -26
  195. package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  196. package/dist/BaseLinearDisplay/components/BlockMsg.js +0 -20
  197. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -9
  198. package/dist/BaseLinearDisplay/components/LinearBlocks.js +0 -61
  199. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -11
  200. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -59
  201. package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  202. package/dist/BaseLinearDisplay/components/TooLargeMessage.js +0 -25
  203. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -11
  204. package/dist/BaseLinearDisplay/components/Tooltip.js +0 -24
  205. package/dist/BaseLinearDisplay/index.d.ts +0 -8
  206. package/dist/BaseLinearDisplay/index.js +0 -20
  207. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
  208. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -325
  209. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  210. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -122
  211. package/dist/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  212. package/dist/BaseLinearDisplay/models/TrackHeightMixin.js +0 -35
  213. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  214. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -33
  215. package/dist/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  216. package/dist/BaseLinearDisplay/models/configSchema.js +0 -35
  217. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +0 -7
  218. package/dist/BaseLinearDisplay/models/renderSvg.js +0 -80
  219. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -78
  220. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -229
  221. package/dist/BaseLinearDisplay/models/util.d.ts +0 -22
  222. package/dist/BaseLinearDisplay/models/util.js +0 -45
  223. package/dist/BasicTrack/configSchema.d.ts +0 -80
  224. package/dist/BasicTrack/configSchema.js +0 -10
  225. package/dist/BasicTrack/index.d.ts +0 -2
  226. package/dist/BasicTrack/index.js +0 -18
  227. package/dist/FeatureTrack/configSchema.d.ts +0 -80
  228. package/dist/FeatureTrack/configSchema.js +0 -10
  229. package/dist/FeatureTrack/index.d.ts +0 -2
  230. package/dist/FeatureTrack/index.js +0 -19
  231. package/dist/LaunchLinearGenomeView/index.d.ts +0 -2
  232. package/dist/LaunchLinearGenomeView/index.js +0 -70
  233. package/dist/LinearBareDisplay/configSchema.d.ts +0 -32
  234. package/dist/LinearBareDisplay/configSchema.js +0 -13
  235. package/dist/LinearBareDisplay/index.d.ts +0 -4
  236. package/dist/LinearBareDisplay/index.js +0 -26
  237. package/dist/LinearBareDisplay/model.d.ts +0 -309
  238. package/dist/LinearBareDisplay/model.js +0 -38
  239. package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +0 -61
  240. package/dist/LinearBasicDisplay/components/SetMaxHeightDialog.js +0 -28
  241. package/dist/LinearBasicDisplay/configSchema.js +0 -13
  242. package/dist/LinearBasicDisplay/index.d.ts +0 -4
  243. package/dist/LinearBasicDisplay/index.js +0 -29
  244. package/dist/LinearBasicDisplay/model.d.ts +0 -346
  245. package/dist/LinearBasicDisplay/model.js +0 -192
  246. package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -6
  247. package/dist/LinearGenomeView/components/CenterLine.js +0 -38
  248. package/dist/LinearGenomeView/components/Cytobands.d.ts +0 -9
  249. package/dist/LinearGenomeView/components/Cytobands.js +0 -89
  250. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -7
  251. package/dist/LinearGenomeView/components/ExportSvgDialog.js +0 -57
  252. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -6
  253. package/dist/LinearGenomeView/components/GetSequenceDialog.js +0 -109
  254. package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -7
  255. package/dist/LinearGenomeView/components/Gridlines.js +0 -70
  256. package/dist/LinearGenomeView/components/Header.d.ts +0 -5
  257. package/dist/LinearGenomeView/components/Header.js +0 -38
  258. package/dist/LinearGenomeView/components/HeaderPanControls.d.ts +0 -6
  259. package/dist/LinearGenomeView/components/HeaderPanControls.js +0 -27
  260. package/dist/LinearGenomeView/components/HeaderRegionWidth.d.ts +0 -5
  261. package/dist/LinearGenomeView/components/HeaderRegionWidth.js +0 -21
  262. package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +0 -5
  263. package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.js +0 -19
  264. package/dist/LinearGenomeView/components/HeaderZoomControls.d.ts +0 -5
  265. package/dist/LinearGenomeView/components/HeaderZoomControls.js +0 -109
  266. package/dist/LinearGenomeView/components/Highlight.d.ts +0 -12
  267. package/dist/LinearGenomeView/components/Highlight.js +0 -95
  268. package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -6
  269. package/dist/LinearGenomeView/components/ImportForm.js +0 -80
  270. package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  271. package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -32
  272. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -5
  273. package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -57
  274. package/dist/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +0 -5
  275. package/dist/LinearGenomeView/components/LinearGenomeViewContainer.js +0 -98
  276. package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -5
  277. package/dist/LinearGenomeView/components/MiniControls.js +0 -36
  278. package/dist/LinearGenomeView/components/NoTracksActiveButton.d.ts +0 -5
  279. package/dist/LinearGenomeView/components/NoTracksActiveButton.js +0 -23
  280. package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +0 -8
  281. package/dist/LinearGenomeView/components/OverviewHighlight.js +0 -50
  282. package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +0 -9
  283. package/dist/LinearGenomeView/components/OverviewRubberband.js +0 -113
  284. package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +0 -10
  285. package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +0 -28
  286. package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +0 -7
  287. package/dist/LinearGenomeView/components/OverviewScalebar.js +0 -146
  288. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +0 -8
  289. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +0 -41
  290. package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +0 -10
  291. package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.js +0 -37
  292. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -8
  293. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -18
  294. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  295. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -56
  296. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  297. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -11
  298. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  299. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -127
  300. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  301. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -53
  302. package/dist/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +0 -6
  303. package/dist/LinearGenomeView/components/RegionWidthEditorDialog.js +0 -30
  304. package/dist/LinearGenomeView/components/Rubberband.d.ts +0 -7
  305. package/dist/LinearGenomeView/components/Rubberband.js +0 -35
  306. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  307. package/dist/LinearGenomeView/components/RubberbandSpan.js +0 -39
  308. package/dist/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  309. package/dist/LinearGenomeView/components/RubberbandTooltip.js +0 -20
  310. package/dist/LinearGenomeView/components/Scalebar.d.ts +0 -10
  311. package/dist/LinearGenomeView/components/Scalebar.js +0 -40
  312. package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +0 -6
  313. package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.js +0 -29
  314. package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
  315. package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -38
  316. package/dist/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +0 -6
  317. package/dist/LinearGenomeView/components/ScalebarRefNameLabels.js +0 -46
  318. package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -6
  319. package/dist/LinearGenomeView/components/SearchBox.js +0 -88
  320. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -9
  321. package/dist/LinearGenomeView/components/SearchResultsDialog.js +0 -15
  322. package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +0 -8
  323. package/dist/LinearGenomeView/components/SearchResultsTable.js +0 -74
  324. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -8
  325. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +0 -67
  326. package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -8
  327. package/dist/LinearGenomeView/components/TrackContainer.js +0 -51
  328. package/dist/LinearGenomeView/components/TrackLabel.d.ts +0 -7
  329. package/dist/LinearGenomeView/components/TrackLabel.js +0 -49
  330. package/dist/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  331. package/dist/LinearGenomeView/components/TrackLabelContainer.js +0 -31
  332. package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +0 -8
  333. package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +0 -32
  334. package/dist/LinearGenomeView/components/TrackLabelMenu.d.ts +0 -5
  335. package/dist/LinearGenomeView/components/TrackLabelMenu.js +0 -93
  336. package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +0 -9
  337. package/dist/LinearGenomeView/components/TrackRenderingContainer.js +0 -50
  338. package/dist/LinearGenomeView/components/TracksContainer.d.ts +0 -7
  339. package/dist/LinearGenomeView/components/TracksContainer.js +0 -84
  340. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -7
  341. package/dist/LinearGenomeView/components/VerticalGuide.js +0 -31
  342. package/dist/LinearGenomeView/components/fetchSequence.d.ts +0 -4
  343. package/dist/LinearGenomeView/components/fetchSequence.js +0 -29
  344. package/dist/LinearGenomeView/components/useRangeSelect.d.ts +0 -59
  345. package/dist/LinearGenomeView/components/useRangeSelect.js +0 -131
  346. package/dist/LinearGenomeView/components/useSideScroll.d.ts +0 -6
  347. package/dist/LinearGenomeView/components/useSideScroll.js +0 -60
  348. package/dist/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  349. package/dist/LinearGenomeView/components/useWheelScroll.js +0 -62
  350. package/dist/LinearGenomeView/components/util.d.ts +0 -25
  351. package/dist/LinearGenomeView/components/util.js +0 -49
  352. package/dist/LinearGenomeView/consts.d.ts +0 -7
  353. package/dist/LinearGenomeView/consts.js +0 -10
  354. package/dist/LinearGenomeView/index.d.ts +0 -3
  355. package/dist/LinearGenomeView/index.js +0 -53
  356. package/dist/LinearGenomeView/model.d.ts +0 -268
  357. package/dist/LinearGenomeView/model.js +0 -1109
  358. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  359. package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +0 -10
  360. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -7
  361. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +0 -47
  362. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +0 -6
  363. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +0 -42
  364. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +0 -8
  365. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -7
  366. package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +0 -39
  367. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -7
  368. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +0 -17
  369. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -7
  370. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +0 -14
  371. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -21
  372. package/dist/LinearGenomeView/svgcomponents/SVGTracks.js +0 -32
  373. package/dist/LinearGenomeView/svgcomponents/util.d.ts +0 -8
  374. package/dist/LinearGenomeView/svgcomponents/util.js +0 -8
  375. package/dist/LinearGenomeView/types.d.ts +0 -43
  376. package/dist/LinearGenomeView/types.js +0 -2
  377. package/dist/LinearGenomeView/util.d.ts +0 -26
  378. package/dist/LinearGenomeView/util.js +0 -138
  379. package/dist/index.d.ts +0 -353
  380. package/dist/index.js +0 -120
  381. package/dist/searchUtils.d.ts +0 -26
  382. package/dist/searchUtils.js +0 -80
  383. package/esm/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
  384. package/esm/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -24
  385. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
  386. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -286
  387. package/esm/LinearBasicDisplay/components/AddFiltersDialog.d.ts +0 -9
  388. package/esm/LinearBasicDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  389. package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
  390. package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -36
  391. /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/AddFiltersDialog.d.ts +0 -0
  392. /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/SetMaxHeightDialog.d.ts +0 -0
@@ -2,37 +2,25 @@ import { lazy } from 'react';
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
4
4
  import { VIEW_HEADER_HEIGHT } from '@jbrowse/core/ui';
5
- import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
6
- import { assembleLocString, clamp, findLast, getSession, isSessionModelWithWidgets, isSessionWithAddTracks, localStorageGetBoolean, localStorageGetItem, localStorageSetItem, measureText, springAnimate, sum, } from '@jbrowse/core/util';
5
+ import { assembleLocString, clamp, findLast, getBpDisplayStr, getSession, isSessionModelWithWidgets, localStorageGetBoolean, localStorageGetItem, measureText, springAnimate, sum, } from '@jbrowse/core/util';
7
6
  import { bpToPx, moveTo, pxToBp } from '@jbrowse/core/util/Base1DUtils';
8
7
  import Base1DView from '@jbrowse/core/util/Base1DViewModel';
9
8
  import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
10
9
  import calculateStaticBlocks from '@jbrowse/core/util/calculateStaticBlocks';
11
- import { getParentRenderProps } from '@jbrowse/core/util/tracks';
10
+ import { getParentRenderProps, hideTrackGeneric, showTrackGeneric, toggleTrackGeneric, } from '@jbrowse/core/util/tracks';
12
11
  import { ElementId } from '@jbrowse/core/util/types/mst';
12
+ import { cast, getParent, getSnapshot, types } from '@jbrowse/mobx-state-tree';
13
13
  import { isSessionWithMultipleViews } from '@jbrowse/product-core';
14
- import FolderOpenIcon from '@mui/icons-material/FolderOpen';
15
- import LabelIcon from '@mui/icons-material/Label';
16
- import MenuOpenIcon from '@mui/icons-material/MenuOpen';
17
- import PaletteIcon from '@mui/icons-material/Palette';
18
- import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
19
- import SearchIcon from '@mui/icons-material/Search';
20
- import SyncAltIcon from '@mui/icons-material/SyncAlt';
21
- import VisibilityIcon from '@mui/icons-material/Visibility';
22
- import ZoomInIcon from '@mui/icons-material/ZoomIn';
23
- import { saveAs } from 'file-saver';
24
- import { autorun, transaction, when } from 'mobx';
25
- import { addDisposer, cast, getParent, getRoot, getSnapshot, resolveIdentifier, types, } from 'mobx-state-tree';
26
- import Header from './components/Header';
27
- import { calculateVisibleLocStrings, generateLocations, parseLocStrings, } from './util';
28
- import { handleSelectedRegion } from '../searchUtils';
29
- import MiniControls from './components/MiniControls';
30
- import { HEADER_BAR_HEIGHT, HEADER_OVERVIEW_HEIGHT, INTER_REGION_PADDING_WIDTH, RESIZE_HANDLE_HEIGHT, SCALE_BAR_HEIGHT, } from './consts';
31
- const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
32
- const SequenceSearchDialog = lazy(() => import('./components/SequenceSearchDialog'));
33
- const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'));
34
- const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog'));
35
- const SearchResultsDialog = lazy(() => import('./components/SearchResultsDialog'));
14
+ import { when } from 'mobx';
15
+ import { handleSelectedRegion } from "../searchUtils.js";
16
+ import { doAfterAttach } from "./afterAttach.js";
17
+ import Header from "./components/Header.js";
18
+ import MiniControls from "./components/MiniControls.js";
19
+ import { HEADER_BAR_HEIGHT, HEADER_OVERVIEW_HEIGHT, INTER_REGION_PADDING_WIDTH, RESIZE_HANDLE_HEIGHT, SCALE_BAR_HEIGHT, } from "./consts.js";
20
+ import { setupKeyboardHandler } from "./keyboardHandler.js";
21
+ import { buildMenuItems, buildRubberBandMenuItems, buildRubberbandClickMenuItems, rewriteOnClicks, } from "./menuItems.js";
22
+ import { calculateVisibleLocStrings, generateLocations, parseLocStrings, } from "./util.js";
23
+ const SearchResultsDialog = lazy(() => import("./components/SearchResultsDialog.js"));
36
24
  export function stateModelFactory(pluginManager) {
37
25
  return types
38
26
  .compose('LinearGenomeView', BaseViewModel, types.model({
@@ -59,8 +47,8 @@ export function stateModelFactory(pluginManager) {
59
47
  volatileWidth: undefined,
60
48
  minimumBlockWidth: 3,
61
49
  draggingTrackId: undefined,
50
+ lastTrackDragY: undefined,
62
51
  volatileError: undefined,
63
- afterDisplayedRegionsSetCallbacks: [],
64
52
  scaleFactor: 1,
65
53
  trackRefs: {},
66
54
  coarseDynamicBlocks: [],
@@ -92,21 +80,14 @@ export function stateModelFactory(pluginManager) {
92
80
  return INTER_REGION_PADDING_WIDTH;
93
81
  },
94
82
  get assemblyNames() {
95
- return [
96
- ...new Set(self.displayedRegions.map(region => region.assemblyName)),
97
- ];
83
+ return [...new Set(self.displayedRegions.map(r => r.assemblyName))];
98
84
  },
99
85
  get assemblyDisplayNames() {
100
86
  const { assemblyManager } = getSession(self);
101
- return this.assemblyNames.map(assemblyName => {
102
- var _a;
103
- const assembly = assemblyManager.get(assemblyName);
104
- return (_a = assembly === null || assembly === void 0 ? void 0 : assembly.displayName) !== null && _a !== void 0 ? _a : assemblyName;
105
- });
87
+ return this.assemblyNames.map(a => assemblyManager.get(a)?.displayName ?? a);
106
88
  },
107
89
  get isTopLevelView() {
108
- const session = getSession(self);
109
- return session.views.some(r => r.id === self.id);
90
+ return getSession(self).views.some(r => r.id === self.id);
110
91
  },
111
92
  get stickyViewHeaders() {
112
93
  const session = getSession(self);
@@ -132,7 +113,7 @@ export function stateModelFactory(pluginManager) {
132
113
  },
133
114
  }))
134
115
  .views(self => ({
135
- scaleBarDisplayPrefix() {
116
+ scalebarDisplayPrefix() {
136
117
  return getParent(self, 2).type === 'LinearSyntenyView'
137
118
  ? self.assemblyDisplayNames[0]
138
119
  : '';
@@ -154,21 +135,41 @@ export function stateModelFactory(pluginManager) {
154
135
  get assemblyErrors() {
155
136
  const { assemblyManager } = getSession(self);
156
137
  return self.assemblyNames
157
- .map(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
138
+ .map(a => assemblyManager.get(a)?.error)
158
139
  .filter(f => !!f)
159
140
  .join(', ');
160
141
  },
161
142
  get assembliesInitialized() {
162
143
  const { assemblyManager } = getSession(self);
163
- return self.assemblyNames.every(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.initialized; });
144
+ return self.assemblyNames.every(a => assemblyManager.get(a)?.initialized);
164
145
  },
165
146
  get initialized() {
166
- return self.volatileWidth !== undefined && this.assembliesInitialized;
147
+ if (self.volatileWidth === undefined) {
148
+ return false;
149
+ }
150
+ if (self.init) {
151
+ const { assemblyManager } = getSession(self);
152
+ const asm = assemblyManager.get(self.init.assembly);
153
+ return !!(asm?.initialized && asm.regions);
154
+ }
155
+ return this.assembliesInitialized;
167
156
  },
168
157
  get hasDisplayedRegions() {
169
158
  return self.displayedRegions.length > 0;
170
159
  },
171
- get scaleBarHeight() {
160
+ get loadingMessage() {
161
+ return this.showLoading ? 'Loading' : undefined;
162
+ },
163
+ get hasSomethingToShow() {
164
+ return this.hasDisplayedRegions || !!self.init;
165
+ },
166
+ get showLoading() {
167
+ return !this.initialized && !this.error && this.hasSomethingToShow;
168
+ },
169
+ get showImportForm() {
170
+ return !this.hasSomethingToShow || !!this.error;
171
+ },
172
+ get scalebarHeight() {
172
173
  return SCALE_BAR_HEIGHT + RESIZE_HANDLE_HEIGHT;
173
174
  },
174
175
  get headerHeight() {
@@ -191,7 +192,7 @@ export function stateModelFactory(pluginManager) {
191
192
  get height() {
192
193
  return (this.trackHeightsWithResizeHandles +
193
194
  this.headerHeight +
194
- this.scaleBarHeight);
195
+ this.scalebarHeight);
195
196
  },
196
197
  get totalBp() {
197
198
  return sum(self.displayedRegions.map(r => r.end - r.start));
@@ -203,7 +204,26 @@ export function stateModelFactory(pluginManager) {
203
204
  return 1 / 50;
204
205
  },
205
206
  get error() {
206
- return (self.volatileError || this.assemblyErrors || this.assembliesNotFound);
207
+ if (self.volatileError) {
208
+ return self.volatileError;
209
+ }
210
+ if (this.assemblyErrors) {
211
+ return this.assemblyErrors;
212
+ }
213
+ if (this.assembliesNotFound) {
214
+ return this.assembliesNotFound;
215
+ }
216
+ if (self.init) {
217
+ const { assemblyManager } = getSession(self);
218
+ const asm = assemblyManager.get(self.init.assembly);
219
+ if (asm?.error) {
220
+ return asm.error;
221
+ }
222
+ if (!asm) {
223
+ return `Assembly ${self.init.assembly} not found`;
224
+ }
225
+ }
226
+ return undefined;
207
227
  },
208
228
  get maxOffset() {
209
229
  const leftPadding = 10;
@@ -230,36 +250,26 @@ export function stateModelFactory(pluginManager) {
230
250
  tracks: self.tracks,
231
251
  };
232
252
  },
253
+ get trackMap() {
254
+ const map = new Map();
255
+ for (const track of self.tracks) {
256
+ map.set(track.configuration.trackId, track);
257
+ }
258
+ return map;
259
+ },
233
260
  getTrack(id) {
234
- return self.tracks.find(t => t.configuration.trackId === id);
261
+ return this.trackMap.get(id);
235
262
  },
236
263
  rankSearchResults(results) {
237
264
  return results;
238
265
  },
239
- rewriteOnClicks(trackType, viewMenuActions) {
240
- for (const action of viewMenuActions) {
241
- if ('subMenu' in action) {
242
- this.rewriteOnClicks(trackType, action.subMenu);
243
- }
244
- if ('onClick' in action) {
245
- const holdOnClick = action.onClick;
246
- action.onClick = (...args) => {
247
- for (const track of self.tracks) {
248
- if (track.type === trackType) {
249
- holdOnClick.apply(track, [track, ...args]);
250
- }
251
- }
252
- };
253
- }
254
- }
255
- },
256
266
  get trackTypeActions() {
257
267
  const allActions = new Map();
258
268
  for (const track of self.tracks) {
259
269
  const trackInMap = allActions.get(track.type);
260
270
  if (!trackInMap) {
261
271
  const viewMenuActions = structuredClone(track.viewMenuActions);
262
- this.rewriteOnClicks(track.type, viewMenuActions);
272
+ rewriteOnClicks(self, track.type, viewMenuActions);
263
273
  allActions.set(track.type, viewMenuActions);
264
274
  }
265
275
  }
@@ -319,8 +329,9 @@ export function stateModelFactory(pluginManager) {
319
329
  return oldBpPerPx;
320
330
  }
321
331
  self.bpPerPx = newBpPerPx;
322
- this.scrollTo(Math.round(((self.offsetPx + offset) * oldBpPerPx) / newBpPerPx -
323
- (centerAtOffset ? self.width / 2 : offset)));
332
+ const newOffsetPx = Math.round(((self.offsetPx + offset) * oldBpPerPx) / newBpPerPx -
333
+ (centerAtOffset ? self.width / 2 : offset));
334
+ this.scrollTo(newOffsetPx);
324
335
  return newBpPerPx;
325
336
  },
326
337
  setOffsets(left, right) {
@@ -350,58 +361,15 @@ export function stateModelFactory(pluginManager) {
350
361
  this.scrollTo(self.totalBp / self.bpPerPx - self.offsetPx - self.width);
351
362
  },
352
363
  showTrack(trackId, initialSnapshot = {}, displayInitialSnapshot = {}) {
353
- const schema = pluginManager.pluggableConfigSchemaType('track');
354
- const conf = resolveIdentifier(schema, getRoot(self), trackId);
355
- if (!conf) {
356
- throw new Error(`Could not resolve identifier "${trackId}"`);
357
- }
358
- const trackType = pluginManager.getTrackType(conf === null || conf === void 0 ? void 0 : conf.type);
359
- if (!trackType) {
360
- throw new Error(`Unknown track type ${conf.type}`);
361
- }
362
- const viewType = pluginManager.getViewType(self.type);
363
- const supportedDisplays = new Set(viewType.displayTypes.map(d => d.name));
364
- const displayConf = conf.displays.find((d) => supportedDisplays.has(d.type));
365
- if (!displayConf) {
366
- throw new Error(`Could not find a compatible display for view type ${self.type}`);
367
- }
368
- const t = self.tracks.filter(t => t.configuration === conf);
369
- if (t.length === 0) {
370
- const track = trackType.stateModel.create({
371
- ...initialSnapshot,
372
- type: conf.type,
373
- configuration: conf,
374
- displays: [
375
- {
376
- type: displayConf.type,
377
- configuration: displayConf,
378
- ...displayInitialSnapshot,
379
- },
380
- ],
381
- });
382
- self.tracks.push(track);
383
- return track;
384
- }
385
- return t[0];
364
+ return showTrackGeneric(self, trackId, initialSnapshot, displayInitialSnapshot);
386
365
  },
387
366
  hideTrack(trackId) {
388
- const schema = pluginManager.pluggableConfigSchemaType('track');
389
- const conf = resolveIdentifier(schema, getRoot(self), trackId);
390
- const tracks = self.tracks.filter(t => t.configuration === conf);
391
- transaction(() => {
392
- for (const track of tracks) {
393
- self.tracks.remove(track);
394
- }
395
- });
396
- return tracks.length;
367
+ return hideTrackGeneric(self, trackId);
397
368
  },
398
369
  }))
399
370
  .actions(self => ({
400
371
  moveTrackDown(id) {
401
372
  const idx = self.tracks.findIndex(v => v.id === id);
402
- if (idx === -1) {
403
- return;
404
- }
405
373
  if (idx !== -1 && idx < self.tracks.length - 1) {
406
374
  self.tracks.splice(idx, 2, self.tracks[idx + 1], self.tracks[idx]);
407
375
  }
@@ -413,18 +381,16 @@ export function stateModelFactory(pluginManager) {
413
381
  }
414
382
  },
415
383
  moveTrackToTop(id) {
416
- const idx = self.tracks.findIndex(track => track.id === id);
417
- self.tracks = cast([
418
- self.tracks[idx],
419
- ...self.tracks.filter(track => track.id !== id),
420
- ]);
384
+ const track = self.tracks.find(track => track.id === id);
385
+ if (track) {
386
+ self.tracks = cast([track, ...self.tracks.filter(t => t.id !== id)]);
387
+ }
421
388
  },
422
389
  moveTrackToBottom(id) {
423
- const idx = self.tracks.findIndex(track => track.id === id);
424
- self.tracks = cast([
425
- ...self.tracks.filter(track => track.id !== id),
426
- self.tracks[idx],
427
- ]);
390
+ const track = self.tracks.find(track => track.id === id);
391
+ if (track) {
392
+ self.tracks = cast([...self.tracks.filter(t => t.id !== id), track]);
393
+ }
428
394
  },
429
395
  moveTrack(movingId, targetId) {
430
396
  const oldIndex = self.tracks.findIndex(track => track.id === movingId);
@@ -440,15 +406,9 @@ export function stateModelFactory(pluginManager) {
440
406
  self.tracks = cast(tracks);
441
407
  },
442
408
  toggleTrack(trackId) {
443
- const hiddenCount = self.hideTrack(trackId);
444
- if (!hiddenCount) {
445
- self.showTrack(trackId);
446
- return true;
447
- }
448
- return false;
409
+ toggleTrackGeneric(self, trackId);
449
410
  },
450
411
  setTrackLabels(setting) {
451
- localStorage.setItem('lgv-trackLabels', setting);
452
412
  self.trackLabels = setting;
453
413
  },
454
414
  setShowCenterLine(b) {
@@ -478,26 +438,27 @@ export function stateModelFactory(pluginManager) {
478
438
  simView.setVolatileWidth(self.width);
479
439
  simView.moveTo(leftOffset, rightOffset);
480
440
  return simView.dynamicBlocks.contentBlocks.map(region => ({
481
- ...region,
441
+ assemblyName: region.assemblyName,
442
+ refName: region.refName,
482
443
  start: Math.floor(region.start),
483
444
  end: Math.ceil(region.end),
484
445
  }));
485
446
  },
486
- afterDisplayedRegionsSet(cb) {
487
- self.afterDisplayedRegionsSetCallbacks.push(cb);
488
- },
489
447
  horizontalScroll(distance) {
490
448
  const oldOffsetPx = self.offsetPx;
491
449
  const newOffsetPx = self.scrollTo(self.offsetPx + distance);
492
450
  return newOffsetPx - oldOffsetPx;
493
451
  },
494
452
  center() {
495
- const centerBp = self.totalBp / 2;
496
- const centerPx = centerBp / self.bpPerPx;
497
- self.scrollTo(Math.round(centerPx - self.width / 2));
453
+ const numPaddings = Math.max(0, self.displayedRegions.length - 1);
454
+ const totalPaddingPx = numPaddings * self.interRegionPaddingWidth;
455
+ const totalContentPx = self.totalBp / self.bpPerPx + totalPaddingPx;
456
+ const centerPx = totalContentPx / 2;
457
+ const targetOffsetPx = Math.round(centerPx - self.width / 2);
458
+ self.scrollTo(targetOffsetPx);
498
459
  },
499
460
  showAllRegions() {
500
- self.zoomTo(self.maxBpPerPx);
461
+ self.bpPerPx = clamp(self.maxBpPerPx, self.minBpPerPx, self.maxBpPerPx);
501
462
  this.center();
502
463
  },
503
464
  showAllRegionsInAssembly(assemblyName) {
@@ -512,18 +473,22 @@ export function stateModelFactory(pluginManager) {
512
473
  ;
513
474
  [assemblyName] = [...names];
514
475
  }
515
- const assembly = assemblyManager.get(assemblyName);
516
- if (assembly) {
517
- const { regions } = assembly;
518
- if (regions) {
519
- this.setDisplayedRegions(regions);
520
- self.zoomTo(self.maxBpPerPx);
521
- this.center();
522
- }
476
+ const regions = assemblyManager.get(assemblyName)?.regions;
477
+ if (!regions) {
478
+ return;
523
479
  }
480
+ this.setDisplayedRegions(regions);
481
+ self.zoomTo(self.maxBpPerPx);
482
+ this.center();
524
483
  },
525
484
  setDraggingTrackId(idx) {
526
485
  self.draggingTrackId = idx;
486
+ if (idx === undefined) {
487
+ self.lastTrackDragY = undefined;
488
+ }
489
+ },
490
+ setLastTrackDragY(y) {
491
+ self.lastTrackDragY = y;
527
492
  },
528
493
  setScaleFactor(factor) {
529
494
  self.scaleFactor = factor;
@@ -538,10 +503,10 @@ export function stateModelFactory(pluginManager) {
538
503
  self.init = arg;
539
504
  },
540
505
  async exportSvg(opts = {}) {
541
- const { renderToSvg } = await import('./svgcomponents/SVGLinearGenomeView');
506
+ const { renderToSvg } = await import("./svgcomponents/SVGLinearGenomeView.js");
542
507
  const html = await renderToSvg(self, opts);
543
- const blob = new Blob([html], { type: 'image/svg+xml' });
544
- saveAs(blob, opts.filename || 'image.svg');
508
+ const { saveAs } = await import('file-saver-es');
509
+ saveAs(new Blob([html], { type: 'image/svg+xml' }), opts.filename || 'image.svg');
545
510
  },
546
511
  }))
547
512
  .actions(self => {
@@ -557,6 +522,8 @@ export function stateModelFactory(pluginManager) {
557
522
  .actions(self => {
558
523
  let cancelLastAnimation = () => { };
559
524
  function zoom(targetBpPerPx) {
525
+ cancelLastAnimation();
526
+ self.setScaleFactor(1);
560
527
  self.zoomTo(self.bpPerPx);
561
528
  if ((targetBpPerPx < self.bpPerPx && self.bpPerPx === self.minBpPerPx) ||
562
529
  (targetBpPerPx > self.bpPerPx && self.bpPerPx === self.maxBpPerPx)) {
@@ -567,7 +534,6 @@ export function stateModelFactory(pluginManager) {
567
534
  self.zoomTo(targetBpPerPx);
568
535
  self.setScaleFactor(1);
569
536
  });
570
- cancelLastAnimation();
571
537
  cancelLastAnimation = cancelAnimation;
572
538
  animate();
573
539
  }
@@ -582,207 +548,35 @@ export function stateModelFactory(pluginManager) {
582
548
  },
583
549
  get anyCytobandsExist() {
584
550
  const { assemblyManager } = getSession(self);
585
- return self.assemblyNames.some(a => { var _a, _b; return (_b = (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.cytobands) === null || _b === void 0 ? void 0 : _b.length; });
551
+ return self.assemblyNames.some(a => assemblyManager.get(a)?.cytobands?.length);
586
552
  },
587
553
  get cytobandOffset() {
588
- var _a;
589
554
  return this.showCytobands
590
- ? measureText(((_a = self.displayedRegions[0]) === null || _a === void 0 ? void 0 : _a.refName) || '', 12) + 15
555
+ ? measureText(self.displayedRegions[0]?.refName || '', 12) + 15
591
556
  : 0;
592
557
  },
593
558
  }))
594
559
  .views(self => ({
595
560
  menuItems() {
596
- const { canShowCytobands, showCytobands } = self;
597
- const session = getSession(self);
598
- const menuItems = [
599
- {
600
- label: 'Return to import form',
601
- onClick: () => {
602
- getSession(self).queueDialog(handleClose => [
603
- ReturnToImportFormDialog,
604
- { model: self, handleClose },
605
- ]);
606
- },
607
- icon: FolderOpenIcon,
608
- },
609
- ...(isSessionWithAddTracks(session)
610
- ? [
611
- {
612
- label: 'Sequence search',
613
- icon: SearchIcon,
614
- onClick: () => {
615
- getSession(self).queueDialog(handleClose => [
616
- SequenceSearchDialog,
617
- {
618
- model: self,
619
- handleClose,
620
- },
621
- ]);
622
- },
623
- },
624
- ]
625
- : []),
626
- {
627
- label: 'Export SVG',
628
- icon: PhotoCameraIcon,
629
- onClick: () => {
630
- getSession(self).queueDialog(handleClose => [
631
- ExportSvgDialog,
632
- {
633
- model: self,
634
- handleClose,
635
- },
636
- ]);
637
- },
638
- },
639
- {
640
- label: 'Open track selector',
641
- onClick: self.activateTrackSelector,
642
- icon: TrackSelectorIcon,
643
- },
644
- {
645
- label: 'Horizontally flip',
646
- icon: SyncAltIcon,
647
- onClick: self.horizontallyFlip,
648
- },
649
- {
650
- label: 'Color by CDS',
651
- type: 'checkbox',
652
- checked: self.colorByCDS,
653
- icon: PaletteIcon,
654
- onClick: () => {
655
- self.setColorByCDS(!self.colorByCDS);
656
- },
657
- },
658
- {
659
- label: 'Show...',
660
- icon: VisibilityIcon,
661
- subMenu: [
662
- {
663
- label: 'Show all regions in assembly',
664
- onClick: self.showAllRegionsInAssembly,
665
- },
666
- {
667
- label: 'Show center line',
668
- type: 'checkbox',
669
- checked: self.showCenterLine,
670
- onClick: () => {
671
- self.setShowCenterLine(!self.showCenterLine);
672
- },
673
- },
674
- {
675
- label: 'Show header',
676
- type: 'checkbox',
677
- checked: !self.hideHeader,
678
- onClick: () => {
679
- self.setHideHeader(!self.hideHeader);
680
- },
681
- },
682
- {
683
- label: 'Show track outlines',
684
- type: 'checkbox',
685
- checked: self.showTrackOutlines,
686
- onClick: () => {
687
- self.setShowTrackOutlines(!self.showTrackOutlines);
688
- },
689
- },
690
- {
691
- label: 'Show header overview',
692
- type: 'checkbox',
693
- checked: !self.hideHeaderOverview,
694
- onClick: () => {
695
- self.setHideHeaderOverview(!self.hideHeaderOverview);
696
- },
697
- disabled: self.hideHeader,
698
- },
699
- {
700
- label: 'Show no tracks active button',
701
- type: 'checkbox',
702
- checked: !self.hideNoTracksActive,
703
- onClick: () => {
704
- self.setHideNoTracksActive(!self.hideNoTracksActive);
705
- },
706
- },
707
- {
708
- label: 'Show guidelines',
709
- type: 'checkbox',
710
- checked: self.showGridlines,
711
- onClick: () => {
712
- self.setShowGridlines(!self.showGridlines);
713
- },
714
- },
715
- ...(canShowCytobands
716
- ? [
717
- {
718
- label: 'Show ideogram',
719
- type: 'checkbox',
720
- checked: self.showCytobands,
721
- onClick: () => {
722
- self.setShowCytobands(!showCytobands);
723
- },
724
- },
725
- ]
726
- : []),
727
- ],
728
- },
729
- {
730
- label: 'Track labels',
731
- icon: LabelIcon,
732
- subMenu: [
733
- {
734
- label: 'Overlapping',
735
- icon: VisibilityIcon,
736
- type: 'radio',
737
- checked: self.trackLabelsSetting === 'overlapping',
738
- onClick: () => {
739
- self.setTrackLabels('overlapping');
740
- },
741
- },
742
- {
743
- label: 'Offset',
744
- icon: VisibilityIcon,
745
- type: 'radio',
746
- checked: self.trackLabelsSetting === 'offset',
747
- onClick: () => {
748
- self.setTrackLabels('offset');
749
- },
750
- },
751
- {
752
- label: 'Hidden',
753
- icon: VisibilityIcon,
754
- type: 'radio',
755
- checked: self.trackLabelsSetting === 'hidden',
756
- onClick: () => {
757
- self.setTrackLabels('hidden');
758
- },
759
- },
760
- ],
761
- },
762
- ];
763
- for (const [key, value] of self.trackTypeActions.entries()) {
764
- if (value.length) {
765
- menuItems.push({ type: 'divider' }, { type: 'subHeader', label: key });
766
- for (const action of value) {
767
- menuItems.push(action);
768
- }
769
- }
770
- }
771
- return menuItems;
561
+ return buildMenuItems(self);
772
562
  },
773
563
  }))
774
564
  .views(self => {
775
565
  let currentlyCalculatedStaticBlocks;
776
- let stringifiedCurrentlyCalculatedStaticBlocks = '';
566
+ let currentBlockKeys;
777
567
  return {
778
568
  get staticBlocks() {
779
- const ret = calculateStaticBlocks(self);
780
- const sret = JSON.stringify(ret);
781
- if (stringifiedCurrentlyCalculatedStaticBlocks !== sret) {
782
- currentlyCalculatedStaticBlocks = ret;
783
- stringifiedCurrentlyCalculatedStaticBlocks = sret;
569
+ const newBlocks = calculateStaticBlocks(self);
570
+ const newKeys = newBlocks.blocks.map(b => b.key).join(',');
571
+ if (currentlyCalculatedStaticBlocks === undefined ||
572
+ currentBlockKeys !== newKeys) {
573
+ currentlyCalculatedStaticBlocks = newBlocks;
574
+ currentBlockKeys = newKeys;
575
+ return currentlyCalculatedStaticBlocks;
576
+ }
577
+ else {
578
+ return currentlyCalculatedStaticBlocks;
784
579
  }
785
- return currentlyCalculatedStaticBlocks;
786
580
  },
787
581
  get dynamicBlocks() {
788
582
  return calculateDynamicBlocks(self);
@@ -800,6 +594,9 @@ export function stateModelFactory(pluginManager) {
800
594
  get coarseVisibleLocStrings() {
801
595
  return calculateVisibleLocStrings(self.coarseDynamicBlocks);
802
596
  },
597
+ get coarseTotalBpDisplayStr() {
598
+ return getBpDisplayStr(self.coarseTotalBp);
599
+ },
803
600
  };
804
601
  })
805
602
  .actions(self => ({
@@ -851,8 +648,8 @@ export function stateModelFactory(pluginManager) {
851
648
  ]);
852
649
  this.navTo({
853
650
  ...location,
854
- start: clamp(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
855
- end: clamp(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end),
651
+ start: clamp(start ?? 0, 0, parentRegion.end),
652
+ end: clamp(end ?? parentRegion.end, 0, parentRegion.end),
856
653
  });
857
654
  }
858
655
  else {
@@ -884,11 +681,11 @@ export function stateModelFactory(pluginManager) {
884
681
  const defaultAssemblyName = self.assemblyNames[0];
885
682
  const { assemblyManager } = getSession(self);
886
683
  const firstAssembly = assemblyManager.get(firstLocation.assemblyName || defaultAssemblyName);
887
- const firstRefName = (firstAssembly === null || firstAssembly === void 0 ? void 0 : firstAssembly.getCanonicalRefName(firstLocation.refName)) ||
684
+ const firstRefName = firstAssembly?.getCanonicalRefName(firstLocation.refName) ||
888
685
  firstLocation.refName;
889
686
  const firstRegion = self.displayedRegions.find(r => r.refName === firstRefName);
890
687
  const lastAssembly = assemblyManager.get(lastLocation.assemblyName || defaultAssemblyName);
891
- const lastRefName = (lastAssembly === null || lastAssembly === void 0 ? void 0 : lastAssembly.getCanonicalRefName(lastLocation.refName)) ||
688
+ const lastRefName = lastAssembly?.getCanonicalRefName(lastLocation.refName) ||
892
689
  lastLocation.refName;
893
690
  const lastRegion = findLast(self.displayedRegions, r => r.refName === lastRefName);
894
691
  if (!firstRegion) {
@@ -937,25 +734,7 @@ export function stateModelFactory(pluginManager) {
937
734
  }))
938
735
  .views(self => ({
939
736
  rubberBandMenuItems() {
940
- return [
941
- {
942
- label: 'Zoom to region',
943
- icon: ZoomInIcon,
944
- onClick: () => {
945
- self.moveTo(self.leftOffset, self.rightOffset);
946
- },
947
- },
948
- {
949
- label: 'Get sequence',
950
- icon: MenuOpenIcon,
951
- onClick: () => {
952
- getSession(self).queueDialog(handleClose => [
953
- GetSequenceDialog,
954
- { model: self, handleClose },
955
- ]);
956
- },
957
- },
958
- ];
737
+ return buildRubberBandMenuItems(self);
959
738
  },
960
739
  bpToPx({ refName, coord, regionNumber, }) {
961
740
  return bpToPx({ refName, coord, regionNumber, self });
@@ -978,62 +757,21 @@ export function stateModelFactory(pluginManager) {
978
757
  ? this.pxToBp(self.width / 2)
979
758
  : undefined;
980
759
  },
760
+ get visibleRegions() {
761
+ return self.dynamicBlocks.contentBlocks;
762
+ },
763
+ }))
764
+ .views(self => ({
765
+ rubberbandClickMenuItems(clickOffset) {
766
+ return buildRubberbandClickMenuItems(self, clickOffset);
767
+ },
981
768
  }))
982
769
  .actions(self => ({
983
770
  afterCreate() {
984
- function handler(e) {
985
- const session = getSession(self);
986
- if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
987
- if (e.code === 'ArrowLeft') {
988
- e.preventDefault();
989
- self.slide(-0.9);
990
- }
991
- else if (e.code === 'ArrowRight') {
992
- e.preventDefault();
993
- self.slide(0.9);
994
- }
995
- else if (e.code === 'ArrowUp' && self.scaleFactor === 1) {
996
- e.preventDefault();
997
- self.zoom(self.bpPerPx / 2);
998
- }
999
- else if (e.code === 'ArrowDown' && self.scaleFactor === 1) {
1000
- e.preventDefault();
1001
- self.zoom(self.bpPerPx * 2);
1002
- }
1003
- }
1004
- }
1005
- document.addEventListener('keydown', handler);
1006
- addDisposer(self, () => {
1007
- document.removeEventListener('keydown', handler);
1008
- });
771
+ setupKeyboardHandler(self);
1009
772
  },
1010
773
  afterAttach() {
1011
- addDisposer(self, autorun(() => {
1012
- var _a;
1013
- const { init } = self;
1014
- if (init) {
1015
- self
1016
- .navToLocString(init.loc, init.assembly)
1017
- .catch((e) => {
1018
- console.error(init, e);
1019
- getSession(self).notifyError(`${e}`, e);
1020
- });
1021
- (_a = init.tracks) === null || _a === void 0 ? void 0 : _a.map(t => self.showTrack(t));
1022
- self.setInit(undefined);
1023
- }
1024
- }));
1025
- addDisposer(self, autorun(() => {
1026
- if (self.initialized) {
1027
- self.setCoarseDynamicBlocks(self.dynamicBlocks);
1028
- }
1029
- }, { delay: 150 }));
1030
- addDisposer(self, autorun(() => {
1031
- const s = (s) => JSON.stringify(s);
1032
- const { showCytobandsSetting, showCenterLine, colorByCDS } = self;
1033
- localStorageSetItem('lgv-showCytobands', s(showCytobandsSetting));
1034
- localStorageSetItem('lgv-showCenterLine', s(showCenterLine));
1035
- localStorageSetItem('lgv-colorByCDS', s(colorByCDS));
1036
- }));
774
+ doAfterAttach(self);
1037
775
  },
1038
776
  }))
1039
777
  .preProcessSnapshot(snap => {
@@ -1052,13 +790,27 @@ export function stateModelFactory(pluginManager) {
1052
790
  if (!snap) {
1053
791
  return snap;
1054
792
  }
1055
- else {
1056
- const { init, ...rest } = snap;
1057
- return rest;
1058
- }
793
+ const { init, offsetPx, bpPerPx, hideHeader, hideHeaderOverview, hideNoTracksActive, showGridlines, trackSelectorType, displayedRegions, highlight, showCenterLine, showCytobandsSetting, trackLabels, colorByCDS, showTrackOutlines, ...rest } = snap;
794
+ return {
795
+ ...rest,
796
+ ...(offsetPx ? { offsetPx } : {}),
797
+ ...(bpPerPx !== 1 ? { bpPerPx } : {}),
798
+ ...(hideHeader ? { hideHeader } : {}),
799
+ ...(hideHeaderOverview ? { hideHeaderOverview } : {}),
800
+ ...(hideNoTracksActive ? { hideNoTracksActive } : {}),
801
+ ...(!showGridlines ? { showGridlines } : {}),
802
+ ...(trackSelectorType !== 'hierarchical' ? { trackSelectorType } : {}),
803
+ ...(displayedRegions.length ? { displayedRegions } : {}),
804
+ ...(highlight.length ? { highlight } : {}),
805
+ ...(showCenterLine ? { showCenterLine } : {}),
806
+ ...(!showCytobandsSetting ? { showCytobandsSetting } : {}),
807
+ ...(trackLabels ? { trackLabels } : {}),
808
+ ...(colorByCDS ? { colorByCDS } : {}),
809
+ ...(!showTrackOutlines ? { showTrackOutlines } : {}),
810
+ };
1059
811
  });
1060
812
  }
1061
- export { default as LinearGenomeView, default as ReactComponent, } from './components/LinearGenomeView';
1062
- export { default as RefNameAutocomplete } from './components/RefNameAutocomplete';
1063
- export { default as SearchBox } from './components/SearchBox';
1064
- export { renderToSvg } from './svgcomponents/SVGLinearGenomeView';
813
+ export { default as LinearGenomeView, default as ReactComponent, } from "./components/LinearGenomeView.js";
814
+ export { default as RefNameAutocomplete } from "./components/RefNameAutocomplete/index.js";
815
+ export { default as SearchBox } from "./components/SearchBox.js";
816
+ export { renderToSvg } from "./svgcomponents/SVGLinearGenomeView.js";