@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,101 +1,97 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
4
- import { complement, reverse, toLocale } from '@jbrowse/core/util';
2
+ import { useState } from 'react';
3
+ import { CopyToClipboardButton, Dialog, ErrorBanner, LabeledCheckbox, LoadingEllipses, MonospaceTextField, } from '@jbrowse/core/ui';
4
+ import { complement, reverse, statusProgressLabel, toLocale, } from '@jbrowse/core/util';
5
5
  import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings';
6
- import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { useFetch } from '@jbrowse/core/util/useFetch';
7
7
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
8
8
  import GetAppIcon from '@mui/icons-material/GetApp';
9
- import { Button, Checkbox, DialogActions, DialogContent, FormControlLabel, FormGroup, TextField, Typography, } from '@mui/material';
9
+ import { Button, DialogActions, DialogContent, FormGroup, Typography, } from '@mui/material';
10
10
  import { observer } from 'mobx-react';
11
- import { fetchSequence } from "./fetchSequence.js";
12
- const useStyles = makeStyles()({
13
- dialogContent: {
14
- width: '80em',
15
- },
16
- textAreaFont: {
17
- fontFamily: 'Courier New',
18
- },
19
- });
20
- const GetSequenceDialog = observer(function GetSequenceDialog({ model, handleClose, }) {
21
- const { classes } = useStyles();
22
- const [error, setError] = useState();
23
- const [sequenceChunks, setSequenceChunks] = useState();
24
- const [rev, setReverse] = useState(false);
25
- const [copied, setCopied] = useState(false);
26
- const [comp, setComplement] = useState(false);
27
- const { leftOffset, rightOffset } = model;
28
- const loading = sequenceChunks === undefined;
29
- useEffect(() => {
30
- const controller = new AbortController();
31
- (async () => {
32
- try {
33
- const selection = model.getSelectedRegions(leftOffset, rightOffset);
34
- if (selection.length === 0) {
35
- throw new Error('Selected region is out of bounds');
36
- }
37
- setSequenceChunks(await fetchSequence(model, selection));
38
- }
39
- catch (e) {
40
- console.error(e);
41
- setError(e);
11
+ import { fetchSequence } from './fetchSequence.js';
12
+ // Guard on the requested span, before fetching, so a whole-chromosome request
13
+ // (easy to trigger now that features/regions can open this) never round-trips
14
+ // megabases just to be display-blocked. Above the display limit the sequence is
15
+ // still downloadable; above the fetch limit it is refused outright.
16
+ //
17
+ // The display limit is in FASTA characters, not bp — it caps what goes into the
18
+ // textarea, which is the formatted output including headers and line breaks.
19
+ const MAX_DISPLAY_CHARS = 1_000_000;
20
+ const MAX_FETCH_BP = 10_000_000;
21
+ const GetSequenceDialog = observer(function GetSequenceDialog({ model, regions, handleClose, }) {
22
+ const [rev, setRev] = useState(false);
23
+ const [comp, setComp] = useState(false);
24
+ const totalBp = regions.reduce((a, r) => a + (r.end - r.start), 0);
25
+ const tooLargeToFetch = totalBp > MAX_FETCH_BP;
26
+ const { data: sequenceChunks, error, isLoading: loading, status, } = useFetch(tooLargeToFetch
27
+ ? false
28
+ : [
29
+ 'fetchSequence',
30
+ regions.map(r => `${r.refName}:${r.start}-${r.end}`),
31
+ ],
32
+ // a selection this dialog will happily take is a whole chromosome of
33
+ // sequence, so both handles are forwarded: closing the dialog stops the
34
+ // read rather than leaving the worker on it, and the wait is named
35
+ async (_name, _locs, signal, statusCallback) => {
36
+ if (regions.length === 0) {
37
+ throw new Error('Selected region is out of bounds');
38
+ }
39
+ const chunks = await fetchSequence(model, regions, {
40
+ signal,
41
+ statusCallback,
42
+ });
43
+ // validate here (in the async path) so a length mismatch surfaces via the
44
+ // dialog's own ErrorBanner rather than throwing during render
45
+ return chunks.map(chunk => {
46
+ const seq = chunk.get('seq');
47
+ const start = chunk.get('start') + 1;
48
+ const end = chunk.get('end');
49
+ const loc = `${chunk.get('refName')}:${start}-${end}`;
50
+ if (seq.length !== end - start + 1) {
51
+ throw new Error(`${loc} returned ${toLocale(seq.length)} bases, but should have returned ${toLocale(end - start + 1)}`);
42
52
  }
43
- })();
44
- return () => {
45
- controller.abort();
53
+ return { loc, seq };
54
+ });
55
+ });
56
+ const entries = sequenceChunks?.map(({ loc, seq }) => {
57
+ const revSeq = rev ? reverse(seq) : seq;
58
+ return {
59
+ header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
60
+ seq: comp ? complement(revSeq) : revSeq,
46
61
  };
47
- }, [model, leftOffset, rightOffset]);
48
- const sequence = sequenceChunks
49
- ? formatSeqFasta(sequenceChunks.map(chunk => {
50
- let chunkSeq = chunk.get('seq');
51
- const chunkRefName = chunk.get('refName');
52
- const chunkStart = chunk.get('start') + 1;
53
- const chunkEnd = chunk.get('end');
54
- const loc = `${chunkRefName}:${chunkStart}-${chunkEnd}`;
55
- if (chunkSeq?.length !== chunkEnd - chunkStart + 1) {
56
- throw new Error(`${loc} returned ${toLocale(chunkSeq.length)} bases, but should have returned ${toLocale(chunkEnd - chunkStart)}`);
57
- }
58
- if (rev) {
59
- chunkSeq = reverse(chunkSeq);
60
- }
61
- if (comp) {
62
- chunkSeq = complement(chunkSeq);
63
- }
64
- return {
65
- header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
66
- seq: chunkSeq,
67
- };
68
- }))
69
- : '';
70
- const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false;
62
+ }) ?? [];
63
+ const sequence = formatSeqFasta(entries);
64
+ const plainSequence = entries.map(e => e.seq).join('\n');
65
+ const sequenceTooLarge = sequence.length > MAX_DISPLAY_CHARS;
66
+ // What the textarea says instead of a sequence. `tooLargeToFetch` disables the
67
+ // fetch, so without this branch it left an empty box with no loading state, no
68
+ // error and no explanation — and a Download FASTA button that wrote 0 bytes.
69
+ const notice = tooLargeToFetch
70
+ ? `Selected region is ${toLocale(totalBp)}bp, over the ${toLocale(MAX_FETCH_BP)}bp limit for fetching a reference sequence. Zoom in or select a smaller region.`
71
+ : sequenceTooLarge
72
+ ? 'Reference sequence too large to display, use the download FASTA button'
73
+ : undefined;
71
74
  return (_jsxs(Dialog, { maxWidth: "xl", open: true, title: "Reference sequence", onClose: () => {
72
75
  handleClose();
73
- model.setOffsets();
74
- }, children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: "Retrieving sequences" })) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, disabled: sequenceTooLarge, className: classes.dialogContent, fullWidth: true, value: sequenceTooLarge
75
- ? 'Reference sequence too large to display, use the download FASTA button'
76
- : sequence, slotProps: {
77
- input: {
78
- readOnly: true,
79
- classes: {
80
- input: classes.textAreaFont,
81
- },
82
- },
83
- } }), _jsxs(FormGroup, { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { value: rev, onChange: event => {
84
- setReverse(event.target.checked);
85
- } }), label: "Reverse sequence" }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { value: comp, onChange: event => {
86
- setComplement(event.target.checked);
87
- } }), label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: async () => {
88
- const { default: copy } = await import('copy-to-clipboard');
89
- copy(sequence);
90
- setCopied(true);
91
- setTimeout(() => {
92
- setCopied(false);
93
- }, 500);
94
- }, disabled: loading || !!error || sequenceTooLarge, color: "primary", startIcon: _jsx(ContentCopyIcon, {}), children: copied ? 'Copied' : 'Copy to clipboard' }), _jsx(Button, { onClick: async () => {
95
- const { saveAs } = await import('file-saver-es');
96
- saveAs(new Blob([sequence || ''], {
76
+ }, children: [_jsxs(DialogContent, { style: { width: '80em' }, children: [error ? (_jsx(ErrorBanner, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: statusProgressLabel(status) || 'Retrieving sequences' })) : null, _jsxs("div", { style: {
77
+ display: 'flex',
78
+ justifyContent: 'flex-end',
79
+ gap: 8,
80
+ marginBottom: 4,
81
+ }, children: [_jsx(CopyToClipboardButton, { value: plainSequence, copiedLabel: "Copied", disabled: !plainSequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy plain text" }), _jsx(CopyToClipboardButton, { value: sequence, copiedLabel: "Copied", disabled: !sequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy FASTA" })] }), _jsx(MonospaceTextField, { fullWidth: true, readOnly: true, minRows: 5, maxRows: 10, disabled: notice !== undefined, value: notice ?? sequence }), _jsxs(FormGroup, { children: [_jsx(LabeledCheckbox, { checked: rev, onChange: val => {
82
+ setRev(val);
83
+ }, label: "Reverse sequence" }), _jsx(LabeledCheckbox, { checked: comp, onChange: val => {
84
+ setComp(val);
85
+ }, label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", onClick: async () => {
86
+ const { saveAs } = await import('@jbrowse/core/util/FileSaver');
87
+ saveAs(new Blob([sequence], {
97
88
  type: 'text/x-fasta;charset=utf-8',
98
89
  }), 'jbrowse_ref_seq.fa');
99
- }, disabled: loading || !!error, color: "primary", startIcon: _jsx(GetAppIcon, {}), children: "Download FASTA" }), _jsx(Button, { onClick: handleClose, variant: "contained", children: "Close" })] })] }));
90
+ },
91
+ // `!sequence` covers every path with nothing to write: still loading,
92
+ // errored, and the over-fetch-limit refusal
93
+ disabled: !sequence, color: "primary", startIcon: _jsx(GetAppIcon, {}), children: "Download FASTA" }), _jsx(Button, { onClick: () => {
94
+ handleClose();
95
+ }, variant: "contained", children: "Close" })] })] }));
100
96
  });
