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

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 (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  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 +250 -121
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  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 +144 -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 +7 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -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 +32 -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 +16 -7
  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 +67 -51
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  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 +9 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +15 -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 +6 -5
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +13 -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 +26 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  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 +84 -79
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -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 +61 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -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/Rubberband.d.ts +1 -1
  81. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  82. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  83. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  84. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  85. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  86. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  87. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  88. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  90. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  91. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  92. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  93. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  94. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  95. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  96. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  97. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  98. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  99. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  102. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  103. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  104. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  105. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  106. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  107. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  108. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  109. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  110. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  111. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  112. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  113. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  114. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  115. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  116. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  117. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  118. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  119. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  120. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  121. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  122. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  124. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  126. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  127. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  128. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  129. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  130. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  131. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  132. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  133. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  134. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  135. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  136. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  137. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  138. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  139. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  140. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  141. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  142. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  143. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  144. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  146. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  147. package/esm/LinearGenomeView/components/util.js +27 -6
  148. package/esm/LinearGenomeView/consts.d.ts +7 -2
  149. package/esm/LinearGenomeView/consts.js +18 -2
  150. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  151. package/esm/LinearGenomeView/flyTo.js +135 -0
  152. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  153. package/esm/LinearGenomeView/headerFit.js +59 -0
  154. package/esm/LinearGenomeView/index.d.ts +32 -2
  155. package/esm/LinearGenomeView/index.js +16 -6
  156. package/esm/LinearGenomeView/initKeys.d.ts +12 -0
  157. package/esm/LinearGenomeView/initKeys.js +68 -0
  158. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  159. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  160. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  161. package/esm/LinearGenomeView/launchKeys.js +23 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +58 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +3238 -136
  169. package/esm/LinearGenomeView/model.js +2425 -528
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +138 -0
  223. package/esm/index.d.ts +122 -1235
  224. package/esm/index.js +101 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +55 -11
  228. package/esm/searchUtils.js +342 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,31 +1,47 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ScrollZoomToggle from '@jbrowse/core/ui/ScrollZoomToggle';
2
3
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
- import { FormGroup } from '@mui/material';
4
+ import useMeasure from '@jbrowse/core/util/useMeasure';
4
5
  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";
6
+ import { HEADER_BAR_HEIGHT } from '../consts.js';
7
+ import { headerFit } from '../headerFit.js';
8
+ import HeaderClearHighlightButton, { highlightedDisplays, } from './HeaderClearHighlightButton.js';
9
+ import HeaderPanControls from './HeaderPanControls.js';
10
+ import HeaderRegionWidth from './HeaderRegionWidth.js';
11
+ import HeaderTrackSelectorButton from './HeaderTrackSelectorButton.js';
12
+ import HeaderZoomControls from './HeaderZoomControls.js';
13
+ import OverviewScalebar from './OverviewScalebar.js';
14
+ import SearchBox, { searchBoxWidth } from './SearchBox.js';
12
15
  const useStyles = makeStyles()({
13
16
  headerBar: {
14
17
  display: 'flex',
15
- height: HEADER_BAR_HEIGHT,
16
- },
17
- headerForm: {
18
- flexWrap: 'nowrap',
19
- marginRight: 7,
18
+ alignItems: 'center',
19
+ gap: 4,
20
+ // a floor, not a height. The constant was written onto this row by #4237 so
21
+ // the sticky offsets summing it would be true, and the row's own content
22
+ // reaches it at a 28px root font — the search box measures 48.13 there —
23
+ // after which a fixed height holds the row smaller than what is in it
24
+ minHeight: HEADER_BAR_HEIGHT,
20
25
  },
21
26
  spacer: {
22
27
  flexGrow: 1,
23
28
  },
24
29
  });
25
- const Controls = function ({ model }) {
30
+ const Controls = observer(function Controls({ model, }) {
26
31
  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
- };
32
+ // the row itself, not `model.width`: what the pieces below have to fit into
33
+ // is this box, and the offset between it and the view's measured width
34
+ // differs between the app's view container, an embedded host and a synteny
35
+ // row
36
+ const [ref, { width }] = useMeasure('width');
37
+ const highlighted = highlightedDisplays(model);
38
+ const fit = headerFit({
39
+ width,
40
+ searchBoxPx: searchBoxWidth(model.coarseVisibleLocStrings),
41
+ clearHighlight: highlighted.length > 0,
42
+ });
43
+ return (_jsxs("div", { className: classes.headerBar, ref: ref, children: [_jsx(HeaderTrackSelectorButton, { model: model, indent: fit.trackSelectorIndent }), _jsx(ScrollZoomToggle, { model: model, iconOnly: !fit.scrollZoomLabel }), _jsx("div", { className: classes.spacer }), _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 })] }));
44
+ });
29
45
  const LinearGenomeViewHeader = observer(function LinearGenomeViewHeader({ model, }) {
30
46
  const { hideHeader, hideHeaderOverview } = model;
31
47
  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 highlight in the view at once. 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 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,30 @@
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
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import ArrowBackIcon from '@mui/icons-material/ArrowBack';
4
4
  import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
5
5
  import { Button, alpha } from '@mui/material';
6
- import { SPACING } from "../consts.js";
6
+ import { SPACING, WIDGET_HEIGHT } from '../consts.js';
7
7
  const useStyles = makeStyles()(theme => ({
8
8
  panButton: {
9
9
  background: alpha(theme.palette.background.paper, 0.8),
10
- color: theme.palette.text.primary,
10
+ height: WIDGET_HEIGHT,
11
11
  margin: SPACING,
12
12
  },
13
+ // the arrows are the whole button, so MUI's 64px text-button minimum and the
14
+ // gap either side of it are pure air — the pair gives up 80px of it when the
15
+ // header can't hold everything
16
+ compact: {
17
+ margin: 1,
18
+ minWidth: 0,
19
+ padding: theme.spacing(0, 0.5),
20
+ },
13
21
  }));
14
- export default function HeaderPanControls({ model }) {
15
- const { classes } = useStyles();
16
- return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outlined", className: classes.panButton, onClick: () => {
22
+ export default function HeaderPanControls({ model, compact, }) {
23
+ const { classes, cx } = useStyles();
24
+ const className = cx(classes.panButton, compact && classes.compact);
25
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outlined", "aria-label": "Pan left", className: className, onClick: () => {
17
26
  model.slide(-0.9);
18
- }, children: _jsx(ArrowBackIcon, {}) }), _jsx(Button, { variant: "outlined", className: classes.panButton, onClick: () => {
27
+ }, children: _jsx(ArrowBackIcon, {}) }), _jsx(Button, { variant: "outlined", "aria-label": "Pan right", className: className, onClick: () => {
19
28
  model.slide(0.9);
20
29
  }, children: _jsx(ArrowForwardIcon, {}) })] }));
