@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.10

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 (363) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +202 -71
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +265 -120
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +20 -9
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +142 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +8 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +42 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +18 -8
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +38 -52
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +21 -25
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +13 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -6
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +14 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +25 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +87 -83
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +56 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
  81. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
  83. package/esm/LinearGenomeView/components/Rubberband.js +15 -17
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  87. package/esm/LinearGenomeView/components/Scalebar.js +20 -22
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +61 -68
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
  147. package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
  148. package/esm/LinearGenomeView/components/util.d.ts +24 -6
  149. package/esm/LinearGenomeView/components/util.js +28 -5
  150. package/esm/LinearGenomeView/consts.d.ts +9 -2
  151. package/esm/LinearGenomeView/consts.js +20 -2
  152. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  153. package/esm/LinearGenomeView/containingLgv.js +23 -0
  154. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  155. package/esm/LinearGenomeView/flyTo.js +135 -0
  156. package/esm/LinearGenomeView/headerFit.d.ts +29 -0
  157. package/esm/LinearGenomeView/headerFit.js +72 -0
  158. package/esm/LinearGenomeView/index.d.ts +28 -3
  159. package/esm/LinearGenomeView/index.js +13 -7
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +25 -1
  162. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  163. package/esm/LinearGenomeView/launchKeys.js +27 -0
  164. package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
  165. package/esm/LinearGenomeView/lazyDialogs.js +4 -3
  166. package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
  167. package/esm/LinearGenomeView/linkedViewSync.js +36 -0
  168. package/esm/LinearGenomeView/menuItems.d.ts +25 -2
  169. package/esm/LinearGenomeView/menuItems.js +306 -179
  170. package/esm/LinearGenomeView/model.d.ts +3363 -164
  171. package/esm/LinearGenomeView/model.js +2548 -565
  172. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  173. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  174. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  175. package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
  176. package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
  177. package/esm/LinearGenomeView/stickyChrome.js +26 -0
  178. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  179. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
  180. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
  181. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  185. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  186. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  187. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
  188. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  189. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
  190. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  191. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
  192. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  193. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
  194. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  195. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
  197. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  198. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  199. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
  200. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
  201. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
  202. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  203. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  204. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  205. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  206. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  207. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  208. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  209. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
  210. package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
  211. package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
  212. package/esm/LinearGenomeView/types.d.ts +20 -37
  213. package/esm/LinearGenomeView/types.js +1 -0
  214. package/esm/LinearGenomeView/util.d.ts +347 -12
  215. package/esm/LinearGenomeView/util.js +577 -62
  216. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  217. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
  218. package/esm/MultiLevelRubberband/index.d.ts +4 -0
  219. package/esm/MultiLevelRubberband/index.js +3 -0
  220. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  221. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  222. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  223. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  224. package/esm/MultiLevelRubberband/types.d.ts +7 -0
  225. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
  226. package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
  227. package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
  228. package/esm/displayKitTests/perRegionTestEnv.js +142 -0
  229. package/esm/index.d.ts +50 -1245
  230. package/esm/index.js +88 -33
  231. package/esm/searchUtils.d.ts +62 -12
  232. package/esm/searchUtils.js +335 -48
  233. package/esm/shared/RubberbandSpan.d.ts +15 -0
  234. package/esm/shared/RubberbandSpan.js +34 -0
  235. package/esm/shared/coordLabels.d.ts +47 -0
  236. package/esm/shared/coordLabels.js +133 -0
  237. package/esm/shared/useWindowDrag.d.ts +18 -0
  238. package/esm/shared/useWindowDrag.js +45 -0
  239. package/package.json +18 -19
  240. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  241. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  242. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  243. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  244. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  245. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  246. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  247. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  248. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  249. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  250. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  251. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  252. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  253. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  254. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  255. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  256. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  257. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  258. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  260. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  261. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  262. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  263. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  264. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  265. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  266. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  267. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  268. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  269. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  270. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  271. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  272. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  273. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  274. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  275. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  276. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  277. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  278. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  279. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  280. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  281. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  282. package/esm/BaseLinearDisplay/components/util.js +0 -107
  283. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  284. package/esm/BaseLinearDisplay/index.js +0 -13
  285. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  286. package/esm/BaseLinearDisplay/model.js +0 -432
  287. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  288. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  289. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  290. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  291. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  292. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  293. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  294. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  295. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  296. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  297. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  298. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  299. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  300. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  301. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  302. package/esm/BaseLinearDisplay/models/util.js +0 -43
  303. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  304. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  305. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  306. package/esm/BaseLinearDisplay/types.js +0 -3
  307. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  308. package/esm/BaseLinearDisplay/util.js +0 -71
  309. package/esm/BasicTrack/configSchema.d.ts +0 -85
  310. package/esm/BasicTrack/configSchema.js +0 -8
  311. package/esm/BasicTrack/index.d.ts +0 -2
  312. package/esm/BasicTrack/index.js +0 -12
  313. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  314. package/esm/LinearBareDisplay/configSchema.js +0 -11
  315. package/esm/LinearBareDisplay/index.d.ts +0 -4
  316. package/esm/LinearBareDisplay/index.js +0 -20
  317. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  318. package/esm/LinearBareDisplay/model.js +0 -32
  319. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  320. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  321. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  322. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  323. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  324. package/esm/LinearBasicDisplay/index.js +0 -20
  325. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  326. package/esm/LinearBasicDisplay/model.js +0 -158
  327. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  328. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  329. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  330. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  331. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  332. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  333. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  334. package/esm/LinearFeatureDisplay/index.js +0 -2
  335. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  336. package/esm/LinearFeatureDisplay/model.js +0 -305
  337. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  338. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  339. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  340. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  345. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  346. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  347. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  348. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  349. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  350. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  351. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  352. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  353. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  354. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  355. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  356. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  357. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  358. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  359. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  360. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  361. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  362. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  363. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,145 +1,290 @@
