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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +250 -121
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +32 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  81. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  82. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  83. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  84. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  85. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  86. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  87. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  88. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  90. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  91. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  92. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  93. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  94. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  95. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  96. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  97. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  98. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  99. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  102. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  103. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  104. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  105. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  106. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  107. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  108. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  109. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  110. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  111. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  112. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  113. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  114. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  115. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  116. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  117. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  118. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  119. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  120. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  121. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  122. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  124. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  126. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  127. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  128. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  129. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  130. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  131. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  132. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  133. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  134. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  135. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  136. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  137. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  138. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  139. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  140. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  141. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  142. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  143. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  144. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  146. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  147. package/esm/LinearGenomeView/components/util.js +27 -6
  148. package/esm/LinearGenomeView/consts.d.ts +7 -2
  149. package/esm/LinearGenomeView/consts.js +18 -2
  150. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  151. package/esm/LinearGenomeView/flyTo.js +135 -0
  152. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  153. package/esm/LinearGenomeView/headerFit.js +59 -0
  154. package/esm/LinearGenomeView/index.d.ts +32 -2
  155. package/esm/LinearGenomeView/index.js +16 -6
  156. package/esm/LinearGenomeView/initKeys.d.ts +12 -0
  157. package/esm/LinearGenomeView/initKeys.js +68 -0
  158. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  159. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  160. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  161. package/esm/LinearGenomeView/launchKeys.js +23 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +58 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +3238 -136
  169. package/esm/LinearGenomeView/model.js +2425 -528
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +138 -0
  223. package/esm/index.d.ts +122 -1235
  224. package/esm/index.js +101 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +55 -11
  228. package/esm/searchUtils.js +342 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -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;
