@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,8 +1,10 @@
1
1
  import { useCallback, useEffect, useState } from 'react';
2
- import { getRelativeX } from "./util.js";
2
+ import { getRelativeX } from '@jbrowse/core/util/getRelativeX';
3
3
  export function useRangeSelect(ref, model, shiftOnly) {
4
4
  const [startX, setStartX] = useState();
5
5
  const [currentX, setCurrentX] = useState();
6
+ // clientX and clientY used for anchorPosition for menu
7
+ // offsetX used for calculations about width of selection
6
8
  const [anchorPosition, setAnchorPosition] = useState();
7
9
  const [guideX, setGuideX] = useState();
8
10
  const mouseDragging = startX !== undefined && anchorPosition === undefined;
@@ -13,102 +15,99 @@ export function useRangeSelect(ref, model, shiftOnly) {
13
15
  setGuideX(undefined);
14
16
  }, []);
15
17
  useEffect(() => {
16
- function computeOffsets(offsetX) {
17
- if (startX === undefined) {
18
- return;
19
- }
20
- const leftPx = Math.min(startX, offsetX);
21
- const rightPx = Math.max(startX, offsetX);
22
- return {
23
- leftOffset: model.pxToBp(leftPx),
24
- rightOffset: model.pxToBp(rightPx),
25
- };
18
+ const el = ref.current;
19
+ if (!mouseDragging || !el) {
20
+ return;
26
21
  }
22
+ // the container's left edge is fixed for the duration of a drag, so measure
23
+ // it once here rather than calling getBoundingClientRect on every mousemove
24
+ const { left } = el.getBoundingClientRect();
27
25
  function globalMouseMove(event) {
28
- if (ref.current && mouseDragging) {
29
- const relativeX = getRelativeX(event, ref.current);
30
- setCurrentX(relativeX);
31
- }
26
+ setCurrentX(event.clientX - left);
32
27
  }
33
28
  function globalMouseUp(event) {
34
- if (startX !== undefined && ref.current) {
35
- const { clientX, clientY } = event;
36
- const offsetX = getRelativeX(event, ref.current);
37
- const isClick = Math.abs(offsetX - startX) <= 3;
38
- if (isClick && model.scalebarRefNameClickPending) {
39
- setStartX(undefined);
40
- setCurrentX(undefined);
41
- return;
42
- }
43
- if (!isClick && model.scalebarRefNameClickPending) {
44
- model.setScalebarRefNameClickPending(false);
45
- }
46
- setAnchorPosition({
47
- offsetX,
48
- clientX,
49
- clientY,
50
- isClick,
51
- });
52
- if (isClick) {
53
- setGuideX(offsetX);
54
- }
55
- else {
56
- const args = computeOffsets(offsetX);
57
- if (args) {
58
- model.setOffsets(args.leftOffset, args.rightOffset);
59
- }
60
- setGuideX(undefined);
61
- }
29
+ if (startX === undefined) {
30
+ return;
31
+ }
32
+ const { clientX, clientY } = event;
33
+ const offsetX = clientX - left;
34
+ const isClick = Math.abs(offsetX - startX) <= 3;
35
+ // Clear the flag unconditionally once consumed: the label's own onClick
36
+ // also clears it, but that only fires if mouseup lands on the label, so
37
+ // relying on it alone can leave the flag stuck (swallowing the next
38
+ // scalebar click) when mouseup drifts a few px off the label edge.
39
+ const startedOnRefLabel = model.scalebarRefNameClickPending;
40
+ if (startedOnRefLabel) {
41
+ model.setScalebarRefNameClickPending(false);
42
+ }
43
+ // A click that began on a scalebar refname label is handled by that
44
+ // label's onClick (opens its menu), not by the rubberband menu here.
45
+ // Drop the hover guide too: the label's menu covers it while it is open,
46
+ // and nothing else clears it, so picking an item like "Focus on X" left a
47
+ // red line stranded on the scalebar with the pointer nowhere near it
48
+ if (isClick && startedOnRefLabel) {
49
+ setStartX(undefined);
50
+ setCurrentX(undefined);
51
+ setGuideX(undefined);
52
+ return;
53
+ }
54
+ setAnchorPosition({ offsetX, clientX, clientY, isClick });
55
+ if (isClick) {
56
+ setGuideX(offsetX);
57
+ }
58
+ else {
59
+ model.setOffsets(model.pxToBp(Math.min(startX, offsetX)), model.pxToBp(Math.max(startX, offsetX)));
60
+ setGuideX(undefined);
62
61
  }
63
62
  }
64
- if (mouseDragging) {
65
- window.addEventListener('mousemove', globalMouseMove);
66
- window.addEventListener('mouseup', globalMouseUp);
67
- return () => {
68
- window.removeEventListener('mousemove', globalMouseMove);
69
- window.removeEventListener('mouseup', globalMouseUp);
70
- };
63
+ function globalKeyDown(event) {
64
+ if (event.key === 'Escape') {
65
+ setStartX(undefined);
66
+ setCurrentX(undefined);
67
+ }
71
68
  }
72
- return () => { };
73
- }, [startX, mouseDragging, model, ref, handleClose]);
69
+ window.addEventListener('mousemove', globalMouseMove);
70
+ window.addEventListener('mouseup', globalMouseUp);
71
+ window.addEventListener('keydown', globalKeyDown);
72
+ return () => {
73
+ window.removeEventListener('mousemove', globalMouseMove);
74
+ window.removeEventListener('mouseup', globalMouseUp);
75
+ window.removeEventListener('keydown', globalKeyDown);
76
+ };
77
+ }, [startX, mouseDragging, model, ref]);
74
78
  function mouseDown(event) {
75
79
  if (shiftOnly && !event.shiftKey) {
76
80
  return;
77
81
  }
82
+ // a press with the refName menu already open reopens it on the label under
83
+ // the pointer; same stranded-guide reasoning as the mouseup path above
78
84
  if (model.isScalebarRefNameMenuOpen) {
85
+ setGuideX(undefined);
79
86
  return;
80
87
  }
81
88
  event.preventDefault();
82
89
  event.stopPropagation();
90
+ // clear any leftover menu/selection so a fresh drag isn't blocked by a
91
+ // stale anchorPosition keeping mouseDragging false
92
+ setAnchorPosition(undefined);
83
93
  const relativeX = getRelativeX(event, ref.current);
84
94
  setStartX(relativeX);
85
95
  setCurrentX(relativeX);
86
96
  }
87
97
  function mouseMove(event) {
98
+ // Keep the rubberband visible while a drag-selection menu is open
88
99
  if (anchorPosition?.isClick === false) {
89
100
  return;
90
101
  }
91
- if (mouseDragging) {
92
- setGuideX(undefined);
93
- }
94
- else if (shiftOnly) {
95
- if (event.shiftKey) {
96
- setGuideX(getRelativeX(event, ref.current));
97
- }
98
- else {
99
- setGuideX(undefined);
100
- }
101
- }
102
- else {
103
- setGuideX(getRelativeX(event, ref.current));
104
- }
102
+ const wantsGuide = !mouseDragging && (!shiftOnly || event.shiftKey);
103
+ setGuideX(wantsGuide ? getRelativeX(event, ref.current) : undefined);
105
104
  }
106
105
  function mouseOut() {
107
106
  if (!anchorPosition?.isClick) {
108
107
  setGuideX(undefined);
109
108
  }
110
109
  }
111
- function handleMenuItemClick(_, callback) {
110
+ function handleMenuItemClick(callback) {
112
111
  callback();
113
112
  handleClose();
114
113
  }
@@ -117,42 +116,34 @@ export function useRangeSelect(ref, model, shiftOnly) {
117
116
  const clickBpOffset = isClick
118
117
  ? model.pxToBp(anchorPosition.offsetX)
119
118
  : undefined;
120
- if (startX === undefined) {
121
- return {
122
- open,
123
- isClick,
124
- clickBpOffset,
125
- guideX,
126
- mouseDown,
127
- mouseMove,
128
- mouseOut,
129
- handleClose,
130
- handleMenuItemClick,
131
- anchorPosition,
119
+ // rubberband geometry only exists while a drag is in progress (startX set);
120
+ // grouped so a single truthiness check narrows all fields for RubberbandSpan
121
+ let rubberband;
122
+ if (startX !== undefined) {
123
+ const right = anchorPosition ? anchorPosition.offsetX : (currentX ?? startX);
124
+ const left = Math.min(right, startX);
125
+ const width = Math.abs(right - startX);
126
+ rubberband = {
127
+ leftBpOffset: model.pxToBp(left),
128
+ rightBpOffset: model.pxToBp(left + width),
129
+ numOfBpSelected: Math.ceil(width * model.bpPerPx),
130
+ width,
131
+ left,
132
132
  };
133
133
  }
134
- const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
135
- const left = Math.min(right, startX);
136
- const width = Math.abs(right - startX);
137
- const leftBpOffset = model.pxToBp(left);
138
- const rightBpOffset = model.pxToBp(left + width);
139
- const numOfBpSelected = Math.ceil(width * model.bpPerPx);
140
134
  return {
141
135
  open,
142
136
  isClick,
143
137
  clickBpOffset,
144
138
  guideX,
145
- rubberbandOn: !isClick,
139
+ // true only mid-drag and not a click — drives RubberbandSpan vs guide
140
+ rubberbandOn: rubberband !== undefined && !isClick,
146
141
  mouseDown,
147
142
  mouseMove,
148
143
  mouseOut,
149
144
  handleClose,
150
145
  handleMenuItemClick,
151
- leftBpOffset,
152
- rightBpOffset,
153
146
  anchorPosition,
154
- numOfBpSelected,
155
- width,
156
- left,
147
+ rubberband,
157
148
  };
158
149
  }
@@ -0,0 +1,26 @@
1
+ import type { MenuItem } from '@jbrowse/core/ui';
2
+ /**
3
+ * Visibility and orientation of the search-box strip a stacked-LGV header
4
+ * draws, persisted per regime (few vs many rows) rather than under one global
5
+ * key, so the "compact default" heuristic isn't permanently overridden by a
6
+ * choice made in a differently-sized view.
7
+ *
8
+ * `prefix` keys the storage per container — the comparative view and the
9
+ * breakpoint split view remember their own. Everything else is shared, because
10
+ * the two headers held a copy each and the copies carried a comment telling the
11
+ * next editor to change the labels in both. They already import
12
+ * `HeaderSearchBoxRow` from this plugin, so the shared home costs no new
13
+ * dependency edge.
14
+ */
15
+ export declare function useSearchBoxPrefs(prefix: string, numViews: number): {
16
+ showSearchBoxes: boolean;
17
+ setShowSearchBoxes: (value: boolean | ((val: boolean) => boolean)) => void;
18
+ sideBySide: boolean;
19
+ setSideBySide: (value: boolean | ((val: boolean) => boolean)) => void;
20
+ };
21
+ export type SearchBoxPrefs = ReturnType<typeof useSearchBoxPrefs>;
22
+ /**
23
+ * The menu rows that drive those prefs. "Stacked" rather than "Vertical": the
24
+ * two headers name the same state and had drifted apart on it once already.
25
+ */
26
+ export declare function searchBoxMenuItems({ showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide, }: SearchBoxPrefs): MenuItem[];
@@ -0,0 +1,58 @@
1
+ import { useLocalStorage } from '@jbrowse/core/util/hooks';
2
+ /**
3
+ * Visibility and orientation of the search-box strip a stacked-LGV header
4
+ * draws, persisted per regime (few vs many rows) rather than under one global
5
+ * key, so the "compact default" heuristic isn't permanently overridden by a
6
+ * choice made in a differently-sized view.
7
+ *
8
+ * `prefix` keys the storage per container — the comparative view and the
9
+ * breakpoint split view remember their own. Everything else is shared, because
10
+ * the two headers held a copy each and the copies carried a comment telling the
11
+ * next editor to change the labels in both. They already import
12
+ * `HeaderSearchBoxRow` from this plugin, so the shared home costs no new
13
+ * dependency edge.
14
+ */
15
+ export function useSearchBoxPrefs(prefix, numViews) {
16
+ const compact = numViews <= 3;
17
+ const regime = compact ? 'compact' : 'large';
18
+ const [showSearchBoxes, setShowSearchBoxes] = useLocalStorage(`${prefix}-showSearchBoxes-${regime}`, compact);
19
+ const [sideBySide, setSideBySide] = useLocalStorage(`${prefix}-sideBySide-${regime}`, compact);
20
+ return { showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide };
21
+ }
22
+ /**
23
+ * The menu rows that drive those prefs. "Stacked" rather than "Vertical": the
24
+ * two headers name the same state and had drifted apart on it once already.
25
+ */
26
+ export function searchBoxMenuItems({ showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide, }) {
27
+ return [
28
+ {
29
+ label: 'Show search boxes',
30
+ type: 'checkbox',
31
+ checked: showSearchBoxes,
32
+ onClick: () => {
33
+ setShowSearchBoxes(!showSearchBoxes);
34
+ },
35
+ },
36
+ {
37
+ label: 'Search box orientation',
38
+ subMenu: [
39
+ {
40
+ label: 'Side-by-side',
41
+ type: 'radio',
42
+ checked: sideBySide,
43
+ onClick: () => {
44
+ setSideBySide(true);
45
+ },
46
+ },
47
+ {
48
+ label: 'Stacked',
49
+ type: 'radio',
50
+ checked: !sideBySide,
51
+ onClick: () => {
52
+ setSideBySide(false);
53
+ },
54
+ },
55
+ ],
56
+ },
57
+ ];
58
+ }
@@ -1,5 +1,5 @@
1
- import type React from 'react';
2
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
+ import type React from 'react';
3
3
  export declare function useSideScroll(model: LinearGenomeViewModel): {
4
4
  mouseDown: (event: React.MouseEvent) => void;
5
5
  mouseUp: (event: React.MouseEvent) => void;
@@ -1,27 +1,64 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
+ // A press that travels further than this is a pan, and the click that ends it
3
+ // is not a click. A hand that wobbles two pixels can still select something.
4
+ const PAN_CLICK_THRESHOLD_PX = 4;
5
+ // The pan publishes its state as attributes on the element the press landed in
6
+ // (TracksContainer), so a track's own pointer handlers read it with `closest`
7
+ // and nothing has to hand them a ref or a model field — the same marker shape
8
+ // as `data-gesture-owner`. `data-pan-dragging` is present from mousedown to
9
+ // mouseup; `data-pan-moved` is set once the press travels past the threshold
10
+ // and cleared by the next press, so it still answers for the click that
11
+ // follows mouseup.
12
+ const PAN_DRAGGING_ATTR = 'data-pan-dragging';
13
+ const PAN_MOVED_ATTR = 'data-pan-moved';
2
14
  export function useSideScroll(model) {
3
15
  const [mouseDragging, setMouseDragging] = useState(false);
4
- const scheduled = useRef(false);
5
- const prevX = useRef(0);
16
+ const scheduledRef = useRef(false);
17
+ const rafRef = useRef(null);
18
+ const startXRef = useRef(0);
19
+ const prevXRef = useRef(0);
20
+ const currXRef = useRef(0);
21
+ const hostRef = useRef(null);
6
22
  useEffect(() => {
7
- let cleanup = () => { };
23
+ // apply the movement accumulated since the previous frame, then advance the
24
+ // baseline. shared by the rAF tick and the mouseup flush
25
+ function flushScroll() {
26
+ const distance = currXRef.current - prevXRef.current;
27
+ if (distance) {
28
+ model.horizontalScroll(-distance);
29
+ prevXRef.current = currXRef.current;
30
+ }
31
+ }
8
32
  function globalMouseMove(event) {
9
33
  event.preventDefault();
10
- const currX = event.clientX;
11
- const distance = currX - prevX.current;
12
- if (distance) {
13
- if (!scheduled.current) {
14
- scheduled.current = true;
15
- window.requestAnimationFrame(() => {
16
- model.horizontalScroll(-distance);
17
- scheduled.current = false;
18
- prevX.current = event.clientX;
19
- });
20
- }
34
+ currXRef.current = event.clientX;
35
+ if (Math.abs(currXRef.current - startXRef.current) > PAN_CLICK_THRESHOLD_PX) {
36
+ hostRef.current?.setAttribute(PAN_MOVED_ATTR, '');
37
+ }
38
+ const distance = currXRef.current - prevXRef.current;
39
+ // use rAF to make it so multiple event handlers aren't fired per-frame
40
+ // see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
41
+ if (distance && !scheduledRef.current) {
42
+ scheduledRef.current = true;
43
+ rafRef.current = window.requestAnimationFrame(() => {
44
+ rafRef.current = null;
45
+ scheduledRef.current = false;
46
+ flushScroll();
47
+ });
21
48
  }
22
49
  }
23
50
  function globalMouseUp() {
24
- prevX.current = 0;
51
+ // flush any movement still queued for the next frame before ending the
52
+ // drag; otherwise a quick flick (mousedown/move/up within one frame) or
53
+ // the cleanup below would cancel it and drop the scroll
54
+ if (rafRef.current !== null) {
55
+ window.cancelAnimationFrame(rafRef.current);
56
+ rafRef.current = null;
57
+ scheduledRef.current = false;
58
+ flushScroll();
59
+ }
60
+ prevXRef.current = 0;
61
+ hostRef.current?.removeAttribute(PAN_DRAGGING_ATTR);
25
62
  if (mouseDragging) {
26
63
  setMouseDragging(false);
27
64
  }
@@ -29,28 +66,59 @@ export function useSideScroll(model) {
29
66
  if (mouseDragging) {
30
67
  window.addEventListener('mousemove', globalMouseMove, true);
31
68
  window.addEventListener('mouseup', globalMouseUp, true);
32
- cleanup = () => {
69
+ return () => {
33
70
  window.removeEventListener('mousemove', globalMouseMove, true);
34
71
  window.removeEventListener('mouseup', globalMouseUp, true);
72
+ // drop a frame queued mid-drag so it can't fire a stray scroll after
73
+ // unmount (matches `useVirtualScrollWheel`'s cleanup)
74
+ if (rafRef.current !== null) {
75
+ window.cancelAnimationFrame(rafRef.current);
76
+ rafRef.current = null;
77
+ }
78
+ scheduledRef.current = false;
35
79
  };
36
80
  }
37
- return cleanup;
81
+ return undefined;
38
82
  }, [model, mouseDragging]);
39
83
  function mouseDown(event) {
84
+ // Cleared for EVERY press, ahead of the returns below, because the marker
85
+ // outlives the gesture that set it: a pan, then a shift-press or a press on
86
+ // a button, used to leave `data-pan-moved` standing on the container. The
87
+ // one reader today re-enters through a press that reaches the bottom of
88
+ // this function, so nothing was wrong — but these attributes are a DOM
89
+ // contract other displays read with `closest`, and a stale true is what the
90
+ // next reader would inherit.
91
+ event.currentTarget.removeAttribute(PAN_MOVED_ATTR);
40
92
  if (event.shiftKey) {
41
93
  return;
42
94
  }
95
+ // skip the click-drag pan when pressing an interactive control: a
96
+ // draggable element, a control that claimed the press (resize handles, the
97
+ // scalebar), or a button (e.g. the menu button on a highlight/bookmark
98
+ // chip, whose actual target is the icon inside it). All three are matched
99
+ // with `closest`, since the press usually lands on a child of the control
100
+ // rather than the control itself.
43
101
  const target = event.target;
44
- if (target.draggable || target.dataset.resizer) {
102
+ if (target.draggable ||
103
+ target.closest('[data-gesture-owner]') ||
104
+ target.closest('button')) {
45
105
  return;
46
106
  }
107
+ // otherwise do click and drag scroll
47
108
  if (event.button === 0) {
48
- prevX.current = event.clientX;
109
+ hostRef.current = event.currentTarget;
110
+ event.currentTarget.setAttribute(PAN_DRAGGING_ATTR, '');
111
+ startXRef.current = event.clientX;
112
+ prevXRef.current = event.clientX;
113
+ currXRef.current = event.clientX;
49
114
  setMouseDragging(true);
50
115
  }
51
116
  }
117
+ // this local mouseup is used in addition to the global because sometimes
118
+ // the global add/remove are not called in time, resulting in issue #533
52
119
  function mouseUp(event) {
53
120
  event.preventDefault();
121
+ hostRef.current?.removeAttribute(PAN_DRAGGING_ATTR);
54
122
  setMouseDragging(false);
55
123
  }
56
124
  return { mouseDown, mouseUp };
@@ -1,14 +1,28 @@
1
1
  import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
2
- export { fetchResults, splitLast } from '../../searchUtils.ts';
3
- export declare function getRelativeX(event: {
4
- clientX: number;
5
- target: EventTarget | null;
6
- }, element: HTMLElement | null): number;
2
+ import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
3
+ export { getHighlightColor, highlightKey } from '@jbrowse/core/util/highlights';
4
+ export declare const elidedBlockStyles: {
5
+ readonly backgroundColor: '#999';
6
+ readonly backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)';
7
+ };
8
+ export type Cytoband = ReturnType<typeof getCytobands>[number];
7
9
  export declare function getCytobands(assembly: Assembly | undefined, refName: string): {
8
10
  refName: string;
9
11
  start: number;
10
12
  end: number;
11
13
  type: string;
12
- name: any;
14
+ name: string | undefined;
13
15
  }[];
16
+ /**
17
+ * The bp under a pixel of the overview strip. The strip spans the whole view,
18
+ * but the overview *layout* is laid out in the pixels after the chromosome-name
19
+ * gutter (cytobandOffset), so a press or hover on that gutter sits left of the
20
+ * layout's own origin. `pxToBp` extrapolates there rather than refusing, and
21
+ * every overview reader took it at face value: the hover and rubberband labels
22
+ * read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
23
+ * silently, because `centerAt` cannot resolve a coordinate that is in no region.
24
+ * Clamping into the layout's own span makes all three name the genome's start,
25
+ * which is what the gutter is adjacent to.
26
+ */
27
+ export declare function overviewPxToBp(overview: ViewLayout, px: number, cytobandOffset: number): import("@jbrowse/core/util/Base1DUtils").PxToBpResult;
14
28
  export declare function shouldSwapTracks(lastSwapY: number | undefined, currentY: number, movingDown: boolean): boolean;
@@ -1,17 +1,38 @@
1
- export { fetchResults, splitLast } from "../../searchUtils.js";
2
- export function getRelativeX(event, element) {
3
- return event.clientX - (element?.getBoundingClientRect().left || 0);
4
- }
1
+ import { clamp } from '@jbrowse/core/util';
2
+ import { pxToBp } from '@jbrowse/core/util/Base1DUtils';
3
+ // getHighlightColor/highlightKey live in core so the dotplot highlight bands can
4
+ // share the exact same color and React-key semantics
5
+ export { getHighlightColor, highlightKey } from '@jbrowse/core/util/highlights';
6
+ // Shared style for elided (collapsed) blocks — striped grey pattern used
7
+ // consistently across OverviewScalebar, ScalebarCoordinateLabels, and Gridlines
8
+ export const elidedBlockStyles = {
9
+ backgroundColor: '#999',
10
+ backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)',
11
+ };
5
12
  export function getCytobands(assembly, refName) {
6
13
  return (assembly?.cytobands
7
14
  ?.map(f => ({
8
- refName: assembly.getCanonicalRefName(f.get('refName')) || f.get('refName'),
15
+ refName: assembly.getCanonicalRefName2(f.get('refName')),
9
16
  start: f.get('start'),
10
17
  end: f.get('end'),
11
18
  type: f.get('gieStain'),
12
19
  name: f.get('name'),
13
20
  }))
14
- .filter(f => f.refName === refName) || []);
21
+ .filter(f => f.refName === refName) ?? []);
22
+ }
23
+ /**
24
+ * The bp under a pixel of the overview strip. The strip spans the whole view,
25
+ * but the overview *layout* is laid out in the pixels after the chromosome-name
26
+ * gutter (cytobandOffset), so a press or hover on that gutter sits left of the
27
+ * layout's own origin. `pxToBp` extrapolates there rather than refusing, and
28
+ * every overview reader took it at face value: the hover and rubberband labels
29
+ * read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
30
+ * silently, because `centerAt` cannot resolve a coordinate that is in no region.
31
+ * Clamping into the layout's own span makes all three name the genome's start,
32
+ * which is what the gutter is adjacent to.
33
+ */
34
+ export function overviewPxToBp(overview, px, cytobandOffset) {
35
+ return pxToBp(overview, clamp(px - cytobandOffset, 0, overview.width - 1));
15
36
  }
16
37
  const MIN_DRAG_DISTANCE = 30;
17
38
  export function shouldSwapTracks(lastSwapY, currentY, movingDown) {
@@ -1,7 +1,12 @@
1
+ export declare const MIN_BP_PER_PX: number;
2
+ export declare const SHOW_ALL_REGIONS_FILL = 0.9;
1
3
  export declare const HEADER_BAR_HEIGHT = 48;
2
4
  export declare const HEADER_OVERVIEW_HEIGHT = 20;
3
5
  export declare const SCALE_BAR_HEIGHT = 17;
4
- export declare const RESIZE_HANDLE_HEIGHT = 3;
5
- export declare const INTER_REGION_PADDING_WIDTH = 2;
6
+ export declare const SVG_SCALEBAR_CAP = 5;
7
+ export declare const RESIZE_HANDLE_HEIGHT = 4;
8
+ export declare const TRACK_TOP_GAP = 2;
9
+ export declare const TRACK_OUTLINE_BORDER = 1;
10
+ export declare const MINIMIZED_TRACK_HEIGHT = 20;
6
11
  export declare const SPACING = 7;
7
12
  export declare const WIDGET_HEIGHT = 32;
@@ -1,7 +1,23 @@
1
+ // most zoomed-in level: 50px per bp
2
+ export const MIN_BP_PER_PX = 1 / 50;
3
+ // fraction of the view width the whole genome fills at the most zoomed-out
4
+ // level, leaving a 10% margin
5
+ export const SHOW_ALL_REGIONS_FILL = 0.9;
1
6
  export const HEADER_BAR_HEIGHT = 48;
2
7
  export const HEADER_OVERVIEW_HEIGHT = 20;
3
8
  export const SCALE_BAR_HEIGHT = 17;
4
- export const RESIZE_HANDLE_HEIGHT = 3;
5
- export const INTER_REGION_PADDING_WIDTH = 2;
9
+ // Half-height of the total-bp scalebar's end caps in the SVG export; also the
10
+ // clearance the bar needs below the assembly label.
11
+ export const SVG_SCALEBAR_CAP = 5;
12
+ // The three pieces of chrome TrackContainer puts around a track's rendering
13
+ // container. The model sums them to place a track without measuring the DOM, so
14
+ // TrackContainer lays its Paper out from these same three and nothing else —
15
+ // the previous spelling had the model on a 3 while the CSS rendered 2 + 1 + 4,
16
+ // which put every model-derived track offset 5px per track above the pixels.
17
+ // The track *label* is deliberately not among them; see `trackChromeHeight`.
18
+ export const RESIZE_HANDLE_HEIGHT = 4;
19
+ export const TRACK_TOP_GAP = 2;
20
+ export const TRACK_OUTLINE_BORDER = 1;
21
+ export const MINIMIZED_TRACK_HEIGHT = 20;
6
22
  export const SPACING = 7;
7
23
  export const WIDGET_HEIGHT = 32;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A window of the view's linearized bp space — the space `windowStartBp` is in,
3
+ * so a position here is invariant under zoom and a flight can be planned once
4
+ * for a path whose scale changes under it.
5
+ */
6
+ export interface FlightViewport {
7
+ centerBp: number;
8
+ windowWidthBp: number;
9
+ }
10
+ export interface Flight {
11
+ durationMs: number;
12
+ /** the viewport at `t` in [0,1]; exactly the destination at t >= 1 */
13
+ at: (t: number) => FlightViewport;
14
+ }
15
+ /**
16
+ * The viewport path from `from` to `to`, and how long to spend on it.
17
+ *
18
+ * The path is equation (9) of the paper cited at the top of this file: it zooms
19
+ * out as it travels and back in as it arrives, along the geodesic that holds
20
+ * the *perceived* velocity constant, so the reader can follow the whole journey
21
+ * rather than watching one blurred smear.
22
+ *
23
+ * A STRAIGHT PAN IS NOT THE ALTERNATIVE, it is the thing this exists to avoid.
24
+ * The jump that wants animating here is a synteny row showing a whole assembly
25
+ * being sent to a mate on another chromosome: tens of megabases at a window of
26
+ * tens of kilobases, which is a thousand screens of travel. Panned at constant
27
+ * scale that is a thousand screens of unreadable streaking and no frame in
28
+ * which the reader is anywhere identifiable. Pulled back to where both ends fit
29
+ * and then dropped in, it is a picture of where they came from and where they
30
+ * landed.
31
+ *
32
+ * The zoomed-out apex is `w0 * cosh(r0)` — for a same-zoom hop, about the
33
+ * distance travelled — so the arc naturally tops out at "both endpoints on
34
+ * screen". A view whose `maxBpPerPx` is tighter than that simply clamps there
35
+ * and flies the middle of the path flat; nothing here has to know the limit,
36
+ * because the caller writes through `zoomTo` and reads back what it got.
37
+ */
38
+ export declare function planFlight(from: FlightViewport, to: FlightViewport): Flight;