101
97
  export default GetSequenceDialog;
@@ -3,5 +3,5 @@ type LGV = LinearGenomeViewModel;
3
3
  declare const Gridlines: ({ model, offset, }: {
4
4
  model: LGV;
5
5
  offset?: number;
6
- }) => import("react/jsx-runtime").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
7
  export default Gridlines;
@@ -1,72 +1,43 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import { observer } from 'mobx-react';
4
- import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from "../../BaseLinearDisplay/components/Block.js";
5
- import { makeTicks } from "../util.js";
4
+ import ZoomTransform from './ZoomTransform.js';
6
5
  const useStyles = makeStyles()(theme => ({
7
- verticalGuidesZoomContainer: {
6
+ // top/left stay unset: as an inline-level box the svg takes its static
7
+ // position on a line box, and pinning it to 0 shifts the ticks off the
8
+ // canvas's own grid
9
+ absoluteFill: {
8
10
  position: 'absolute',
9
- top: 0,
10
- height: '100%',
11
11
  width: '100%',
12
- pointerEvents: 'none',
13
- },
14
- verticalGuidesContainer: {
15
- position: 'absolute',
16
- height: '100%',
17
- pointerEvents: 'none',
18
- display: 'flex',
19
- },
20
- tick: {
21
- position: 'absolute',
22
12
  height: '100%',
23
- width: 1,
24
13
  },
25
- majorTick: {
26
- background: theme.palette.action.disabled,
14
+ minorLine: {
15
+ stroke: theme.palette.gridlineMinor,
27
16
  },
28
- minorTick: {
29
- background: theme.palette.divider,
17
+ majorLine: {
18
+ stroke: theme.palette.gridlineMajor,
30
19
  },
31
20
  }));
32
- function RenderedBlockLines({ block, bpPerPx, }) {
33
- const { classes } = useStyles();
34
- const { start, end, reversed } = block;
35
- const ticks = makeTicks(start, end, bpPerPx);
36
- const majorTickClass = `${classes.tick} ${classes.majorTick}`;
37
- const minorTickClass = `${classes.tick} ${classes.minorTick}`;
38
- return (_jsx(ContentBlockComponent, { block: block, children: ticks.map(({ type, base }) => {
39
- const x = (reversed ? end - base : base - start) / bpPerPx;
40
- return (_jsx("div", { className: type === 'major' || type === 'labeledMajor'
41
- ? majorTickClass
42
- : minorTickClass, style: { left: x } }, base));
43
- }) }));
44
- }
45
- const RenderedVerticalGuides = observer(function RenderedVerticalGuides({ model, }) {
46
- const { staticBlocks, bpPerPx } = model;
47
- return (_jsx(_Fragment, { children: staticBlocks.map((block, index) => {
48
- const k = `${block.key}-${index}`;
49
- if (block.type === 'ContentBlock') {
50
- return _jsx(RenderedBlockLines, { block: block, bpPerPx: bpPerPx }, k);
51
- }
52
- else if (block.type === 'ElidedBlock') {
53
- return _jsx(ElidedBlockComponent, { width: block.widthPx }, k);
54
- }
55
- else if (block.type === 'InterRegionPaddingBlock') {
56
- return (_jsx(InterRegionPaddingBlockComponent, { width: block.widthPx, boundary: block.variant === 'boundary' }, k));
57
- }
58
- return null;
59
- }) }));
60
- });
21
+ // Background gridline ticks; render UNDER track content. Tick marks collapse
22
+ // into two <path>s (minor + major) rather than one div each: zoom rebuilds two
23
+ // `d` strings and patches two attributes instead of reconciling ~150 nodes per
24
+ // frame. Vector stays crisp at any DPR with no canvas pixel-buffer size cap;
25
+ // +0.5 centers the 1px stroke on a pixel column to match the old divs; lines
26
+ // run to y=100000 and are clipped by the svg box, so we never measure height.
61
27
  const Gridlines = observer(function Gridlines({ model, offset = 0, }) {
62
28
  const { classes } = useStyles();
63
- const { staticBlocks, scaleFactor, offsetPx } = model;
64
- const offsetLeft = staticBlocks.offsetPx - offsetPx;
65
- return (_jsx("div", { className: classes.verticalGuidesZoomContainer, style: {
66
- transform: scaleFactor !== 1 ? `scaleX(${scaleFactor})` : undefined,
67
- }, children: _jsx("div", { className: classes.verticalGuidesContainer, style: {
68
- left: offsetLeft - offset,
69
- width: staticBlocks.totalWidthPx,
70
- }, children: _jsx(RenderedVerticalGuides, { model: model }) }) }));
29
+ const { gridlineTicks } = model;
30
+ let minorD = '';
31
+ let majorD = '';
32
+ for (const { x, major } of gridlineTicks) {
33
+ const seg = `M${x + 0.5} 0V100000`;
34
+ if (major) {
35
+ majorD += seg;
36
+ }
37
+ else {
38
+ minorD += seg;
39
+ }
40
+ }
41
+ return (_jsx(ZoomTransform, { model: model, offset: offset, children: _jsxs("svg", { className: classes.absoluteFill, children: [_jsx("path", { d: minorD, className: classes.minorLine, strokeWidth: 1 }), _jsx("path", { d: majorD, className: classes.majorLine, strokeWidth: 1 })] }) }));
71
42
  });
72
43
  export default Gridlines;
@@ -1,5 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeViewHeader: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
4
+ }) => import("react").JSX.Element | null;
5
5
  export default LinearGenomeViewHeader;
@@ -1,31 +1,57 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
+ import ScrollZoomToggle from '@jbrowse/core/ui/ScrollZoomToggle';
4
+ import { getSession } from '@jbrowse/core/util';
2
5
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
- import { FormGroup } from '@mui/material';
6
+ import useMeasure from '@jbrowse/core/util/useMeasure';
7
+ import MenuIcon from '@mui/icons-material/Menu';
8
+ import { useMediaQuery } from '@mui/material';
4
9
  import { observer } from 'mobx-react';
5
- import HeaderPanControls from "./HeaderPanControls.js";
6
- import HeaderRegionWidth from "./HeaderRegionWidth.js";
7
- import HeaderTrackSelectorButton from "./HeaderTrackSelectorButton.js";
8
- import HeaderZoomControls from "./HeaderZoomControls.js";
9
- import OverviewScalebar from "./OverviewScalebar.js";
10
- import SearchBox from "./SearchBox.js";
11
- import { HEADER_BAR_HEIGHT } from "../consts.js";
10
+ import { HEADER_BAR_HEIGHT } from '../consts.js';
11
+ import { headerFit } from '../headerFit.js';
12
+ import HeaderClearHighlightButton, { highlightedDisplays, } from './HeaderClearHighlightButton.js';
13
+ import HeaderPanControls from './HeaderPanControls.js';
14
+ import HeaderRegionWidth from './HeaderRegionWidth.js';
15
+ import HeaderTrackSelectorButton from './HeaderTrackSelectorButton.js';
16
+ import HeaderZoomControls from './HeaderZoomControls.js';
17
+ import OverviewScalebar from './OverviewScalebar.js';
18
+ import SearchBox, { searchBoxWidth } from './SearchBox.js';
12
19
  const useStyles = makeStyles()({
13
20
  headerBar: {
14
21
  display: 'flex',
15
- height: HEADER_BAR_HEIGHT,
16
- },
17
- headerForm: {
18
- flexWrap: 'nowrap',
19
- marginRight: 7,
22
+ alignItems: 'center',
23
+ gap: 4,
24
+ // a floor, not a height. The constant was written onto this row by #4237 so
25
+ // the sticky offsets summing it would be true, and the row's own content
26
+ // reaches it at a 28px root font — the search box measures 48.13 there —
27
+ // after which a fixed height holds the row smaller than what is in it
28
+ minHeight: HEADER_BAR_HEIGHT,
20
29
  },
21
30
  spacer: {
22
31
  flexGrow: 1,
23
32
  },
24
33
  });
25
- const Controls = function ({ model }) {
34
+ const Controls = observer(function Controls({ model, }) {
26
35
  const { classes } = useStyles();
27
- return (_jsxs("div", { className: classes.headerBar, children: [_jsx(HeaderTrackSelectorButton, { model: model }), _jsx("div", { className: classes.spacer }), _jsxs(FormGroup, { row: true, className: classes.headerForm, children: [_jsx(HeaderPanControls, { model: model }), _jsx(SearchBox, { model: model })] }), _jsx(HeaderRegionWidth, { model: model }), _jsx(HeaderZoomControls, { model: model }), _jsx("div", { className: classes.spacer })] }));
28
- };
36
+ // the row itself, not `model.width`: what the pieces below have to fit into
37
+ // is this box, and the offset between it and the view's measured width
38
+ // differs between the app's view container, an embedded host and a synteny
39
+ // row
40
+ const [ref, { width }] = useMeasure('width');
41
+ const highlighted = highlightedDisplays(model);
42
+ const viewMenu = getSession(model).viewTitleBars === false;
43
+ const touch = useMediaQuery('(pointer: coarse)', {
44
+ noSsr: true,
45
+ });
46
+ const fit = headerFit({
47
+ width,
48
+ searchBoxPx: searchBoxWidth(model.coarseVisibleLocStrings),
49
+ clearHighlight: highlighted.length > 0,
50
+ viewMenu,
51
+ touch,
52
+ });
53
+ return (_jsxs("div", { className: classes.headerBar, ref: ref, children: [viewMenu ? (_jsx(CascadingMenuButton, { menuItems: () => model.menuItems(), "data-testid": "view_menu_icon", children: _jsx(MenuIcon, {}) })) : null, _jsx(HeaderTrackSelectorButton, { model: model, indent: fit.trackSelectorIndent }), touch ? null : (_jsx(ScrollZoomToggle, { model: model, iconOnly: !fit.scrollZoomLabel })), _jsx("div", { className: classes.spacer }), touch ? null : (_jsx(HeaderPanControls, { model: model, compact: !fit.panButtonSpacing })), _jsx(SearchBox, { model: model }), _jsx(HeaderClearHighlightButton, { highlighted: highlighted }), fit.regionWidth ? _jsx(HeaderRegionWidth, { model: model }) : null, _jsx(HeaderZoomControls, { model: model, showSlider: fit.zoomSlider }), _jsx("div", { className: classes.spacer })] }));
54
+ });
29
55
  const LinearGenomeViewHeader = observer(function LinearGenomeViewHeader({ model, }) {
30
56
  const { hideHeader, hideHeaderOverview } = model;
31
57
  return !hideHeader ? (hideHeaderOverview ? (_jsx(Controls, { model: model })) : (_jsx(OverviewScalebar, { model: model, children: _jsx(Controls, { model: model }) }))) : null;
@@ -0,0 +1,21 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ interface FeatureHighlightCapableDisplay {
3
+ featureHighlights: {
4
+ length: number;
5
+ };
6
+ clearFeatureHighlights: () => void;
7
+ }
8
+ /**
9
+ * Every display in the view with an active feature highlight — from a text
10
+ * search or the right-click "Highlight feature" menu, which land in the same
11
+ * set.
12
+ *
13
+ * The header reads this rather than leaving it to the button below, because
14
+ * whether the button is in the row changes how much of the row is left for
15
+ * everything else (see `headerFit`).
16
+ */
17
+ export declare function highlightedDisplays(model: LinearGenomeViewModel): FeatureHighlightCapableDisplay[];
18
+ declare const HeaderClearHighlightButton: ({ highlighted, }: {
19
+ highlighted: FeatureHighlightCapableDisplay[];
20
+ }) => import("react").JSX.Element | null;
21
+ export default HeaderClearHighlightButton;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import HighlightOffIcon from '@mui/icons-material/HighlightOff';
3
+ import { IconButton } from '@mui/material';
4
+ import { observer } from 'mobx-react';
5
+ function isFeatureHighlightCapable(d) {
6
+ return (typeof d === 'object' &&
7
+ d !== null &&
8
+ 'featureHighlights' in d &&
9
+ 'clearFeatureHighlights' in d &&
10
+ typeof d.clearFeatureHighlights === 'function');
11
+ }
12
+ /**
13
+ * Every display in the view with an active feature highlight — from a text
14
+ * search or the right-click "Highlight feature" menu, which land in the same
15
+ * set.
16
+ *
17
+ * The header reads this rather than leaving it to the button below, because
18
+ * whether the button is in the row changes how much of the row is left for
19
+ * everything else (see `headerFit`).
20
+ */
21
+ export function highlightedDisplays(model) {
22
+ return model.tracks
23
+ .flatMap(t => t.displays)
24
+ .filter(isFeatureHighlightCapable)
25
+ .filter(d => d.featureHighlights.length > 0);
26
+ }
27
+ // Clears every feature highlight in the view. Shown only while there is one.
28
+ const HeaderClearHighlightButton = observer(function HeaderClearHighlightButton({ highlighted, }) {
29
+ return highlighted.length > 0 ? (_jsx(IconButton, { "data-testid": "clear_search_highlight", title: "Clear feature highlights", onClick: () => {
30
+ for (const d of highlighted) {
31
+ d.clearFeatureHighlights();
32
+ }
33
+ }, children: _jsx(HighlightOffIcon, {}) })) : null;
34
+ });
35
+ export default HeaderClearHighlightButton;
@@ -1,6 +1,7 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
- export default function HeaderPanControls({ model }: {
3
+ export default function HeaderPanControls({ model, compact, }: {
4
4
  model: LGV;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ compact?: boolean;
6
+ }): import("react").JSX.Element;
6
7
  export {};
@@ -1,21 +1,31 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { alpha } from '@jbrowse/core/ui/palette';
2
3
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import ArrowBackIcon from '@mui/icons-material/ArrowBack';
4
5
  import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
5
- import { Button, alpha } from '@mui/material';
6
- import { SPACING } from "../consts.js";
6
+ import { Button } from '@mui/material';
7
+ import { SPACING, WIDGET_HEIGHT } from '../consts.js';
7
8
  const useStyles = makeStyles()(theme => ({
8
9
  panButton: {
9
10
  background: alpha(theme.palette.background.paper, 0.8),
10
- color: theme.palette.text.primary,
11
+ height: WIDGET_HEIGHT,
11
12
  margin: SPACING,
12
13
  },
14
+ // the arrows are the whole button, so MUI's 64px text-button minimum and the
15
+ // gap either side of it are pure air — the pair gives up 80px of it when the
16
+ // header can't hold everything
17
+ compact: {
18
+ margin: 1,
19
+ minWidth: 0,
20
+ padding: theme.spacing(0, 0.5),
21
+ },
13
22
  }));
14
- export default function HeaderPanControls({ model }) {
15
- const { classes } = useStyles();
16
- return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outlined", className: classes.panButton, onClick: () => {
23
+ export default function HeaderPanControls({ model, compact, }) {
24
+ const { classes, cx } = useStyles();
25
+ const className = cx(classes.panButton, compact && classes.compact);
26
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outlined", "aria-label": "Pan left", className: className, onClick: () => {
17
27
  model.slide(-0.9);
18
- }, children: _jsx(ArrowBackIcon, {}) }), _jsx(Button, { variant: "outlined", className: classes.panButton, onClick: () => {
28
+ }, children: _jsx(ArrowBackIcon, {}) }), _jsx(Button, { variant: "outlined", "aria-label": "Pan right", className: className, onClick: () => {
19
29
  model.slide(0.9);
20
30
  }, children: _jsx(ArrowForwardIcon, {}) })] }));
