@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
@@ -5,13 +5,20 @@ import { IconButton } from '@mui/material';
5
5
  import { observer } from 'mobx-react';
6
6
  const useStyles = makeStyles()(theme => ({
7
7
  toggleButton: {
8
- height: 44,
9
8
  border: 'none',
9
+ },
10
+ indent: {
10
11
  marginLeft: theme.spacing(4),
11
12
  },
13
+ selected: {
14
+ backgroundColor: theme.palette.action.selected,
15
+ },
12
16
  }));
13
- const HeaderTrackSelectorButton = observer(function HeaderTrackSelectorButton({ model, }) {
14
- const { classes } = useStyles();
15
- return (_jsx(IconButton, { onClick: model.activateTrackSelector, className: classes.toggleButton, title: "Open track selector", value: "track_select", children: _jsx(TrackSelectorIcon, {}) }));
17
+ const HeaderTrackSelectorButton = observer(function HeaderTrackSelectorButton({ model, indent, }) {
18
+ const { classes, cx } = useStyles();
19
+ const { isTrackSelectorOpen } = model;
20
+ return (_jsx(IconButton, { color: isTrackSelectorOpen ? 'primary' : 'default', onClick: () => {
21
+ model.toggleTrackSelector();
22
+ }, className: cx(classes.toggleButton, indent && classes.indent, isTrackSelectorOpen ? classes.selected : undefined), title: isTrackSelectorOpen ? 'Close track selector' : 'Open track selector', value: "track_select", children: _jsx(TrackSelectorIcon, {}) }));
16
23
  });
17
24
  export default HeaderTrackSelectorButton;
@@ -1,5 +1,6 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- declare const HeaderZoomControls: ({ model, }: {
2
+ declare const HeaderZoomControls: ({ model, showSlider, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ showSlider?: boolean;
5
+ }) => import("react").JSX.Element;
5
6
  export default HeaderZoomControls;
@@ -1,14 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { lazy, useEffect, useState } from 'react';
2
+ import { useState } from 'react';
3
+ import { SingleSlider } from '@jbrowse/core/ui';
3
4
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
4
- import { getBpDisplayStr, getSession } from '@jbrowse/core/util';
5
+ import { getBpDisplayStr } from '@jbrowse/core/util';
5
6
  import { makeStyles } from '@jbrowse/core/util/tss-react';
6
7
  import MoreVert from '@mui/icons-material/MoreVert';
7
- import ZoomIn from '@mui/icons-material/ZoomIn';
8
- import ZoomOut from '@mui/icons-material/ZoomOut';
9
- import { IconButton, Slider, Tooltip } from '@mui/material';
10
8
  import { observer } from 'mobx-react';
11
- const RegionWidthEditorDialog = lazy(() => import("./RegionWidthEditorDialog.js"));
9
+ import { zoomMenuItems } from '../menuItems.js';
10
+ import ZoomButton from './ZoomButton.js';
12
11
  const useStyles = makeStyles()(theme => ({
13
12
  container: {
14
13
  display: 'flex',
@@ -18,54 +17,41 @@ const useStyles = makeStyles()(theme => ({
18
17
  slider: {
19
18
  width: 100,
20
19
  color: theme.palette.text.secondary,
20
+ // The value here is live `bpPerPx`, so MUI's default 150ms ease on the thumb
21
+ // and the track restarts on every animation frame of a wheel zoom: the
22
+ // transition never completes, the thumb trails the zoom it is reporting, and
23
+ // the compositor gives up on the track's animated width every frame. A
24
+ // slider that reports a value rather than being dragged to one wants no
25
+ // transition at all.
26
+ '& .MuiSlider-thumb, & .MuiSlider-track': {
27
+ transition: 'none',
28
+ },
21
29
  },
22
30
  }));
23
- function ValueLabelComponent(props) {
24
- const { children, open, value } = props;
25
- return (_jsx(Tooltip, { open: open, enterTouchDelay: 0, placement: "top", title: value, arrow: true, children: children }));
26
- }
27
- const HeaderZoomControls = observer(function HeaderZoomControls({ model, }) {
31
+ // The slider tracks live `bpPerPx`, which changes on every animation frame of a
32
+ // zoom. Isolated into its own observer so the surrounding zoom buttons/menu —
33
+ // whose MUI Tooltip/IconButton machinery is comparatively expensive and only
34
+ // depends on the debounced `coarseBpPerPx` — don't re-render every frame.
35
+ const ZoomSlider = observer(function ZoomSlider({ model, }) {
28
36
  const { classes } = useStyles();
29
- const { width, maxBpPerPx, minBpPerPx, bpPerPx, effectiveBpPerPx } = model;
30
- const [value, setValue] = useState(-Math.log2(bpPerPx) * 100);
31
- useEffect(() => {
32
- setValue(-Math.log2(effectiveBpPerPx) * 100);
33
- }, [effectiveBpPerPx]);
34
- const zoomInDisabled = effectiveBpPerPx <= minBpPerPx + 0.0001;
35
- const zoomOutDisabled = effectiveBpPerPx >= maxBpPerPx - 0.0001;
36
- return (_jsxs("div", { className: classes.container, children: [_jsx(Tooltip, { title: "Zoom out 2x", children: _jsx("span", { children: _jsx(IconButton, { "data-testid": "zoom_out", disabled: zoomOutDisabled, onClick: () => {
37
- model.zoom(bpPerPx * 2);
38
- }, children: _jsx(ZoomOut, {}) }) }) }), _jsx(Slider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChangeCommitted: () => model.zoomTo(2 ** (-value / 100)), valueLabelDisplay: "auto", valueLabelFormat: newValue => `Window size: ${getBpDisplayStr(2 ** (-newValue / 100) * width)}`, slots: {
39
- valueLabel: ValueLabelComponent,
40
- }, onChange: (_, val) => {
41
- setValue(val);
42
- } }), _jsx(Tooltip, { title: "Zoom in 2x", children: _jsx("span", { children: _jsx(IconButton, { "data-testid": "zoom_in", disabled: zoomInDisabled, onClick: () => {
43
- model.zoom(model.bpPerPx / 2);
44
- }, children: _jsx(ZoomIn, {}) }) }) }), _jsx(CascadingMenuButton, { menuItems: [
45
- ...[100, 50, 10].map(r => ({
46
- label: `Zoom in ${r}x`,
47
- onClick: () => {
48
- model.zoom(model.bpPerPx / r);
49
- },
50
- })),
51
- ...[10, 50, 100].map(r => ({
52
- label: `Zoom out ${r}x`,
53
- onClick: () => {
54
- model.zoom(model.bpPerPx * r);
55
- },
56
- })),
57
- {
58
- label: 'Custom zoom',
59
- onClick: () => {
60
- getSession(model).queueDialog(handleClose => [
61
- RegionWidthEditorDialog,
62
- {
63
- model,
64
- handleClose,
65
- },
66
- ]);
67
- },
68
- },
69
- ], children: _jsx(MoreVert, {}) })] }));
37
+ const { width, maxBpPerPx, minBpPerPx, bpPerPx } = model;
38
+ const [dragValue, setDragValue] = useState(null);
39
+ const value = dragValue ?? -Math.log2(bpPerPx) * 100;
40
+ return (_jsx(SingleSlider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChangeCommitted: val => {
41
+ setDragValue(null);
42
+ model.cancelZoomAnimation();
43
+ model.zoomTo(2 ** (-val / 100));
44
+ }, valueLabelDisplay: "auto", valueLabelFormat: newValue => `Window size: ${getBpDisplayStr(2 ** (-newValue / 100) * width)}`, onChange: val => {
45
+ // Take over from any in-flight animated zoom as soon as the user grabs
46
+ // the thumb, so the view stops lurching underneath the drag.
47
+ if (dragValue === null) {
48
+ model.cancelZoomAnimation();
49
+ }
50
+ setDragValue(val);
51
+ } }));
52
+ });
53
+ const HeaderZoomControls = observer(function HeaderZoomControls({ model, showSlider = true, }) {
54
+ const { classes } = useStyles();
55
+ return (_jsxs("div", { className: classes.container, children: [_jsx(ZoomButton, { model: model, direction: "out" }), showSlider ? _jsx(ZoomSlider, { model: model }) : null, _jsx(ZoomButton, { model: model, direction: "in" }), _jsx(CascadingMenuButton, { menuItems: () => zoomMenuItems(model), children: _jsx(MoreVert, {}) })] }));
70
56
  });
71
57
  export default HeaderZoomControls;
@@ -4,5 +4,5 @@ type LGV = LinearGenomeViewModel;
4
4
  declare const Highlight: ({ model, highlight, }: {
5
5
  model: LGV;
6
6
  highlight: HighlightType;
7
- }) => import("react/jsx-runtime").JSX.Element | null;
7
+ }) => import("react").JSX.Element | null;
8
8
  export default Highlight;
@@ -1,42 +1,38 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useStyleTheme } from '@jbrowse/core/ui/PaletteContext';
3
3
  import { getSession } from '@jbrowse/core/util';
4
- import { colord } from '@jbrowse/core/util/colord';
5
- import BookmarkIcon from '@mui/icons-material/Bookmark';
6
4
  import CloseIcon from '@mui/icons-material/Close';
7
- import LinkIcon from '@mui/icons-material/Link';
8
- import { Box, Tooltip, Typography, useTheme } from '@mui/material';
5
+ import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
9
6
  import { observer } from 'mobx-react';
10
- import HighlightBand from "./HighlightBand.js";
7
+ import HighlightBand from './HighlightBand.js';
8
+ import HighlightChip from './HighlightChip.js';
9
+ import { getHighlightColor } from './util.js';
10
+ // A band narrower than the link-icon chip clips it into a smudge, so below this
11
+ // width the chip is dropped (the band itself still draws).
12
+ const CHIP_MIN_WIDTH = 24;
11
13
  const Highlight = observer(function Highlight({ model, highlight, }) {
12
- const theme = useTheme();
13
- const session = getSession(model);
14
+ const theme = useStyleTheme();
14
15
  const coords = model.getHighlightCoords(highlight);
15
- const bandColor = highlight.color
16
- ? colord(highlight.color)
17
- : colord(theme.palette.highlight.main).alpha(0.35);
18
- return coords ? (_jsx(HighlightBand, { coords: coords, background: bandColor.toRgbString(), children: _jsx(CascadingMenuButton, { menuItems: [
16
+ const bandColor = getHighlightColor(highlight, theme);
17
+ const label = getSession(model).highlightLabelsVisible
18
+ ? highlight.label
19
+ : undefined;
20
+ return coords ? (_jsx(HighlightBand, { coords: coords, background: bandColor.toRgbString(), label: label, children: coords.width >= CHIP_MIN_WIDTH ? (_jsx(HighlightChip, { color: bandColor, label: label, tooltip: highlight.label ?? 'Highlighted region', menuItems: [
19
21
  {
20
22
  label: 'Dismiss highlight',
21
23
  icon: CloseIcon,
22
24
  onClick: () => {
23
- model.removeHighlight(highlight);
25
+ getSession(model).removeHighlight(highlight);
24
26
  },
25
27
  },
26
28
  {
27
- label: 'Bookmark highlighted region',
28
- icon: BookmarkIcon,
29
+ label: 'Turn off highlights',
30
+ icon: VisibilityOffIcon,
29
31
  onClick: () => {
30
- const bookmarkWidget = (session.widgets.get('GridBookmark') ??
31
- session.addWidget('GridBookmarkWidget', 'GridBookmark'));
32
- bookmarkWidget.addBookmark({
33
- ...highlight,
34
- assemblyName: highlight.assemblyName ?? model.assemblyNames[0],
35
- });
36
- session.showWidget(bookmarkWidget);
37
- model.removeHighlight(highlight);
32
+ getSession(model).setHighlightsVisible(false);
38
33
  },
39
34
  },
40
- ], children: _jsx(Tooltip, { title: highlight.label ?? 'Highlighted region', arrow: true, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 0.5 }, children: [_jsx(LinkIcon, { fontSize: "small", sx: { color: bandColor.alpha(0.8).toRgbString() } }), highlight.label && model.labelsVisible ? (_jsx(Typography, { variant: "caption", noWrap: true, children: highlight.label })) : null] }) }) }) })) : null;
35
+ ...model.highlightMenuItems(highlight),
36
+ ] })) : null })) : null;
41
37
  });
42
38
  export default Highlight;
@@ -1,8 +1,9 @@
1
- export default function HighlightBand({ coords, background, children, }: {
1
+ export default function HighlightBand({ coords, background, label, children, }: {
2
2
  coords: {
3
3
  left: number;
4
4
  width: number;
5
5
  };
6
6
  background: string;
7
+ label?: string;
7
8
  children?: React.ReactNode;
8
- }): import("react/jsx-runtime").JSX.Element;
9
+ }): import("react").JSX.Element;
@@ -1,23 +1,40 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
- const useStyles = makeStyles()({
3
+ import { Typography } from '@mui/material';
4
+ const useStyles = makeStyles()(theme => ({
4
5
  highlight: {
5
6
  height: '100%',
6
7
  position: 'absolute',
7
8
  left: 0,
8
- overflow: 'hidden',
9
+ // clip rather than hidden so this never becomes a scroll container (see
10
+ // Scalebar)
11
+ overflow: 'clip',
12
+ // paint above sibling TrackContainers (which would otherwise win in tree
13
+ // order). pointer-events:none lets clicks fall through to the tracks; an
14
+ // interactive chip re-enables pointer-events on itself
9
15
  zIndex: 1,
10
16
  pointerEvents: 'none',
11
17
  },
12
- chip: {
13
- pointerEvents: 'auto',
18
+ overlay: {
19
+ position: 'absolute',
20
+ top: 0,
21
+ left: 3,
22
+ },
23
+ label: {
24
+ color: theme.palette.text.primary,
14
25
  },
15
- });
16
- export default function HighlightBand({ coords, background, children, }) {
26
+ }));
27
+ // OverviewHighlight stays separate (different bpToPx API). A non-interactive
28
+ // colored band with an
29
+ // optional top label; when `children` (the highlight chip) is passed it renders
30
+ // that instead of the plain label. Visibility is toggled from the view menu
31
+ export default function HighlightBand({ coords, background, label, children, }) {
17
32
  const { classes } = useStyles();
18
- return (_jsx("div", { className: classes.highlight, style: {
33
+ const content = children ??
34
+ (label ? (_jsx(Typography, { variant: "caption", className: classes.label, noWrap: true, children: label })) : null);
35
+ return (_jsx("div", { "data-testid": "highlight-band", className: classes.highlight, style: {
19
36
  transform: `translateX(${coords.left}px)`,
20
37
  width: coords.width,
21
38
  background,
22
- }, children: coords.width > 3 && children ? (_jsx("div", { className: classes.chip, children: children })) : null }));
39
+ }, children: coords.width > 3 && content ? (_jsx("div", { className: classes.overlay, children: content })) : null }));
23
40
  }
@@ -0,0 +1,8 @@
1
+ import type { MenuItem } from '@jbrowse/core/ui';
2
+ import type { Colord } from '@jbrowse/core/util/colord';
3
+ export default function HighlightChip({ color, label, tooltip, menuItems, }: {
4
+ color: Colord;
5
+ label?: string;
6
+ tooltip?: string;
7
+ menuItems: MenuItem[];
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
+ import LinkIcon from '@mui/icons-material/Link';
4
+ import { Box, Tooltip, Typography } from '@mui/material';
5
+ // Interactive chip drawn inside a highlight band: a link icon tinted to the
6
+ // band color plus an optional inline label, wrapped in a context menu. Sets its
7
+ // own pointer-events since the band is click-through.
8
+ export default function HighlightChip({ color, label, tooltip, menuItems, }) {
9
+ // hide the icon color when the band is fully transparent ("label-only"
10
+ // highlight); otherwise bump to 0.8 alpha so the chip stays legible
11
+ const chipAlpha = color.alpha() === 0 ? 0 : 0.8;
12
+ return (_jsx(Box, { sx: { pointerEvents: 'auto' }, children: _jsx(CascadingMenuButton, { "data-testid": "highlight-chip", menuItems: menuItems, children: _jsx(Tooltip, { title: tooltip, arrow: true, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 0.5 }, children: [_jsx(LinkIcon, { fontSize: "small", sx: { color: color.alpha(chipAlpha).toRgbString() } }), label ? (_jsx(Typography, { variant: "caption", noWrap: true, children: label })) : null] }) }) }) }));
13
+ }
@@ -0,0 +1,12 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ export interface HoverHighlightPosition {
3
+ refName: string;
4
+ start: number;
5
+ end: number;
6
+ assemblyName?: string;
7
+ }
8
+ declare const HoverPositionHighlight: ({ model, position, }: {
9
+ model: LinearGenomeViewModel;
10
+ position: HoverHighlightPosition;
11
+ }) => import("react").JSX.Element | null;
12
+ export default HoverPositionHighlight;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { alpha } from '@jbrowse/core/ui/palette';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
+ import { observer } from 'mobx-react';
5
+ const useStyles = makeStyles()(theme => ({
6
+ highlight: {
7
+ height: '100%',
8
+ position: 'absolute',
9
+ background: alpha(theme.palette.accent, 0.4),
10
+ borderLeft: `2px solid ${theme.palette.accent}`,
11
+ borderRight: `2px solid ${theme.palette.accent}`,
12
+ pointerEvents: 'none',
13
+ zIndex: 10,
14
+ },
15
+ }));
16
+ // Renders one crosshair box on the LGV for a hovered genomic interval, or
17
+ // nothing if the interval is off-screen. Shared by the widgets that publish a
18
+ // hover position (e.g. the feature-detail sequence panel and the MAF sequence
19
+ // widget).
20
+ const HoverPositionHighlight = observer(function HoverPositionHighlight({ model, position, }) {
21
+ const { classes } = useStyles();
22
+ const coords = model.getHighlightCoords(position);
23
+ return coords ? (_jsx("div", { className: classes.highlight, style: { left: coords.left, width: coords.width } })) : null;
24
+ });
25
+ export default HoverPositionHighlight;
@@ -1,6 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- type LGV = LinearGenomeViewModel;
3
- declare const LinearGenomeViewImportForm: ({ model }: {
4
- model: LGV;
5
- }) => import("react/jsx-runtime").JSX.Element;
2
+ declare const LinearGenomeViewImportForm: ({ model, }: {
3
+ model: LinearGenomeViewModel;
4
+ }) => import("react").JSX.Element;
6
5
  export default LinearGenomeViewImportForm;
@@ -1,77 +1,111 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
2
+ import { useState } from 'react';
3
+ import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
4
+ import { AssemblySelector, ErrorBanner, RefNameAutocomplete, RefNameAutocompleteEndAdornment, adornmentReservePx, useAssemblySelection, useRecentLocations, } from '@jbrowse/core/ui';
4
5
  import { getSession } from '@jbrowse/core/util';
5
6
  import { makeStyles } from '@jbrowse/core/util/tss-react';
6
7
  import CloseIcon from '@mui/icons-material/Close';
7
- import { Button, CircularProgress, Container, FormControl, Grid as Grid, } from '@mui/material';
8
+ import { Button, CircularProgress, Container, Grid } from '@mui/material';
8
9
  import { observer } from 'mobx-react';
9
- import ImportFormRefNameAutocomplete from "./ImportFormRefNameAutocomplete.js";
10
- import { handleSelectedRegion, navToOption } from "../../searchUtils.js";
10
+ import { fetchResults, navigateToSelectedOption, notifySearchFailure, } from '../../searchUtils.js';
11
+ import { recentLocationOf, recentLocationsMenu } from './recentLocationsMenu.js';
11
12
  const useStyles = makeStyles()(theme => ({
12
13
  importFormContainer: {
13
- padding: theme.spacing(2),
14
+ padding: theme.spacing(4),
14
15
  },
15
16
  button: {
16
17
  margin: theme.spacing(2),
17
18
  },
18
- container: {
19
- padding: theme.spacing(4),
20
- },
21
19
  }));
22
- const LinearGenomeViewImportForm = observer(function LinearGenomeViewImportForm({ model }) {
20
+ const LinearGenomeViewImportForm = observer(function LinearGenomeViewImportForm({ model, }) {
23
21
  const { classes } = useStyles();
24
22
  const session = getSession(model);
25
- const { assemblyNames, assemblyManager } = session;
26
- const { initialized, error } = model;
27
- const [selectedAsm, setSelectedAsm] = useState(assemblyNames[0]);
28
- const [option, setOption] = useState();
29
- const assembly = assemblyManager.get(selectedAsm);
30
- const assemblyError = assemblyNames.length
31
- ? assembly?.error
32
- : 'No configured assemblies';
33
- const displayError = assemblyError || error;
34
- const [value, setValue] = useState('');
35
- const regions = assembly?.regions;
36
- const assemblyLoaded = !!regions;
37
- const r0 = regions ? regions[0]?.refName || '' : '';
38
- useEffect(() => {
39
- setValue(r0);
40
- }, [r0, selectedAsm]);
41
- return (_jsxs("div", { className: classes.container, children: [displayError ? _jsx(ErrorMessage, { error: displayError }) : null, initialized ? (_jsx(Container, { className: classes.importFormContainer, children: _jsx("form", { onSubmit: async (event) => {
42
- event.preventDefault();
43
- model.setError(undefined);
44
- if (value) {
45
- try {
46
- if (option?.getDisplayString() === value &&
47
- option.hasLocation()) {
48
- await navToOption({
49
- option,
50
- model,
51
- assemblyName: selectedAsm,
52
- });
53
- }
54
- else if (option?.results?.length) {
55
- model.setSearchResults(option.results, option.getLabel(), selectedAsm);
56
- }
57
- else if (assembly) {
58
- await handleSelectedRegion({
59
- input: value,
60
- assembly,
61
- model,
62
- });
63
- }
64
- }
65
- catch (e) {
66
- console.error(e);
67
- session.notify(`${e}`, 'warning');
68
- }
69
- }
70
- }, children: _jsxs(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [_jsx(FormControl, { children: _jsx(AssemblySelector, { onChange: val => {
71
- setSelectedAsm(val);
72
- }, localStorageKey: "lgv", session: session, selected: selectedAsm }) }), selectedAsm ? (assemblyError ? (_jsx(CloseIcon, { style: { color: 'red' } })) : assemblyLoaded ? (_jsx(FormControl, { children: _jsx(ImportFormRefNameAutocomplete, { value: value, setValue: setValue, selectedAsm: selectedAsm, setOption: setOption, model: model }) })) : (_jsx(CircularProgress, { size: 20, disableShrink: true }))) : null, _jsx(FormControl, { children: _jsx(Button, { type: "submit", disabled: !value, className: classes.button, variant: "contained", color: "primary", children: "Open" }) }), _jsx(FormControl, { children: _jsx(Button, { disabled: !value, className: classes.button, onClick: () => {
73
- model.setError(undefined);
74
- model.showAllRegionsInAssembly(selectedAsm);
75
- }, variant: "contained", color: "secondary", children: "Show all regions in assembly" }) })] }) }) })) : null] }));
23
+ const { textSearchManager } = session;
24
+ const { error: viewError } = model;
25
+ const { selectedAssemblyName: selectedAsm, setSelectedAssemblyName, assembly, assemblyError, regions, } = useAssemblySelection(session, 'lgv');
26
+ const { recentLocations, addRecentLocation, clearRecentLocations } = useRecentLocations(selectedAsm);
27
+ // The location the form will open, tagged with the assembly it was entered
28
+ // for, and read back only while that tag still matches. Switching assembly
29
+ // then drops it structurally — nothing has to remember to clear it — which
30
+ // is the shape `useAssemblySelection` already uses for the assembly choice
31
+ // itself ("stored as an override, re-resolved against the live list every
32
+ // render") and the breakpoint form uses for its shared track. One object
33
+ // rather than a text/option pair for the same reason: they are only ever
34
+ // valid together, and as two useStates every write had to remember to reset
35
+ // the other.
36
+ //
37
+ // Undefined means "nothing entered yet", which is what makes the box fall
38
+ // back to the first refname below and keeps that default out of the recent
39
+ // locations list.
40
+ const [entered, setEntered] = useState();
41
+ const current = entered?.assemblyName === selectedAsm ? entered : undefined;
42
+ const value = current?.text ?? regions?.[0]?.refName ?? '';
43
+ const displayError = assemblyError ?? viewError;
44
+ async function navigate({ option, record, }) {
45
+ model.setError(undefined);
46
+ if (selectedAsm) {
47
+ try {
48
+ await navigateToSelectedOption({
49
+ option,
50
+ model,
51
+ assemblyName: selectedAsm,
52
+ });
53
+ if (record) {
54
+ addRecentLocation(recentLocationOf(option));
55
+ }
56
+ }
57
+ catch (e) {
58
+ notifySearchFailure(session, e);
59
+ }
60
+ }
61
+ }
62
+ const recentMenuItems = recentLocationsMenu({
63
+ recentLocations,
64
+ onNavigate: option => {
65
+ navigate({ option, record: true }).catch(() => { });
66
+ },
67
+ onClear: clearRecentLocations,
68
+ });
69
+ return (_jsxs(Container, { className: classes.importFormContainer, "data-testid": "import-form", children: [displayError ? _jsx(ErrorBanner, { error: displayError }) : null, _jsx("form", { onSubmit: async (event) => {
70
+ event.preventDefault();
71
+ if (value) {
72
+ await navigate({
73
+ option: current?.option ?? new BaseResult({ label: value }),
74
+ record: current !== undefined,
75
+ });
76
+ }
77
+ }, children: _jsxs(Grid, { container: true, spacing: 1, sx: { justifyContent: 'center', alignItems: 'center' }, children: [_jsx(AssemblySelector, { onChange: val => {
78
+ // Only the model's error needs clearing by hand: it lives
79
+ // outside React and is not tagged with the assembly it was
80
+ // about. The typed location isn't reset here — `entered` is
81
+ // tagged, so it drops itself. The banner reports the previous
82
+ // assembly's failure (that is why the form is up at all), so it
83
+ // has to go with it; the circular form clears here for the same
84
+ // reason.
85
+ model.setError(undefined);
86
+ setSelectedAssemblyName(val);
87
+ }, session: session, selected: selectedAsm }), selectedAsm ? (assemblyError ? (_jsx(CloseIcon, { color: "error" })) : regions ? (_jsx(RefNameAutocomplete, { fetchResults: (queryString, signal) => fetchResults({
88
+ queryString,
89
+ assembly,
90
+ textSearchManager,
91
+ assemblyName: selectedAsm,
92
+ signal,
93
+ }), session: session, assemblyName: selectedAsm, value: value, minWidth: 270, adornmentWidth: adornmentReservePx({
94
+ menuItemCount: recentMenuItems.length,
95
+ }), onChange: v => {
96
+ // no `option` on the new object, so typing over a picked
97
+ // search result discards it rather than opening the old
98
+ // one's location under the new text
99
+ setEntered({ assemblyName: selectedAsm, text: v });
100
+ }, onSelect: opt => {
101
+ setEntered({
102
+ assemblyName: selectedAsm,
103
+ text: opt.getDisplayString(),
104
+ option: opt,
105
+ });
106
+ }, endAdornment: _jsx(RefNameAutocompleteEndAdornment, { menuItems: recentMenuItems }), helperText: "Enter sequence name, feature name, or location" })) : (_jsx(CircularProgress, { size: 20, disableShrink: true }))) : null, _jsx(Button, { type: "submit", disabled: !value, className: classes.button, variant: "contained", color: "primary", children: "Open" }), _jsx(Button, { disabled: !!assemblyError || !regions, className: classes.button, onClick: () => {
107
+ model.setError(undefined);
108
+ model.showAllRegionsInAssembly(selectedAsm);
109
+ }, variant: "contained", color: "secondary", children: "Show all regions in assembly" })] }) })] }));
76
110
  });
77
111
  export default LinearGenomeViewImportForm;
@@ -1,5 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeView: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => import("react").JSX.Element;
5
5
  export default LinearGenomeView;
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { lazy } from 'react';
3
- import { LoadingEllipses } from '@jbrowse/core/ui';
3
+ import { ViewLoadingScreen } from '@jbrowse/core/ui';
4
4
  import { observer } from 'mobx-react';
5
- import LinearGenomeViewContainer from "./LinearGenomeViewContainer.js";
6
- const ImportForm = lazy(() => import("./ImportForm.js"));
5
+ import LinearGenomeViewContainer from './LinearGenomeViewContainer.js';
6
+ // lazies
7
+ const ImportForm = lazy(() => import('./ImportForm.js'));
7
8
  const LinearGenomeView = observer(function LinearGenomeView({ model, }) {
8
- const { showLoading, showImportForm, loadingMessage } = model;
9
- if (showLoading) {
10
- return _jsx(LoadingEllipses, { variant: "h6", message: loadingMessage });
9
+ const { loading, showImportForm } = model;
10
+ if (loading) {
11
+ return _jsx(ViewLoadingScreen, { ...loading });
11
12
  }
12
13
  else if (showImportForm) {
13
14
  return _jsx(ImportForm, { model: model });
@@ -1,5 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeViewContainer: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => import("react").JSX.Element;
5
5
  export default LinearGenomeViewContainer;