@@ -0,0 +1,135 @@
1
+ import { clamp } from '@jbrowse/core/util';
2
+ // The paper's rho: how much the path is willing to zoom out to cover distance.
3
+ // Their section 6 user experiment measured 1.42 (sd 0.47), and they note that
4
+ // it "suggests that rho = sqrt(2) is possibly an optimal value" without being
5
+ // able to say why; d3-interpolateZoom takes the same sqrt(2). Lower flattens
6
+ // the arc into a pan, higher pulls further back and travels faster, and it is
7
+ // the one knob to reach for if the zoomed-out apex ever proves too expensive to
8
+ // fetch through.
9
+ //
10
+ // IT DOES NOT TODAY, and the arithmetic that says it should is worth
11
+ // contradicting explicitly. A cross-chromosome flight over stacked whole
12
+ // assemblies traces ~15 octaves of zoom out and ~15 back, and synteny's fetch
13
+ // key buckets on `floor(log2(bpPerPx))` — so a flight crosses ~30 fetch buckets
14
+ // where a pan at constant zoom crosses none. Measured against
15
+ // `demos/grape_peach_cacao` it costs exactly ONE extra RPC over the instant
16
+ // jump (2 against 1), because the 500ms leading-edge debounce absorbs the whole
17
+ // excursion: one fetch leaving, one on landing.
18
+ // `agent-docs/measurements/synteny-mate-flight.json`.
19
+ const RHO = Math.sqrt(2);
20
+ // WHERE WE PART COMPANY WITH THE PAPER, and the one number in here that is not
21
+ // theirs. `S` is a path length in their dimensionless units of perceived
22
+ // motion, growing with the LOG of the distance: half a screen scores 0.7, one
23
+ // screen 1.2, a hundred screens 7.5, a whole genome 12. Their section 6
24
+ // measured an animation speed V of 0.90 of those units per second, which would
25
+ // put that whole-genome flight at THIRTEEN SECONDS — a wait, not a transition,
26
+ // and their own scenario (a map of the US) never asks for a path that long.
27
+ //
28
+ // So the duration is clamped instead: a floor for the hops too short to need
29
+ // time, a ceiling for the cross-genome one, and a rate between. At the ceiling
30
+ // that is an effective V around 11, an order of magnitude above what they
31
+ // measured, and it is the deliberate cost of not making the reader wait.
32
+ // Perceived velocity is still constant WITHIN a flight — that is equation (9)'s
33
+ // doing, not this — and this only picks the total.
34
+ const MS_PER_UNIT = 90;
35
+ const MIN_MS = 250;
36
+ const MAX_MS = 1100;
37
+ // Below this much motion, relative to the window it happens in, the pan is
38
+ // treated as none at all. RELATIVE, not absolute: the general solution divides
39
+ // by the distance, so a sub-bp move between two different zooms sends `b`
40
+ // through infinity and `at` returns NaN — and an absolute epsilon that is small
41
+ // against a 250Mb chromosome is not small against a 500bp window.
42
+ const STATIONARY = 1e-6;
43
+ /**
44
+ * The viewport path from `from` to `to`, and how long to spend on it.
45
+ *
46
+ * The path is equation (9) of the paper cited at the top of this file: it zooms
47
+ * out as it travels and back in as it arrives, along the geodesic that holds
48
+ * the *perceived* velocity constant, so the reader can follow the whole journey
49
+ * rather than watching one blurred smear.
50
+ *
51
+ * A STRAIGHT PAN IS NOT THE ALTERNATIVE, it is the thing this exists to avoid.
52
+ * The jump that wants animating here is a synteny row showing a whole assembly
53
+ * being sent to a mate on another chromosome: tens of megabases at a window of
54
+ * tens of kilobases, which is a thousand screens of travel. Panned at constant
55
+ * scale that is a thousand screens of unreadable streaking and no frame in
56
+ * which the reader is anywhere identifiable. Pulled back to where both ends fit
57
+ * and then dropped in, it is a picture of where they came from and where they
58
+ * landed.
59
+ *
60
+ * The zoomed-out apex is `w0 * cosh(r0)` — for a same-zoom hop, about the
61
+ * distance travelled — so the arc naturally tops out at "both endpoints on
62
+ * screen". A view whose `maxBpPerPx` is tighter than that simply clamps there
63
+ * and flies the middle of the path flat; nothing here has to know the limit,
64
+ * because the caller writes through `zoomTo` and reads back what it got.
65
+ */
66
+ export function planFlight(from, to) {
67
+ const w0 = from.windowWidthBp;
68
+ const w1 = to.windowWidthBp;
69
+ const delta = to.centerBp - from.centerBp;
70
+ const dist = Math.abs(delta);
71
+ const at = dist > Math.max(w0, w1) * STATIONARY
72
+ ? zoomAndPan(from, to, dist, Math.sign(delta))
73
+ : zoomInPlace(from, to);
74
+ return {
75
+ durationMs: at ? clamp(at.S * MS_PER_UNIT, MIN_MS, MAX_MS) : 0,
76
+ // Snapped at the end rather than left to the closed form, whose `u(S)`
77
+ // reaches the destination only to within the rounding of two hyperbolics.
78
+ at: t => (at && t < 1 ? at.at(t) : to),
79
+ };
80
+ }
81
+ // Equation (9), term for term. `u` runs along the path in world units from the
82
+ // start, and the two `r` are where the start and end sit on the ellipse the
83
+ // path traces. The paper's `u1 - u0` is signed; here the caller's sign is
84
+ // carried separately in `direction` and `dist` is its magnitude, so that u0 = 0
85
+ // and the two forms agree.
86
+ function zoomAndPan(from, to, dist, direction) {
87
+ const w0 = from.windowWidthBp;
88
+ const w1 = to.windowWidthBp;
89
+ const rho2 = RHO * RHO;
90
+ const rho4 = rho2 * rho2;
91
+ const b0 = (w1 * w1 - w0 * w0 + rho4 * dist * dist) / (2 * w0 * rho2 * dist);
92
+ const b1 = (w1 * w1 - w0 * w0 - rho4 * dist * dist) / (2 * w1 * rho2 * dist);
93
+ // asinh(-b), which is exactly the ln(-b + sqrt(b*b + 1)) equation (9) writes
94
+ // (and d3 implements literally) — but evaluated without the catastrophic
95
+ // cancellation those two terms suffer at the far end of a cross-genome jump,
96
+ // where b runs to a thousand and they agree to seven digits before
97
+ // subtracting. Same value, better conditioned.
98
+ const r0 = Math.asinh(-b0);
99
+ const r1 = Math.asinh(-b1);
100
+ const S = (r1 - r0) / RHO;
101
+ const coshR0 = Math.cosh(r0);
102
+ const sinhR0 = Math.sinh(r0);
103
+ return S > 0
104
+ ? {
105
+ S,
106
+ at: (t) => {
107
+ const s = t * S * RHO + r0;
108
+ return {
109
+ centerBp: from.centerBp +
110
+ direction *
111
+ ((w0 / rho2) * coshR0 * Math.tanh(s) - (w0 / rho2) * sinhR0),
112
+ windowWidthBp: (w0 * coshR0) / Math.cosh(s),
113
+ };
114
+ },
115
+ }
116
+ : undefined;
117
+ }
118
+ // The paper's u0 = u1 case, given unnumbered just after equation (9): the
119
+ // endpoints are the same place at different scales, so there is no path to
120
+ // trace and the zoom is exponential in `s` on its own. Their `w0 exp(k*rho*s)`
121
+ // over `S = |ln(w1/w0)|/rho` is `w0 * ratio**t` here, which is the same curve
122
+ // with `t = s/S` and their sign `k` folded into the ratio.
123
+ function zoomInPlace(from, to) {
124
+ const ratio = to.windowWidthBp / from.windowWidthBp;
125
+ const S = Math.abs(Math.log(ratio)) / RHO;
126
+ return S > 0
127
+ ? {
128
+ S,
129
+ at: (t) => ({
130
+ centerBp: from.centerBp + (to.centerBp - from.centerBp) * t,
131
+ windowWidthBp: from.windowWidthBp * ratio ** t,
132
+ }),
133
+ }
134
+ : undefined;
135
+ }
@@ -0,0 +1,27 @@
1
+ declare const SHEDDABLE: readonly [readonly ['trackSelectorIndent', 16], readonly ['panButtonSpacing', 100], readonly ['scrollZoomLabel', 83], readonly ['zoomSlider', 100], readonly ['regionWidth', 54]];
2
+ export type HeaderFit = Record<(typeof SHEDDABLE)[number][0], boolean>;
3
+ /**
4
+ * Which of the header bar's optional pieces a header `width` px wide still has
5
+ * room for, given what the search box is asking for — `searchBoxWidth`, margins
6
+ * included — and whether the clear-highlights button is currently in the row.
7
+ * An unmeasured width — the first render, before the ResizeObserver has
8
+ * reported — keeps all of them, so the common wide case paints its final form
9
+ * immediately rather than flashing the compact one.
10
+ *
11
+ * `searchBoxPx` is the box's ask and not its floor, because the two differ by
12
+ * the locstring — 189px empty, 194 at `ctgA:1..20,000`, 284 at
13
+ * `chr22:10,510,000..10,610,000`. Shedding against the floor is what left
14
+ * flexbox squeezing the box this whole table exists to protect: against the
15
+ * floor the probe read 184px of an asked 210 at an 800px window and 186 at 600.
16
+ *
17
+ * The fully shed row costs 238px, so under `238 + searchBoxPx` the row overflows
18
+ * whatever it gives up and the box shrinks like any flex item. That is a floor,
19
+ * not a cliff: it shrinks from what it asked for rather than from the 101px the
20
+ * unshed row used to leave it.
21
+ */
22
+ export declare function headerFit({ width, searchBoxPx, clearHighlight, }: {
23
+ width: number | undefined;
24
+ searchBoxPx: number;
25
+ clearHighlight?: boolean;
26
+ }): HeaderFit;
27
+ export {};
@@ -0,0 +1,59 @@
1
+ // Widths measured against a built jbrowse-web at the default theme and root
2
+ // font size — `products/jbrowse-web/browser-tests/probe-lgv-header-fit.ts`
3
+ // prints the row piece by piece. It spends 591px on everything that is not the
4
+ // search box (47 track selector, 114 scroll-zoom toggle, 156 pan buttons, 50 bp
5
+ // readout, 192 zoom controls, 32 of flex gap). What the box itself asks for is
6
+ // the caller's, because it follows the locstring rather than being a constant.
7
+ const ROW_WITHOUT_SEARCH_PX = 591;
8
+ // The one piece of the row that comes and goes on its own. A text search that
9
+ // lands on a feature raises it — the same flow that was just using the search
10
+ // box this whole table exists to protect — so its width is taken off the top
11
+ // rather than left for the search box to absorb.
12
+ const CLEAR_HIGHLIGHT_PX = 35;
13
+ // What the header gives up as its window narrows, cheapest first, with the
14
+ // pixels each one frees. Whitespace goes before words, words before a redundant
15
+ // control, and that before a readout. The search box is not on the list: it is
16
+ // the one control in the row with no equivalent anywhere else in the view, so
17
+ // everything else exists to keep it on screen.
18
+ const SHEDDABLE = [
19
+ ['trackSelectorIndent', 16],
20
+ ['panButtonSpacing', 100],
21
+ ['scrollZoomLabel', 83],
22
+ ['zoomSlider', 100],
23
+ ['regionWidth', 54],
24
+ ];
25
+ /**
26
+ * Which of the header bar's optional pieces a header `width` px wide still has
27
+ * room for, given what the search box is asking for — `searchBoxWidth`, margins
28
+ * included — and whether the clear-highlights button is currently in the row.
29
+ * An unmeasured width — the first render, before the ResizeObserver has
30
+ * reported — keeps all of them, so the common wide case paints its final form
31
+ * immediately rather than flashing the compact one.
32
+ *
33
+ * `searchBoxPx` is the box's ask and not its floor, because the two differ by
34
+ * the locstring — 189px empty, 194 at `ctgA:1..20,000`, 284 at
35
+ * `chr22:10,510,000..10,610,000`. Shedding against the floor is what left
36
+ * flexbox squeezing the box this whole table exists to protect: against the
37
+ * floor the probe read 184px of an asked 210 at an 800px window and 186 at 600.
38
+ *
39
+ * The fully shed row costs 238px, so under `238 + searchBoxPx` the row overflows
40
+ * whatever it gives up and the box shrinks like any flex item. That is a floor,
41
+ * not a cliff: it shrinks from what it asked for rather than from the 101px the
42
+ * unshed row used to leave it.
43
+ */
44
+ export function headerFit({ width, searchBoxPx, clearHighlight = false, }) {
45
+ const fit = Object.fromEntries(SHEDDABLE.map(([k]) => [k, true]));
46
+ if (width === undefined) {
47
+ return fit;
48
+ }
49
+ const room = width - (clearHighlight ? CLEAR_HIGHLIGHT_PX : 0);
50
+ let need = ROW_WITHOUT_SEARCH_PX + searchBoxPx;
51
+ for (const [key, saves] of SHEDDABLE) {
52
+ if (need <= room) {
53
+ break;
54
+ }
55
+ fit[key] = false;
56
+ need -= saves;
57
+ }
58
+ return fit;
59
+ }
@@ -1,5 +1,35 @@
1
+ import type { LinearGenomeViewModel } from './model.ts';
1
2
  import type PluginManager from '@jbrowse/core/PluginManager';
