@jbrowse/plugin-linear-genome-view 4.2.1 → 5.0.0-beta.1

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 +17 -12
  6. package/esm/LinearGenomeView/FloatingSvgOverlay.d.ts +5 -0
  7. package/esm/LinearGenomeView/FloatingSvgOverlay.js +25 -0
  8. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  9. package/esm/LinearGenomeView/afterAttach.js +257 -88
  10. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  11. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  12. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  13. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  14. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  15. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  16. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  17. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  18. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  19. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  20. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  21. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  22. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  24. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  25. package/esm/LinearGenomeView/components/Header.js +32 -16
  26. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  27. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  28. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  29. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  30. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  31. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  34. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  35. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  36. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  38. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  39. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  40. package/esm/LinearGenomeView/components/Highlight.d.ts +3 -7
  41. package/esm/LinearGenomeView/components/Highlight.js +30 -82
  42. package/esm/LinearGenomeView/components/HighlightBand.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightBand.js +40 -0
  44. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  45. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  46. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  47. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  48. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  49. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  50. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  52. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  54. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  55. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  56. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  57. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  58. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  59. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  60. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  61. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  62. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  63. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -42
  64. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  65. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  66. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  67. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  68. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  69. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  70. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  71. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  72. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  74. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  75. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  76. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  77. package/esm/LinearGenomeView/components/PaddingBlocks.js +51 -0
  78. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  79. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  80. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  81. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  83. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  87. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  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 +142 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  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 +3 -3
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  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 +1 -1
  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 +83 -39
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  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 +32 -85
  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 +1 -1
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +22 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +33 -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 +7 -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 +36 -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 +11 -66
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  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 +1 -1
  147. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  148. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  149. package/esm/LinearGenomeView/components/util.js +27 -6
  150. package/esm/LinearGenomeView/consts.d.ts +7 -2
  151. package/esm/LinearGenomeView/consts.js +18 -2
  152. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  153. package/esm/LinearGenomeView/flyTo.js +135 -0
  154. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  155. package/esm/LinearGenomeView/headerFit.js +59 -0
  156. package/esm/LinearGenomeView/index.d.ts +32 -2
  157. package/esm/LinearGenomeView/index.js +8 -4
  158. package/esm/LinearGenomeView/initKeys.d.ts +13 -0
  159. package/esm/LinearGenomeView/initKeys.js +104 -0
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +6 -10
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +52 -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 +1544 -136
  169. package/esm/LinearGenomeView/model.js +2352 -488
  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 -29
  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 +1263 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +141 -0
  223. package/esm/index.d.ts +112 -1237
  224. package/esm/index.js +102 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +52 -11
  228. package/esm/searchUtils.js +318 -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 -8
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -17
  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 -89
  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;
@@ -1,12 +1,8 @@
1
1
  import type { LinearGenomeViewModel } from '../model.ts';
2
+ import type { HighlightType } from '../types.ts';
2
3
  type LGV = LinearGenomeViewModel;
3
4
  declare const Highlight: ({ model, highlight, }: {
4
5
  model: LGV;
5
- highlight: {
6
- assemblyName: string;
7
- refName: string;
8
- start: number;
9
- end: number;
10
- };
11
- }) => import("react/jsx-runtime").JSX.Element | null;
6
+ highlight: HighlightType;
7
+ }) => import("react").JSX.Element | null;
12
8
  export default Highlight;
@@ -1,90 +1,38 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef, useState } from 'react';
3
- import { Menu } from '@jbrowse/core/ui';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useHighlightChip } from '@jbrowse/core/ui/highlightChipReveal';
4
3
  import { getSession } from '@jbrowse/core/util';
5
- import { colord } from '@jbrowse/core/util/colord';
6
- import { makeStyles } from '@jbrowse/core/util/tss-react';
7
- import BookmarkIcon from '@mui/icons-material/Bookmark';
8
4
  import CloseIcon from '@mui/icons-material/Close';