21
30
  }
@@ -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;
@@ -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,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { lazy, useEffect, useState } from 'react';
2
+ import { lazy, 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, getDialogHost } 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 { showAllRegionsMenuItem } from '../menuItems.js';
10
+ import ZoomButton from './ZoomButton.js';
11
+ const RegionWidthEditorDialog = lazy(() => import('./RegionWidthEditorDialog.js'));
12
12
  const useStyles = makeStyles()(theme => ({
13
13
  container: {
14
14
  display: 'flex',
@@ -18,54 +18,70 @@ const useStyles = makeStyles()(theme => ({
18
18
  slider: {
19
19
  width: 100,
20
20
  color: theme.palette.text.secondary,
21
+ // The value here is live `bpPerPx`, so MUI's default 150ms ease on the thumb
22
+ // and the track restarts on every animation frame of a wheel zoom: the
23
+ // transition never completes, the thumb trails the zoom it is reporting, and
24
+ // the compositor gives up on the track's animated width every frame. A
25
+ // slider that reports a value rather than being dragged to one wants no
26
+ // transition at all.
27
+ '& .MuiSlider-thumb, & .MuiSlider-track': {
28
+ transition: 'none',
29
+ },
21
30
  },
22
31
  }));
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, }) {
28
- 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
- })),
32
+ function getZoomMenuItems(model) {
33
+ return [
34
+ ...[10, 50, 100].map(r => ({
35
+ label: `Zoom in ${r}x`,
36
+ onClick: () => {
37
+ model.zoom(model.bpPerPx / r);
38
+ },
39
+ })),
40
+ ...[10, 50, 100].map(r => ({
41
+ label: `Zoom out ${r}x`,
42
+ onClick: () => {
43
+ model.zoom(model.bpPerPx * r);
44
+ },
45
+ })),
46
+ showAllRegionsMenuItem(model),
47
+ {
48
+ label: 'Custom zoom',
49
+ onClick: () => {
50
+ getDialogHost(model).queueDialog(handleClose => [
51
+ RegionWidthEditorDialog,
57
52
  {
58
- label: 'Custom zoom',
59
- onClick: () => {
60
- getSession(model).queueDialog(handleClose => [
61
- RegionWidthEditorDialog,
62
- {
63
- model,
64
- handleClose,
65
- },
66
- ]);
67
- },
53
+ model,
54
+ handleClose,
68
55
  },
69
- ], children: _jsx(MoreVert, {}) })] }));
56
+ ]);
57
+ },
58
+ },
59
+ ];
60
+ }
61
+ // The slider tracks live `bpPerPx`, which changes on every animation frame of a
62
+ // zoom. Isolated into its own observer so the surrounding zoom buttons/menu —
63
+ // whose MUI Tooltip/IconButton machinery is comparatively expensive and only
64
+ // depends on the debounced `coarseBpPerPx` — don't re-render every frame.
65
+ const ZoomSlider = observer(function ZoomSlider({ model, }) {
66
+ const { classes } = useStyles();
67
+ const { width, maxBpPerPx, minBpPerPx, bpPerPx } = model;
68
+ const [dragValue, setDragValue] = useState(null);
69
+ const value = dragValue ?? -Math.log2(bpPerPx) * 100;
70
+ return (_jsx(SingleSlider, { size: "small", className: classes.slider, value: value, min: -Math.log2(maxBpPerPx) * 100, max: -Math.log2(minBpPerPx) * 100, onChangeCommitted: val => {
71
+ setDragValue(null);
72
+ model.cancelZoomAnimation();
73
+ model.zoomTo(2 ** (-val / 100));
74
+ }, valueLabelDisplay: "auto", valueLabelFormat: newValue => `Window size: ${getBpDisplayStr(2 ** (-newValue / 100) * width)}`, onChange: val => {
75
+ // Take over from any in-flight animated zoom as soon as the user grabs
76
+ // the thumb, so the view stops lurching underneath the drag.
77
+ if (dragValue === null) {
78
+ model.cancelZoomAnimation();
79
+ }
80
+ setDragValue(val);
81
+ } }));
82
+ });
83
+ const HeaderZoomControls = observer(function HeaderZoomControls({ model, showSlider = true, }) {
84
+ const { classes } = useStyles();
85
+ 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: () => getZoomMenuItems(model), children: _jsx(MoreVert, {}) })] }));
70
86
  });