3
+ import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
4
+ declare module '@jbrowse/core/PluginManager' {
5
+ interface ExtensionPointRegistry {
6
+ /** #extensionPoint LinearGenomeView-TracksContainerComponent | sync | Add a component into the LGV tracks container */
7
+ 'LinearGenomeView-TracksContainerComponent': ElementList<{
8
+ model: LinearGenomeViewModel;
9
+ }>;
10
+ /** #extensionPoint LinearGenomeView-ScalebarHighlightComponent | sync | Add a highlight component to the scalebar */
11
+ 'LinearGenomeView-ScalebarHighlightComponent': ElementList<{
12
+ model: LinearGenomeViewModel;
13
+ }>;
14
+ /** #extensionPoint LinearGenomeView-HighlightSVGComponent | sync | Add an SVG highlight overlay in the LGV SVG export */
15
+ 'LinearGenomeView-HighlightSVGComponent': ElementList<{
16
+ model: LinearGenomeViewModel;
17
+ height: number;
18
+ }>;
19
+ /** #extensionPoint LinearGenomeView-OverviewScalebarComponent | sync | Add a component to the overview scalebar */
20
+ 'LinearGenomeView-OverviewScalebarComponent': ElementList<{
21
+ model: LinearGenomeViewModel;
22
+ overview: ViewLayout;
23
+ }>;
24
+ }
25
+ }
2
26
  export default function LinearGenomeViewF(pluginManager: PluginManager): void;
3
- export * from './model.ts';
4
- export * from './types.ts';
27
+ export { stateModelFactory } from './model.ts';
28
+ export { lgvLaunchKeys } from './launchKeys.ts';
29
+ export type { LinearGenomeViewModel, LinearGenomeViewStateModel, } from './model.ts';
30
+ export type { BpOffset, ExportSvgOptions, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, VolatileGuide, } from './types.ts';
31
+ export { type SyncableViewAction, installLinkedViewSync, } from './linkedViewSync.ts';
5
32
  export { default as HighlightBand } from './components/HighlightBand.tsx';
33
+ export { default as HighlightChip } from './components/HighlightChip.tsx';
34
+ export { default as OverviewHighlightBand } from './components/OverviewHighlightBand.tsx';
35
+ export { default as SVGHighlightBand } from './components/SVGHighlightBand.tsx';