21
31
  }
@@ -1,5 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const HeaderRegionWidth: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => import("react").JSX.Element;
5
5
  export default HeaderRegionWidth;
@@ -2,17 +2,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import { Typography } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
- const useStyles = makeStyles()({
5
+ const useStyles = makeStyles()(theme => ({
6
6
  bp: {
7
7
  display: 'flex',
8
8
  alignItems: 'center',
9
- marginLeft: 5,
10
- cursor: 'pointer',
9
+ // reserve a fixed width so the varying-length bp string (e.g. 19.5Mbp vs
10
+ // 950Kbp) does not shift the adjacent zoom controls as the user zooms/pans
11
+ minWidth: 50,
12
+ // equal-width digits so the number does not reflow as it changes
13
+ fontVariantNumeric: 'tabular-nums',
14
+ color: theme.palette.text.secondary,
11
15
  },
12
- });
16
+ }));
13
17
  const HeaderRegionWidth = observer(function HeaderRegionWidth({ model, }) {
14
18
  const { classes } = useStyles();
15
- const { effectiveTotalBpDisplayStr } = model;
16
- return (_jsx(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: effectiveTotalBpDisplayStr }));
19
+ return (_jsx(Typography, { variant: "body2", className: classes.bp, "data-testid": "header_region_width", children: model.effectiveTotalBpDisplayStr }));
17
20
  });