71
87
  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,21 +1,23 @@
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 { useHighlightChip } from '@jbrowse/core/ui/highlightChipReveal';
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';
6
+ import { useTheme } from '@mui/material';
9
7
  import { observer } from 'mobx-react';
10
- import HighlightBand from "./HighlightBand.js";
8
+ import HighlightBand from './HighlightBand.js';
9
+ import HighlightChip from './HighlightChip.js';
10
+ import { getHighlightColor } from './util.js';
11
+ // A band narrower than the link-icon chip clips it into a smudge, so below this
12
+ // width the chip is dropped (the band itself still draws).
13
+ const CHIP_MIN_WIDTH = 24;
11
14
  const Highlight = observer(function Highlight({ model, highlight, }) {
12
15
  const theme = useTheme();
13
- const session = getSession(model);
14
16
  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: [
17
+ const bandColor = getHighlightColor(highlight, theme);
18
+ const label = model.labelsVisible ? highlight.label : undefined;
19
+ const { chipVisible, setMenuOpen } = useHighlightChip(coords, model.showHighlightChips);
20
+ return coords ? (_jsx(HighlightBand, { coords: coords, background: bandColor.toRgbString(), label: label, children: chipVisible && coords.width >= CHIP_MIN_WIDTH ? (_jsx(HighlightChip, { color: bandColor, label: label, tooltip: highlight.label ?? 'Highlighted region', setOpen: setMenuOpen, menuItems: [
19
21
  {
20
22
  label: 'Dismiss highlight',
21
23
  icon: CloseIcon,
@@ -24,19 +26,13 @@ const Highlight = observer(function Highlight({ model, 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
+ // Shared band renderer for LGV and grid-bookmark highlights; OverviewHighlight
28
+ // stays separate (different bpToPx API). A non-interactive 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,9 @@
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, setOpen, }: {
4
+ color: Colord;
5
+ label?: string;
6
+ tooltip?: string;
7
+ menuItems: MenuItem[];
8
+ setOpen?: (arg: boolean) => void;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
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 while the band is revealing it
6
+ // (see `useHighlightChip`): a link icon tinted to the band color plus an
7
+ // optional inline label, wrapped in a context menu. Sets its own pointer-events
8
+ // since the band is click-through. `setOpen` is how the band learns to keep the
9
+ // chip drawn while the menu is up.
10
+ export default function HighlightChip({ color, label, tooltip, menuItems, setOpen, }) {
11
+ // hide the icon color when the band is fully transparent ("label-only"
12
+ // highlight); otherwise bump to 0.8 alpha so the chip stays legible
13
+ const chipAlpha = color.alpha() === 0 ? 0 : 0.8;
14
+ return (_jsx(Box, { sx: { pointerEvents: 'auto' }, children: _jsx(CascadingMenuButton, { "data-testid": "highlight-chip", menuItems: menuItems, setOpen: setOpen, 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] }) }) }) }));
15
+ }