1
- import { getSession, localStorageSetItem, parseLocString, } from '@jbrowse/core/util';
1
+ import { getSession, isSessionModelWithWidgets, localStorageSetItem, resolveNamedRegions, } from '@jbrowse/core/util';
2
+ import { coerceHighlight } from '@jbrowse/core/util/highlights';
3
+ import { installInitAutorun } from '@jbrowse/core/util/installInitAutorun';
4
+ import { normalizeTrackInit, warmTrackDisplayGeneric, } from '@jbrowse/core/util/tracks';
2
5
  import { addDisposer } from '@jbrowse/mobx-state-tree';
3
- import { autorun, when } from 'mobx';
4
- function tryParseJson(s) {
5
- try {
6
- const v = JSON.parse(s);
7
- return v && typeof v === 'object'
8
- ? v
9
- : undefined;
6
+ import { autorun, untracked, when } from 'mobx';
7
+ import { SearchResultsNotFoundError } from '../searchUtils.js';
8
+ // `init` is a frozen blob that often comes from hand-authored JSON, where a
9
+ // lone entry gets written bare (`tracks: 'genes'`). A string is iterable, so
10
+ // looping over it directly walked its characters — one track opened per letter.
11
+ function asArray(arg) {
12
+ return arg === undefined ? [] : Array.isArray(arg) ? arg : [arg];
13
+ }
14
+ // Activate tracklist first so the drawer opens before we navigate, so
15
+ // volatileWidth accounts for the drawer; otherwise navigation computes the
16
+ // region at full width and the drawer then obscures part of it. Opening the
17
+ // drawer shrinks the view, which the ResizeObserver reports as a volatileWidth
18
+ // change — but only if the drawer wasn't already taking that width. So wait for
19
+ // the change only when activating it actually opens the column.
20
+ async function openTracklist(self, session, superseded) {
21
+ // activateTrackSelector throws without widget support, which would abort the
22
+ // rest of init (navigation included) over an optional extra
23
+ if (isSessionModelWithWidgets(session)) {
24
+ // `drawerVisible` is the line App.tsx draws to render the drawer column at
25
+ // all: a minimized, popped-out or modal-only widget takes no width. It
26
+ // lives on SessionWithDrawerWidgets, whose type guard is product-core's, so
27
+ // it is duck-typed rather than taken as an upward dependency; a session
28
+ // without it has no drawer column.
29
+ const drawerVisible = () => 'drawerVisible' in session && session.drawerVisible === true;
30
+ const drawerWasVisible = drawerVisible();
31
+ const widthBefore = self.volatileWidth;
32
+ self.activateTrackSelector();
33
+ // a width change is only coming if the drawer just started taking space
34
+ if (!drawerWasVisible && drawerVisible()) {
35
+ // Bounded so init can't wedge here if the drawer doesn't shrink the view
36
+ // (e.g. embedded or modal-drawer layouts, where no width change is
37
+ // coming), and superseded so a re-launch landing mid-wait isn't held
38
+ // behind an init that no longer matters
39
+ await when(() => self.volatileWidth !== widthBefore || superseded(), {
40
+ timeout: 1000,
41
+ }).catch(() => { });
42
+ }
10
43
  }
11
- catch {
12
- return undefined;
44
+ else {
45
+ session.notify('init.tracklist was ignored: this application has no track selector drawer', 'warning');
13
46
  }
14
47
  }
15
- export function setupInitAutorun(self) {
16
- addDisposer(self, autorun(async function initAutorun() {
17
- const { init, initialized } = self;
18
- if (!initialized) {
19
- return;
48
+ // Restrict a whole-genome view to a named subset of the assembly's regions, in
49
+ // the requested order. Entries may be globs (`*_hap1`) — see selectNamedRegions,
50
+ // shared with the dotplot's per-axis `displayedRegionNames` so both views read
51
+ // the same name list the same way.
52
+ function showNamedRegions(self, session, assemblyName, names) {
53
+ const assembly = session.assemblyManager.get(assemblyName);
54
+ const all = assembly?.regions;
55
+ if (all) {
56
+ // resolveNamedRegions is what reports a list that matched nothing —
57
+ // otherwise a typo'd refName silently shows the whole genome and reads as
58
+ // displayedRegionNames being ignored. The FALLBACK stays here because it is
59
+ // this view's alone: nothing shown yet means show the whole genome rather
60
+ // than an empty view, but already navigated (URL params layered onto a
61
+ // defaultSession) means keep what's there, since a typo shouldn't discard
62
+ // the session's own navigation.
63
+ const regions = resolveNamedRegions({
64
+ regions: all,
65
+ names,
66
+ assemblyName,
67
+ getCanonicalRefName: assembly.getCanonicalRefName2,
68
+ allRefNames: assembly.allRefNames,
69
+ notify: message => {
70
+ session.notify(message, 'warning');
71
+ },
72
+ });
73
+ if (regions) {
74
+ // showRegions, not showAllRegionsInAssembly: `displayedRegionNames` is
75
+ // the spec naming what it wants shown, so it gets the width
76
+ self.showRegions(regions);
20
77
  }
21
- if (init) {
22
- const session = getSession(self);
23
- const { assemblyManager } = session;
24
- if (init.tracklist) {
25
- self.activateTrackSelector();
26
- const currentWidth = self.volatileWidth;
27
- await when(() => self.volatileWidth !== currentWidth, {
28
- timeout: 500,
29
- }).catch(() => {
30
- });
31
- }
32
- try {
33
- if (init.loc) {
34
- const asm = await assemblyManager.waitForAssembly(init.assembly);
35
- if (!asm) {
36
- throw new Error('Assembly not found');
37
- }
38
- await self.navToSearchString({
39
- input: init.loc,
40
- assembly: asm,
41
- });
42
- }
43
- else {
44
- self.showAllRegionsInAssembly(init.assembly);
45
- }
46
- }
47
- catch (e) {
48
- console.error(init, e);
49
- session.notifyError(`${e}`, e);
78
+ else if (!self.hasDisplayedRegions) {
79
+ // The fallback IS "show me everything", so it keeps the margin.
80
+ self.showAllRegionsInAssembly(assemblyName);
81
+ }
82
+ }
83
+ }
84
+ async function navigateInit(self, session, init) {
85
+ try {
86
+ if (init.loc) {
87
+ // navToLocString waits for the assembly itself, and this autorun only
88
+ // runs once `initialized` confirms init.assembly has loaded regions, so
89
+ // no explicit waitForAssembly is needed here
90
+ // a spec that listed its tracks gets those tracks; one that only named
91
+ // a gene gets the track the gene was found in, as the search box would
92
+ await self.navToLocString(init.loc, init.assembly, init.grow, {
93
+ showHitTrack: init.showHitTrack ?? asArray(init.tracks).length === 0,
94
+ });
95
+ }
96
+ else if (init.displayedRegionNames?.length) {
97
+ // an explicit region list is a navigation request just like `loc`, so it
98
+ // applies even when regions already exist (URL params layered onto a
99
+ // defaultSession that already navigated)
100
+ //
101
+ // `?.length`, not the bare key: an empty array is truthy, so a spec
102
+ // writing `displayedRegionNames: []` took this path with nothing to name
103
+ // and got told its list of no names had matched no regions. That is why
104
+ // LinearSyntenyView's doSubmit omits the key rather than passing [].
105
+ showNamedRegions(self, session, init.assembly, init.displayedRegionNames);
106
+ }
107
+ else if (!self.hasDisplayedRegions) {
108
+ // a highlight-only init (nothing to navigate to) must not clobber a
109
+ // defaultSession's existing navigation, so only auto-navigate when
110
+ // nothing is shown yet
111
+ self.showAllRegionsInAssembly(init.assembly);
112
+ }
113
+ }
114
+ catch (e) {
115
+ console.error(init, e);
116
+ if (e instanceof SearchResultsNotFoundError) {
117
+ // a &loc= gene name that matched nothing is a soft miss, not an app error
118
+ session.notify(e.message, 'warning');
119
+ }
120
+ else {
121
+ session.notifyError(`${e}`, e);
122
+ }
123
+ }
124
+ }
125
+ // launchTrack funnels through showTrackGeneric, which surfaces any failure
126
+ // (unresolved id, bad config, etc) as its own snackbar, and loads the picked
127
+ // display's state model first when it is registered lazily
128
+ async function showInitTracks(self, init) {
129
+ for (const t of asArray(init.tracks)) {
130
+ const { trackId, trackSnapshot, displaySnapshot } = normalizeTrackInit(t);
131
+ await self.launchTrack(trackId, trackSnapshot, displaySnapshot);
132
+ }
133
+ }
134
+ /**
135
+ * Add an init blob's `highlight` entries to the session, coercing each
136
+ * locstring or wire-format object and reporting a bad one without taking out
137
+ * its siblings. An entry without an assembly takes the launch's.
138
+ *
139
+ * Exported because a LinearSyntenyView row is a LinearGenomeView that does NOT
140
+ * go through this file's init autorun — the synteny view builds each row's
141
+ * snapshot and navigates it itself — so the row's own `highlight` had nowhere
142
+ * to be applied and was dropped in silence.
143
+ */
144
+ export function applyInitHighlights(session, init) {
145
+ for (const h of asArray(init.highlight)) {
146
+ // parseLocString throws on an unknown refName or a malformed locstring, and
147
+ // one bad entry must take out neither its siblings nor the rest of init
148
+ try {
149
+ const highlight = coerceHighlight(h, init.assembly, refName => session.assemblyManager.isValidRefName(refName, init.assembly));
150
+ if (highlight) {
151
+ session.addHighlight(highlight);
50
152
  }
51
- if (init.tracks) {
52
- const idsNotFound = [];
53
- for (const t of init.tracks) {
54
- try {
55
- if (typeof t === 'string') {
56
- self.showTrack(t);
57
- }
58
- else {
59
- self.showTrack(t.trackId, t.trackSnapshot ?? {}, t.displaySnapshot ?? {});
60
- }
61
- }
62
- catch (e) {
63
- const trackId = typeof t === 'string' ? t : t.trackId;
64
- if (/Could not resolve identifier/.exec(`${e}`)) {
65
- idsNotFound.push(trackId);
66
- }
67
- else {
68
- throw e;
69
- }
70
- }
71
- }
72
- if (idsNotFound.length) {
73
- session.notifyError(`Could not resolve identifiers: ${idsNotFound.join(',')}`, new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`));
153
+ }
154
+ catch (e) {
155
+ console.error(e);
156
+ session.notifyError(`Invalid init highlight ${JSON.stringify(h)}: ${e}`, e);
157
+ }
158
+ }
159
+ }
160
+ async function applyInit(self, pending, { superseded }) {
161
+ const session = getSession(self);
162
+ // A re-launch of a view already showing an assembly need not restate it:
163
+ // jb.setSession writes `loc` and track entries beside the built state, and
164
+ // the readiness gate resolved the same default before letting this run.
165
+ const init = pending.assembly
166
+ ? pending
167
+ : { ...pending, assembly: self.launchAssemblyName ?? pending.assembly };
168
+ if (init.tracklist) {
169
+ await openTracklist(self, session, superseded);
170
+ }
171
+ // `superseded`, not a bare isAlive: it subsumes the liveness check (the view
172
+ // may have been removed while the drawer or the navigation resolved, and
173
+ // reading or mutating a detached node throws) and also covers the case
174
+ // isAlive misses — a newer setLaunch landed mid-apply, so the rest of *this*
175
+ // blob is stale. Finishing it anyway appends its tracks and highlights under
176
+ // the one that replaced it. The drain loop applies the newer init next either
177
+ // way.
178
+ //
179
+ // Checked after each await rather than once at the top, and as early returns
180
+ // rather than nesting, so a step added later takes a guard beside it instead
181
+ // of another level of indent.
182
+ if (superseded()) {
183
+ return;
184
+ }
185
+ await navigateInit(self, session, init);
186
+ if (superseded()) {
187
+ return;
188
+ }
189
+ await showInitTracks(self, init);
190
+ if (superseded()) {
191
+ return;
192
+ }
193
+ if (init.nav !== undefined) {
194
+ self.setHideHeader(!init.nav);
195
+ }
196
+ applyInitHighlights(session, init);
197
+ }
198
+ /**
199
+ * The init autorun below waits for the view's width, which exists only once its
200
+ * component has rendered, and then loads the assembly and launches the tracks
201
+ * one at a time. The assembly and the display code each pending track needs can
202
+ * start loading now, all at once.
203
+ */
204
+ function setupInitWarmup(self) {
205
+ addDisposer(self, autorun(function initWarmupAutorun() {
206
+ const pending = self.pendingLaunch;
207
+ const tracks = asArray(pending?.tracks);
208
+ // eslint-disable-next-line no-restricted-syntax -- EFFECT INPUT: the assembly and track configs only feed the loads started here; the pending launch is the key
209
+ untracked(() => {
210
+ const assembly = pending?.assembly ?? self.launchAssemblyName;
211
+ if (pending && assembly) {
212
+ try {
213
+ getSession(self)
214
+ .assemblyManager.waitForAssembly(assembly)
215
+ .catch(() => { });
74
216
  }
75
- }
76
- if (init.nav !== undefined) {
77
- self.setHideHeader(!init.nav);
78
- }
79
- if (self.highlight.length) {
80
- const fallback = self.assemblyNames[0];
81
- if (fallback) {
82
- const normalized = self.highlight.map(h => h.assemblyName ? h : { ...h, assemblyName: fallback });
83
- if (normalized.some((h, i) => h !== self.highlight[i])) {
84
- self.setHighlight(normalized);
85
- }
217
+ catch {
218
+ // navigation reports an assembly that cannot load
86
219
  }
87
220
  }
88
- if (init.highlight) {
89
- for (const h of init.highlight) {
90
- const json = h.trim().startsWith('{') && tryParseJson(h);
91
- if (json &&
92
- typeof json.refName === 'string' &&
93
- typeof json.start === 'number' &&
94
- typeof json.end === 'number') {
95
- self.addToHighlights({
96
- refName: json.refName,
97
- start: json.start,
98
- end: json.end,
99
- assemblyName: typeof json.assemblyName === 'string'
100
- ? json.assemblyName
101
- : init.assembly,
102
- color: typeof json.color === 'string' ? json.color : undefined,
103
- label: typeof json.label === 'string' ? json.label : undefined,
104
- });
105
- }
106
- else {
107
- const p = parseLocString(h, refName => assemblyManager.isValidRefName(refName, init.assembly));
108
- const { start, end } = p;
109
- if (start !== undefined && end !== undefined) {
110
- self.addToHighlights({
111
- ...p,
112
- start,
113
- end,
114
- assemblyName: init.assembly,
115
- });
116
- }
117
- }
118
- }
221
+ for (const t of tracks) {
222
+ const { trackId, displaySnapshot } = normalizeTrackInit(t);
223
+ warmTrackDisplayGeneric(self, trackId, displaySnapshot, assembly);
119
224
  }
120
- self.setInit(undefined);
121
- }
122
- }, { name: 'LGVInit' }));
225
+ });
226
+ }, { name: 'LGVInitWarmup' }));
123
227
  }
124
- export function setupCoarseDynamicBlocksAutorun(self) {
228
+ /**
229
+ * Autorun that handles the init state - navigating to initial location,
230
+ * showing tracks, etc.
231
+ */
232
+ export function setupInitAutorun(self) {
233
+ installInitAutorun(self, {
234
+ name: 'LGVInit',
235
+ // `init` is what makes hasSomethingToShow / awaitingInitNavigation report
236
+ // "loading"
237
+ // until navigation populates displayedRegions, so the alternative gate
238
+ // (clearing `init` up front, the way SpreadsheetView does) would flash the
239
+ // import form mid-load.
240
+ ready: () => self.initialized,
241
+ // No pre-materialization phase to protect: the view is its own single row,
242
+ // and `error` already derives a failed init assembly declaratively (via
243
+ // initAssembly), so anything thrown out of applyInit is a failure of a
244
+ // step, not of the view coming up.
245
+ materialized: () => true,
246
+ apply: (init, ctx) => applyInit(self, init, ctx),
247
+ });
248
+ }
249
+ /**
250
+ * Autorun that updates coarse dynamic blocks with a delay
251
+ */
252
+ function setupCoarseDynamicBlocksAutorun(self) {
125
253
  addDisposer(self, autorun(function coarseDynamicBlocksAutorun() {
126
254
  if (self.initialized) {
127
- self.setCoarseDynamicBlocks(self.dynamicBlocks);
255
+ self.setCoarseDynamicBlocks(self.dynamicBlocks, self.bpPerPx);
128
256
  }
129
- }, { delay: 500, name: 'LGVCoarseDynamicBlocks' }));
257
+ }, {
258
+ delay: 500,
259
+ name: 'LGVCoarseDynamicBlocks',
260
+ }));
130
261
  }
131
- export function setupLocalStorageAutorun(self) {
262
+ /**
263
+ * Autorun that syncs view settings to localStorage
264
+ */
265
+ function setupLocalStorageAutorun(self) {
132
266
  addDisposer(self, autorun(function localStorageAutorun() {
133
267
  const s = (s) => JSON.stringify(s);
134
- const { showCytobandsSetting, showCenterLine, colorByCDS, showTrackOutlines, trackLabels, } = self;
135
- localStorageSetItem('lgv-showCytobands', s(showCytobandsSetting));
268
+ const { showCytobands, showCenterLine, colorByCDS, showAminoAcids, showTrackOutlines, trackLabels, } = self;
269
+ localStorageSetItem('lgv-showCytobands', s(showCytobands));
136
270
  localStorageSetItem('lgv-showCenterLine', s(showCenterLine));
137
271
  localStorageSetItem('lgv-colorByCDS', s(colorByCDS));
272
+ localStorageSetItem('lgv-showAminoAcids', s(showAminoAcids));
138
273
  localStorageSetItem('lgv-showTrackOutlines', s(showTrackOutlines));
139
- localStorageSetItem('lgv-trackLabels', trackLabels);
140
- }, { name: 'LGVLocalStorage' }));
274
+ // skip writing the empty default — otherwise reads later round-trip to
275
+ // '' instead of null, hiding the config-fallback path
276
+ if (trackLabels) {
277
+ localStorageSetItem('lgv-trackLabels', trackLabels);
278
+ }
279
+ }, {
280
+ name: 'LGVLocalStorage',
281
+ }));
141
282
  }
283
+ /**
284
+ * Sets up all afterAttach autoruns for the LinearGenomeView
285
+ */
142
286
  export function doAfterAttach(self) {
287
+ setupInitWarmup(self);
143
288
  setupInitAutorun(self);
144
289
  setupCoarseDynamicBlocksAutorun(self);
145
290
  setupLocalStorageAutorun(self);
@@ -2,5 +2,5 @@ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const CenterLine: ({ model }: {
4
4
  model: LGV;
5
- }) => import("react/jsx-runtime").JSX.Element | null;
5
+ }) => import("react").JSX.Element | null;
6
6
  export default CenterLine;
@@ -1,12 +1,15 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useRef } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { clamp } from '@jbrowse/core/util';
3
+ import { basePaintedAt } from '@jbrowse/core/util/Base1DUtils';
3
4
  import { makeStyles } from '@jbrowse/core/util/tss-react';
5
+ import CloseIcon from '@mui/icons-material/Close';
6
+ import { IconButton, Tooltip } from '@mui/material';
4
7
  import { observer } from 'mobx-react';
5
8
  const useStyles = makeStyles()(theme => ({
6
9
  centerLineContainer: {
7
10
  background: 'transparent',
8
11
  height: '100%',
9
- zIndex: 4,
12
+ zIndex: 4, // above the track but under menu
10
13
  position: 'absolute',
11
14
  left: 0,
12
15
  border: `1px ${theme.palette.action.active} dashed`,
@@ -17,22 +20,30 @@ const useStyles = makeStyles()(theme => ({
17
20
  centerLineText: {
18
21
  position: 'absolute',
19
22
  left: 0,
20
- pointerEvents: 'none',
23
+ bottom: 0,
24
+ display: 'flex',
25
+ alignItems: 'center',
26
+ gap: 2,
21
27
  whiteSpace: 'nowrap',
22
28
  fontWeight: 'bold',
23
29
  },
30
+ dismiss: {
31
+ // re-enable clicks disabled on the pointer-events:none container
32
+ pointerEvents: 'auto',
33
+ padding: 2,
34
+ },
24
35
  }));
25
36
  const CenterLine = observer(function CenterLine({ model }) {
26
- const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model;
27
- const ref = useRef(null);
37
+ const { bpPerPx, centerLineInfo, tracks, width } = model;
28
38
  const { classes } = useStyles();
29
39
  const startingPosition = width / 2;
30
- return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", ref: ref, style: {
40
+ return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", style: {
31
41
  transform: `translateX(${startingPosition}px)`,
32
42
  width: Math.max(1 / bpPerPx, 1),
33
43
  }, children: centerLineInfo && (_jsxs("div", { "data-testid": "centerline_text", className: classes.centerLineText, role: "presentation", style: {
34
44
  transform: `translateX(${Math.max(1 / bpPerPx, 1) + 5}px)`,
35
- top: trackHeights,
36
- }, children: [centerLineInfo.refName, ":", ' ', Math.max(Math.round(centerLineInfo.offset) + 1, 0)] })) })) : null;
45
+ }, children: [centerLineInfo.refName, ":", ' ', (clamp(basePaintedAt(centerLineInfo, centerLineInfo.offset), centerLineInfo.start, centerLineInfo.end - 1) + 1).toLocaleString('en-US'), _jsx(Tooltip, { title: "Hide center line", children: _jsx(IconButton, { className: classes.dismiss, onClick: () => {
46
+ model.setShowCenterLine(false);
47
+ }, children: _jsx(CloseIcon, { fontSize: "inherit" }) }) })] })) })) : null;
37
48
  });
38
49
  export default CenterLine;
@@ -0,0 +1,7 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ import type { HoverHighlightPosition } from './HoverPositionHighlight.tsx';
3
+ declare const ConnectedHoverHighlight: ({ model, getPosition, }: {
4
+ model: LinearGenomeViewModel;
5
+ getPosition: (widget: unknown, viewId: string) => HoverHighlightPosition | undefined;
6
+ }) => import("react").JSX.Element | null;
7
+ export default ConnectedHoverHighlight;
@@ -0,0 +1,22 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { getSession } from '@jbrowse/core/util';
3
+ import { observer } from 'mobx-react';
4
+ import HoverPositionHighlight from './HoverPositionHighlight.js';
5
+ // Draws a crosshair for every session widget "connected" to this view that is
6
+ // currently publishing a hover position. Each cross-widget hover overlay (the
7
+ // feature-detail sequence panel, the MAF sequence widget) supplies only its own
8
+ // `getPosition`, which narrows an arbitrary widget to its model and returns the
9
+ // hovered interval or undefined; the widget iteration and drawing are shared.
10
+ const ConnectedHoverHighlight = observer(function ConnectedHoverHighlight({ model, getPosition, }) {
11
+ const session = getSession(model);
12
+ const widgets = 'widgets' in session ? session.widgets : undefined;
13
+ return !widgets ? null : (_jsx(_Fragment, { children: [...widgets].flatMap(([id, widget]) => {
14
+ const position = getPosition(widget, model.id);
15
+ return position
16
+ ? [
17
+ _jsx(HoverPositionHighlight, { model: model, position: position }, `hover-${id}`),
18
+ ]
19
+ : [];
20
+ }) }));
21
+ });
22
+ export default ConnectedHoverHighlight;
@@ -0,0 +1,3 @@
1
+ import type { SequenceSearchModeProps } from './searchModes.ts';
2
+ declare const CrisprGuidePanel: ({ model, handleClose, }: SequenceSearchModeProps) => import("react").JSX.Element;
3
+ export default CrisprGuidePanel;