9
- import LinkIcon from '@mui/icons-material/Link';
10
- import { IconButton, Tooltip } from '@mui/material';
5
+ import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
6
+ import { useTheme } from '@mui/material';
11
7
  import { observer } from 'mobx-react';
12
- const useStyles = makeStyles()(theme => ({
13
- highlight: {
14
- height: '100%',
15
- position: 'absolute',
16
- left: 0,
17
- overflow: 'hidden',
18
- background: colord(theme.palette.highlight.main).alpha(0.35).toRgbString(),
19
- },
20
- linkIcon: {
21
- color: colord(theme.palette.highlight.main).darken(0.2).toRgbString(),
22
- },
23
- z3: {
24
- zIndex: 3,
25
- },
26
- }));
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;
27
14
  const Highlight = observer(function Highlight({ model, highlight, }) {
28
- const { classes } = useStyles();
29
- const [open, setOpen] = useState(false);
30
- const anchorEl = useRef(null);
31
- const session = getSession(model);
32
- const { assemblyManager } = session;
33
- const dismissHighlight = () => {
34
- model.removeHighlight(highlight);
35
- };
36
- function handleClose() {
37
- setOpen(false);
38
- }
39
- const mapCoords = (r) => {
40
- const s = model.bpToPx({
41
- refName: r.refName,
42
- coord: r.start,
43
- });
44
- const e = model.bpToPx({
45
- refName: r.refName,
46
- coord: r.end,
47
- });
48
- return s && e
49
- ? {
50
- width: Math.max(Math.abs(e.offsetPx - s.offsetPx), 3),
51
- left: Math.min(s.offsetPx, e.offsetPx) - model.offsetPx,
52
- }
53
- : undefined;
54
- };
55
- const asm = assemblyManager.get(highlight.assemblyName);
56
- const h = mapCoords({
57
- ...highlight,
58
- refName: asm?.getCanonicalRefName(highlight.refName) ?? highlight.refName,
59
- });
60
- return h ? (_jsxs("div", { className: classes.highlight, style: {
61
- transform: `translateX(${h.left}px)`,
62
- width: h.width,
63
- }, children: [_jsx(Tooltip, { title: "Highlighted from URL parameter", arrow: true, children: _jsx(IconButton, { ref: anchorEl, className: classes.z3, onClick: () => {
64
- setOpen(true);
65
- }, children: _jsx(LinkIcon, { fontSize: "small", className: classes.linkIcon }) }) }), _jsx(Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
66
- callback();
67
- handleClose();
68
- }, open: open, onClose: handleClose, menuItems: [
69
- {
70
- label: 'Dismiss highlight',
71
- icon: CloseIcon,
72
- onClick: () => {
73
- dismissHighlight();
74
- },
15
+ const theme = useTheme();
16
+ const coords = model.getHighlightCoords(highlight);
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: [
21
+ {
22
+ label: 'Dismiss highlight',
23
+ icon: CloseIcon,
24
+ onClick: () => {
25
+ model.removeHighlight(highlight);
75
26
  },
76
- {
77
- label: 'Bookmark highlighted region',
78
- icon: BookmarkIcon,
79
- onClick: () => {
80
- let bookmarkWidget = session.widgets.get('GridBookmark');
81
- if (!bookmarkWidget) {
82
- bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
83
- }
84
- bookmarkWidget.addBookmark(highlight);
85
- dismissHighlight();
86
- },
27
+ },
28
+ {
29
+ label: 'Turn off highlights',
30
+ icon: VisibilityOffIcon,
31
+ onClick: () => {
32
+ getSession(model).setHighlightsVisible(false);
87
33
  },
88
- ] })] })) : null;
34
+ },
35
+ ...model.highlightMenuItems(highlight),
36
+ ] })) : null })) : null;
89
37
  });
90
38
  export default Highlight;
@@ -0,0 +1,9 @@
1
+ export default function HighlightBand({ coords, background, label, children, }: {
2
+ coords: {
3
+ left: number;
4
+ width: number;
5
+ };
6
+ background: string;
7
+ label?: string;
8
+ children?: React.ReactNode;
9
+ }): import("react").JSX.Element;