18
21
  export default HeaderRegionWidth;
@@ -0,0 +1,6 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ declare const HeaderSearchBoxRow: ({ views, sideBySide, }: {
3
+ views: LinearGenomeViewModel[];
4
+ sideBySide: boolean;
5
+ }) => import("react").JSX.Element;
6
+ export default HeaderSearchBoxRow;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx, makeStyles } from '@jbrowse/core/util/tss-react';
3
+ import { observer } from 'mobx-react';
4
+ import HeaderSearchBoxes from './HeaderSearchBoxes.js';
5
+ const useStyles = makeStyles()({
6
+ searchBoxContainer: {
7
+ display: 'flex',
8
+ // scroll rather than clip when many rows' search boxes exceed the bar width
9
+ overflowX: 'auto',
10
+ minWidth: 0,
11
+ gap: 12,
12
+ },
13
+ // the only thing the orientation changes: side-by-side is the container as
14
+ // declared above, since this span is a flex item of the header bar either way
15
+ vertical: {
16
+ flexDirection: 'column',
17
+ },
18
+ });
19
+ // The whole search-box strip of a header that stacks several linear genome
20
+ // views: one box per row, laid out side by side or in a column. `sideBySide` is
21
+ // the caller's, because where the choice is remembered differs — each container
22
+ // keys its own `useSearchBoxPrefs` under its own storage prefix.
23
+ const HeaderSearchBoxRow = observer(function HeaderSearchBoxRow({ views, sideBySide, }) {
24
+ const { classes } = useStyles();
25
+ return (_jsx("span", { className: cx(classes.searchBoxContainer, !sideBySide && classes.vertical), children: views.map(view => (_jsx(HeaderSearchBoxes, { view: view }, view.id))) }));
26
+ });
27
+ export default HeaderSearchBoxRow;
@@ -0,0 +1,5 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ declare const HeaderSearchBoxes: ({ view, }: {
3
+ view: LinearGenomeViewModel;
4
+ }) => import("react").JSX.Element;
5
+ export default HeaderSearchBoxes;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getBpDisplayStr } from '@jbrowse/core/util';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
+ import { Typography } from '@mui/material';
5
+ import { observer } from 'mobx-react';
6
+ import SearchBox from './SearchBox.js';
7
+ const useStyles = makeStyles()(theme => ({
8
+ bp: {
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ },
12
+ searchBox: {
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ gap: theme.spacing(0.5),
16
+ },
17
+ }));
18
+ // One row's locate control in a header that stacks several linear genome views:
19
+ // the compact search box, then the assembly name and the span on screen. The
20
+ // comparative view and the breakpoint split view each draw one per row, and each
21
+ // carried a character-identical copy of it — the same plugin-to-plugin import
22
+ // (`SearchBox`) both were already making, one file further down.
23
+ const HeaderSearchBoxes = observer(function HeaderSearchBoxes({ view, }) {
24
+ const { classes } = useStyles();
25
+ const { assemblyDisplayNames, coarseTotalBp } = view;
26
+ return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false, maxWidth: 250, minWidth: 100, style: { margin: 0 } }), _jsxs(Typography, { variant: "body2", color: "text.secondary", className: classes.bp, children: [assemblyDisplayNames.join(','), " ", getBpDisplayStr(coarseTotalBp)] })] }));
27
+ });
28
+ export default HeaderSearchBoxes;
@@ -1,5 +1,6 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- declare const HeaderTrackSelectorButton: ({ model, }: {
2
+ declare const HeaderTrackSelectorButton: ({ model, indent, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ indent?: boolean;
5
+ }) => import("react").JSX.Element;
5
6
  export default HeaderTrackSelectorButton;