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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +202 -71
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +265 -120
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +20 -9
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +142 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +8 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +42 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +18 -8
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +38 -52
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +21 -25
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +13 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -6
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +14 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +25 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +87 -83
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +56 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
  81. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
  83. package/esm/LinearGenomeView/components/Rubberband.js +15 -17
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  87. package/esm/LinearGenomeView/components/Scalebar.js +20 -22
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +61 -68
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
  147. package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
  148. package/esm/LinearGenomeView/components/util.d.ts +24 -6
  149. package/esm/LinearGenomeView/components/util.js +28 -5
  150. package/esm/LinearGenomeView/consts.d.ts +9 -2
  151. package/esm/LinearGenomeView/consts.js +20 -2
  152. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  153. package/esm/LinearGenomeView/containingLgv.js +23 -0
  154. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  155. package/esm/LinearGenomeView/flyTo.js +135 -0
  156. package/esm/LinearGenomeView/headerFit.d.ts +29 -0
  157. package/esm/LinearGenomeView/headerFit.js +72 -0
  158. package/esm/LinearGenomeView/index.d.ts +28 -3
  159. package/esm/LinearGenomeView/index.js +13 -7
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +25 -1
  162. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  163. package/esm/LinearGenomeView/launchKeys.js +27 -0
  164. package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
  165. package/esm/LinearGenomeView/lazyDialogs.js +4 -3
  166. package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
  167. package/esm/LinearGenomeView/linkedViewSync.js +36 -0
  168. package/esm/LinearGenomeView/menuItems.d.ts +25 -2
  169. package/esm/LinearGenomeView/menuItems.js +306 -179
  170. package/esm/LinearGenomeView/model.d.ts +3363 -164
  171. package/esm/LinearGenomeView/model.js +2548 -565
  172. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  173. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  174. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  175. package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
  176. package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
  177. package/esm/LinearGenomeView/stickyChrome.js +26 -0
  178. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  179. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
  180. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
  181. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  185. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  186. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  187. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
  188. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  189. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
  190. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  191. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
  192. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  193. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
  194. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  195. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
  197. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  198. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  199. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
  200. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
  201. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
  202. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  203. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  204. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  205. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  206. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  207. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  208. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  209. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
  210. package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
  211. package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
  212. package/esm/LinearGenomeView/types.d.ts +20 -37
  213. package/esm/LinearGenomeView/types.js +1 -0
  214. package/esm/LinearGenomeView/util.d.ts +347 -12
  215. package/esm/LinearGenomeView/util.js +577 -62
  216. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  217. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
  218. package/esm/MultiLevelRubberband/index.d.ts +4 -0
  219. package/esm/MultiLevelRubberband/index.js +3 -0
  220. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  221. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  222. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  223. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  224. package/esm/MultiLevelRubberband/types.d.ts +7 -0
  225. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
  226. package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
  227. package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
  228. package/esm/displayKitTests/perRegionTestEnv.js +142 -0
  229. package/esm/index.d.ts +50 -1245
  230. package/esm/index.js +88 -33
  231. package/esm/searchUtils.d.ts +62 -12
  232. package/esm/searchUtils.js +335 -48
  233. package/esm/shared/RubberbandSpan.d.ts +15 -0
  234. package/esm/shared/RubberbandSpan.js +34 -0
  235. package/esm/shared/coordLabels.d.ts +47 -0
  236. package/esm/shared/coordLabels.js +133 -0
  237. package/esm/shared/useWindowDrag.d.ts +18 -0
  238. package/esm/shared/useWindowDrag.js +45 -0
  239. package/package.json +18 -19
  240. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  241. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  242. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  243. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  244. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  245. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  246. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  247. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  248. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  249. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  250. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  251. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  252. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  253. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  254. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  255. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  256. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  257. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  258. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  260. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  261. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  262. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  263. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  264. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  265. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  266. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  267. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  268. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  269. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  270. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  271. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  272. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  273. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  274. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  275. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  276. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  277. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  278. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  279. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  280. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  281. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  282. package/esm/BaseLinearDisplay/components/util.js +0 -107
  283. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  284. package/esm/BaseLinearDisplay/index.js +0 -13
  285. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  286. package/esm/BaseLinearDisplay/model.js +0 -432
  287. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  288. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  289. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  290. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  291. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  292. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  293. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  294. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  295. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  296. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  297. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  298. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  299. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  300. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  301. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  302. package/esm/BaseLinearDisplay/models/util.js +0 -43
  303. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  304. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  305. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  306. package/esm/BaseLinearDisplay/types.js +0 -3
  307. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  308. package/esm/BaseLinearDisplay/util.js +0 -71
  309. package/esm/BasicTrack/configSchema.d.ts +0 -85
  310. package/esm/BasicTrack/configSchema.js +0 -8
  311. package/esm/BasicTrack/index.d.ts +0 -2
  312. package/esm/BasicTrack/index.js +0 -12
  313. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  314. package/esm/LinearBareDisplay/configSchema.js +0 -11
  315. package/esm/LinearBareDisplay/index.d.ts +0 -4
  316. package/esm/LinearBareDisplay/index.js +0 -20
  317. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  318. package/esm/LinearBareDisplay/model.js +0 -32
  319. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  320. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  321. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  322. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  323. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  324. package/esm/LinearBasicDisplay/index.js +0 -20
  325. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  326. package/esm/LinearBasicDisplay/model.js +0 -158
  327. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  328. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  329. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  330. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  331. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  332. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  333. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  334. package/esm/LinearFeatureDisplay/index.js +0 -2
  335. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  336. package/esm/LinearFeatureDisplay/model.js +0 -305
  337. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  338. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  339. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  340. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  345. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  346. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  347. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  348. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  349. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  350. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  351. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  352. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  353. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  354. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  355. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  356. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  357. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  358. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  359. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  360. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  361. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  362. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  363. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -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,6 +1,20 @@
1
- import type React from 'react';
2
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
+ import type React from 'react';
3
+ /**
4
+ * Drag to pan and pinch to zoom, on pointer events so a finger works the same
5
+ * as a mouse. A second finger turns a pan into a pinch: the spread between the
6
+ * two zooms about their midpoint, and moving the midpoint pans. Lifting either
7
+ * finger goes back to panning with the other.
8
+ *
9
+ * The host sets `touch-action` to leave the browser only the gestures this
10
+ * does not want (TracksContainer keeps vertical scroll); without it a touch
11
+ * drag is a page scroll and a pinch zooms the page, and no pointer stream
12
+ * arrives.
13
+ *
14
+ * The window listeners go on in the press handler itself rather than in an
15
+ * effect, so a release that lands before React commits still finds them.
16
+ */
3
17
  export declare function useSideScroll(model: LinearGenomeViewModel): {
4
- mouseDown: (event: React.MouseEvent) => void;
5
- mouseUp: (event: React.MouseEvent) => void;
18
+ pointerDown: (event: React.PointerEvent) => void;
19
+ clickCapture: (event: React.MouseEvent) => void;
6
20
  };
@@ -1,57 +1,175 @@
1
- import { useEffect, useRef, useState } from 'react';
1
+ import { useEffect, useRef } from 'react';
2
+ import { transaction } from 'mobx';
3
+ // A press that travels further than this is a pan, and the click that ends it
4
+ // is not a click. A hand that wobbles two pixels can still select something.
5
+ const PAN_CLICK_THRESHOLD_PX = 4;
6
+ // The pan publishes its state as attributes on the element the press landed in
7
+ // (TracksContainer), so a track's own pointer handlers read it with `closest`
8
+ // and nothing has to hand them a ref or a model field — the same marker shape
9
+ // as `data-gesture-owner`. `data-pan-dragging` is present from press to
10
+ // release; `data-pan-moved` is set once the press travels past the threshold
11
+ // or becomes a pinch, and cleared by the next press, so it still answers for
12
+ // the click that follows the release: `clickCapture` swallows that click
13
+ // before any track sees it.
14
+ const PAN_DRAGGING_ATTR = 'data-pan-dragging';
15
+ const PAN_MOVED_ATTR = 'data-pan-moved';
16
+ function preventDefault(event) {
17
+ event.preventDefault();
18
+ }
19
+ function pointOf(event) {
20
+ return { x: event.clientX, y: event.clientY };
21
+ }
22
+ /**
23
+ * Drag to pan and pinch to zoom, on pointer events so a finger works the same
24
+ * as a mouse. A second finger turns a pan into a pinch: the spread between the
25
+ * two zooms about their midpoint, and moving the midpoint pans. Lifting either
26
+ * finger goes back to panning with the other.
27
+ *
28
+ * The host sets `touch-action` to leave the browser only the gestures this
29
+ * does not want (TracksContainer keeps vertical scroll); without it a touch
30
+ * drag is a page scroll and a pinch zooms the page, and no pointer stream
31
+ * arrives.
32
+ *
33
+ * The window listeners go on in the press handler itself rather than in an
34
+ * effect, so a release that lands before React commits still finds them.
35
+ */
2
36
  export function useSideScroll(model) {
3
- const [mouseDragging, setMouseDragging] = useState(false);
4
- const scheduled = useRef(false);
5
- const prevX = useRef(0);
6
- useEffect(() => {
7
- let cleanup = () => { };
8
- function globalMouseMove(event) {
9
- 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
- });
37
+ const gestureRef = useRef(undefined);
38
+ useEffect(() => () => {
39
+ gestureRef.current?.cancel();
40
+ }, []);
41
+ function pointerDown(event) {
42
+ const host = event.currentTarget;
43
+ if (gestureRef.current) {
44
+ gestureRef.current.join(event);
45
+ return;
46
+ }
47
+ // Cleared for EVERY press, ahead of the returns below: the marker outlives
48
+ // the gesture that set it, and a stale true is what the next reader of
49
+ // this DOM contract would inherit.
50
+ host.removeAttribute(PAN_MOVED_ATTR);
51
+ if (event.shiftKey || event.button !== 0 || !event.isPrimary) {
52
+ return;
53
+ }
54
+ // a draggable element, a control that claimed the press (resize handles,
55
+ // the scalebar, a legend), or a button: `closest`, since the press usually
56
+ // lands on a child of the control
57
+ const target = event.target;
58
+ if (target.draggable ||
59
+ target.closest('[data-gesture-owner]') ||
60
+ target.closest('button')) {
61
+ return;
62
+ }
63
+ const left = host.getBoundingClientRect().left;
64
+ const startX = event.clientX;
65
+ // where each finger is now, and where it was when the view last moved
66
+ const pointers = new Map([[event.pointerId, pointOf(event)]]);
67
+ let applied = new Map(pointers);
68
+ let frame;
69
+ function flush() {
70
+ frame = undefined;
71
+ const [a, b] = [...pointers.keys()];
72
+ const curr1 = pointers.get(a);
73
+ const prev1 = applied.get(a);
74
+ if (b === undefined) {
75
+ if (curr1.x !== prev1.x) {
76
+ model.horizontalScroll(prev1.x - curr1.x);
20
77
  }
21
78
  }
22
- }
23
- function globalMouseUp() {
24
- prevX.current = 0;
25
- if (mouseDragging) {
26
- setMouseDragging(false);
79
+ else {
80
+ const curr2 = pointers.get(b);
81
+ const prev2 = applied.get(b);
82
+ const prevSpread = Math.hypot(prev1.x - prev2.x, prev1.y - prev2.y);
83
+ const spread = Math.hypot(curr1.x - curr2.x, curr1.y - curr2.y);
84
+ const prevMid = (prev1.x + prev2.x) / 2;
85
+ const mid = (curr1.x + curr2.x) / 2;
86
+ transaction(() => {
87
+ if (prevSpread > 0 && spread > 0) {
88
+ model.zoomTo((model.bpPerPx * prevSpread) / spread, prevMid - left);
89
+ }
90
+ if (mid !== prevMid) {
91
+ model.horizontalScroll(prevMid - mid);
92
+ }
93
+ });
27
94
  }
95
+ applied = new Map(pointers);
28
96
  }
29
- if (mouseDragging) {
30
- window.addEventListener('mousemove', globalMouseMove, true);
31
- window.addEventListener('mouseup', globalMouseUp, true);
32
- cleanup = () => {
33
- window.removeEventListener('mousemove', globalMouseMove, true);
34
- window.removeEventListener('mouseup', globalMouseUp, true);
35
- };
97
+ // Applies what is queued before the set of fingers changes, so the next
98
+ // frame measures from where every finger is now rather than jumping by the
99
+ // distance between them.
100
+ function settle() {
101
+ if (frame !== undefined) {
102
+ window.cancelAnimationFrame(frame);
103
+ flush();
104
+ }
36
105
  }
37
- return cleanup;
38
- }, [model, mouseDragging]);
39
- function mouseDown(event) {
40
- if (event.shiftKey) {
41
- return;
106
+ function move(e) {
107
+ if (!pointers.has(e.pointerId)) {
108
+ return;
109
+ }
110
+ pointers.set(e.pointerId, pointOf(e));
111
+ if (Math.abs(e.clientX - startX) > PAN_CLICK_THRESHOLD_PX) {
112
+ host.setAttribute(PAN_MOVED_ATTR, '');
113
+ }
114
+ frame ??= window.requestAnimationFrame(flush);
42
115
  }
43
- const target = event.target;
44
- if (target.draggable || target.dataset.resizer) {
45
- return;
116
+ function end(applyQueued) {
117
+ if (applyQueued) {
118
+ settle();
119
+ }
120
+ else if (frame !== undefined) {
121
+ window.cancelAnimationFrame(frame);
122
+ }
123
+ host.removeAttribute(PAN_DRAGGING_ATTR);
124
+ window.removeEventListener('pointermove', move, true);
125
+ window.removeEventListener('pointerup', release, true);
126
+ window.removeEventListener('pointercancel', release, true);
127
+ window.removeEventListener('selectstart', preventDefault, true);
128
+ gestureRef.current = undefined;
46
129
  }
47
- if (event.button === 0) {
48
- prevX.current = event.clientX;
49
- setMouseDragging(true);
130
+ // pointercancel as well as pointerup: the browser cancels a touch it takes
131
+ // over as a vertical scroll, and the gesture would otherwise stay latched
132
+ function release(e) {
133
+ if (!pointers.has(e.pointerId)) {
134
+ return;
135
+ }
136
+ if (pointers.size > 1) {
137
+ settle();
138
+ pointers.delete(e.pointerId);
139
+ applied.delete(e.pointerId);
140
+ }
141
+ else {
142
+ end(true);
143
+ }
50
144
  }
145
+ host.setAttribute(PAN_DRAGGING_ATTR, '');
146
+ window.addEventListener('pointermove', move, true);
147
+ window.addEventListener('pointerup', release, true);
148
+ window.addEventListener('pointercancel', release, true);
149
+ window.addEventListener('selectstart', preventDefault, true);
150
+ gestureRef.current = {
151
+ join(e) {
152
+ if (e.pointerType !== 'touch' || pointers.size > 1) {
153
+ return;
154
+ }
155
+ settle();
156
+ pointers.set(e.pointerId, pointOf(e));
157
+ applied = new Map(pointers);
158
+ host.setAttribute(PAN_MOVED_ATTR, '');
159
+ model.cancelZoomAnimation();
160
+ },
161
+ cancel() {
162
+ end(false);
163
+ },
164
+ };
51
165
  }
52
- function mouseUp(event) {
53
- event.preventDefault();
54
- setMouseDragging(false);
166
+ // The browser fires `click` after a release on whatever the press and the
167
+ // release share, which over a track is its canvas, so a pan that ended on a
168
+ // gene would open that gene's details.
169
+ function clickCapture(event) {
170
+ if (event.currentTarget.hasAttribute(PAN_MOVED_ATTR)) {
171
+ event.stopPropagation();
172
+ }
55
173
  }
56
- return { mouseDown, mouseUp };
174
+ return { pointerDown, clickCapture };
57
175
  }
@@ -1,14 +1,32 @@
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 scalebarRefLabelProps: {
5
+ 'data-scalebar-ref-label': string;
6
+ };
7
+ export declare function isOnScalebarRefLabel(target: EventTarget | null): boolean;
8
+ export declare const elidedBlockStyles: {
9
+ readonly backgroundColor: '#999';
10
+ readonly backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)';
11
+ };
12
+ export type Cytoband = ReturnType<typeof getCytobands>[number];
7
13
  export declare function getCytobands(assembly: Assembly | undefined, refName: string): {
8
14
  refName: string;
9
15
  start: number;
10
16
  end: number;
11
17
  type: string;
12
- name: any;
18
+ name: string | undefined;
13
19
  }[];
20
+ /**
21
+ * The bp under a pixel of the overview strip. The strip spans the whole view,
22
+ * but the overview *layout* is laid out in the pixels after the chromosome-name
23
+ * gutter (cytobandOffset), so a press or hover on that gutter sits left of the
24
+ * layout's own origin. `pxToBp` extrapolates there rather than refusing, and
25
+ * every overview reader took it at face value: the hover and rubberband labels
26
+ * read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
27
+ * silently, because `centerAt` cannot resolve a coordinate that is in no region.
28
+ * Clamping into the layout's own span makes all three name the genome's start,
29
+ * which is what the gutter is adjacent to.
30
+ */
31
+ export declare function overviewPxToBp(overview: ViewLayout, px: number, cytobandOffset: number): import("@jbrowse/core/util/Base1DUtils").PxToBpResult;
14
32
  export declare function shouldSwapTracks(lastSwapY: number | undefined, currentY: number, movingDown: boolean): boolean;
@@ -1,17 +1,40 @@
1
- export { fetchResults, splitLast } from "../../searchUtils.js";
2
- export function getRelativeX(event, element) {
3
- return event.clientX - (element?.getBoundingClientRect().left || 0);
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
+ export const scalebarRefLabelProps = { 'data-scalebar-ref-label': '' };
7
+ export function isOnScalebarRefLabel(target) {
8
+ return (target instanceof Element && !!target.closest('[data-scalebar-ref-label]'));
4
9
  }
10
+ export const elidedBlockStyles = {
11
+ backgroundColor: '#999',
12
+ backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)',
13
+ };
5
14
  export function getCytobands(assembly, refName) {
6
15
  return (assembly?.cytobands
7
16
  ?.map(f => ({
8
- refName: assembly.getCanonicalRefName(f.get('refName')) || f.get('refName'),
17
+ refName: assembly.getCanonicalRefName2(f.get('refName')),
9
18
  start: f.get('start'),
10
19
  end: f.get('end'),
11
20
  type: f.get('gieStain'),
12
21
  name: f.get('name'),
13
22
  }))
14
- .filter(f => f.refName === refName) || []);
23
+ .filter(f => f.refName === refName) ?? []);
24
+ }
25
+ /**
26
+ * The bp under a pixel of the overview strip. The strip spans the whole view,
27
+ * but the overview *layout* is laid out in the pixels after the chromosome-name
28
+ * gutter (cytobandOffset), so a press or hover on that gutter sits left of the
29
+ * layout's own origin. `pxToBp` extrapolates there rather than refusing, and
30
+ * every overview reader took it at face value: the hover and rubberband labels
31
+ * read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
32
+ * silently, because `centerAt` cannot resolve a coordinate that is in no region.
33
+ * Clamping into the layout's own span makes all three name the genome's start,
34
+ * which is what the gutter is adjacent to.
35
+ */
36
+ export function overviewPxToBp(overview, px, cytobandOffset) {
37
+ return pxToBp(overview, clamp(px - cytobandOffset, 0, overview.width - 1));
15
38
  }
16
39
  const MIN_DRAG_DISTANCE = 30;
17
40
  export function shouldSwapTracks(lastSwapY, currentY, movingDown) {
@@ -1,7 +1,14 @@
1
+ export declare const MIN_BP_PER_PX: number;
2
+ export declare const MINIMUM_BLOCK_WIDTH = 3;
3
+ export declare const SHOW_ALL_REGIONS_FILL = 0.9;
1
4
  export declare const HEADER_BAR_HEIGHT = 48;
2
5
  export declare const HEADER_OVERVIEW_HEIGHT = 20;
3
6
  export declare const SCALE_BAR_HEIGHT = 17;
4
- export declare const RESIZE_HANDLE_HEIGHT = 3;
5
- export declare const INTER_REGION_PADDING_WIDTH = 2;
7
+ export declare const SVG_SCALEBAR_CAP = 5;
8
+ export declare const RESIZE_HANDLE_HEIGHT = 4;
9
+ export declare const RESIZE_ALL_HANDLE_HEIGHT = 6;
10
+ export declare const TRACK_TOP_GAP = 2;
11
+ export declare const TRACK_OUTLINE_BORDER = 1;
12
+ export declare const MINIMIZED_TRACK_HEIGHT = 20;
6
13
  export declare const SPACING = 7;
7
14
  export declare const WIDGET_HEIGHT = 32;
@@ -1,7 +1,25 @@
1
+ // most zoomed-in level: 50px per bp
2
+ export const MIN_BP_PER_PX = 1 / 50;
3
+ export const MINIMUM_BLOCK_WIDTH = 3;
4
+ // fraction of the view width the whole genome fills at the most zoomed-out
5
+ // level, leaving a 10% margin
6
+ export const SHOW_ALL_REGIONS_FILL = 0.9;
1
7
  export const HEADER_BAR_HEIGHT = 48;
2
8
  export const HEADER_OVERVIEW_HEIGHT = 20;
3
9
  export const SCALE_BAR_HEIGHT = 17;
4
- export const RESIZE_HANDLE_HEIGHT = 3;
5
- export const INTER_REGION_PADDING_WIDTH = 2;
10
+ // Half-height of the total-bp scalebar's end caps in the SVG export; also the
11
+ // clearance the bar needs below the assembly label.
12
+ export const SVG_SCALEBAR_CAP = 5;
13
+ // The three pieces of chrome TrackContainer puts around a track's rendering
14
+ // container. The model sums them to place a track without measuring the DOM, so
15
+ // TrackContainer lays its Paper out from these same three and nothing else —
16
+ // the previous spelling had the model on a 3 while the CSS rendered 2 + 1 + 4,
17
+ // which put every model-derived track offset 5px per track above the pixels.
18
+ // The track *label* is not among them: it is measured, see `trackLabelBand`.
19
+ export const RESIZE_HANDLE_HEIGHT = 4;
20
+ export const RESIZE_ALL_HANDLE_HEIGHT = 6;
21
+ export const TRACK_TOP_GAP = 2;
22
+ export const TRACK_OUTLINE_BORDER = 1;
23
+ export const MINIMIZED_TRACK_HEIGHT = 20;
6
24
  export const SPACING = 7;
7
25
  export const WIDGET_HEIGHT = 32;
@@ -0,0 +1,21 @@
1
+ import type { LinearGenomeViewModel } from './model.ts';
2
+ import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
3
+ /**
4
+ * The containing view as the linear genome view itself, for a display that
5
+ * needs `pxToBp`, `showTrack`, `navTo` or the view's own chrome settings.
6
+ *
7
+ * The twin of display-kit's `containingHost`, and deliberately not the same
8
+ * function: `RegionHost` is the region contract display-kit reads, and widening
9
+ * it to carry the LGV's own surface is how the display layer would come to
10
+ * depend on the view plugin. A display that wants the view names the view.
11
+ *
12
+ * A view that lays its displays along a strip of its own — the circular view's
13
+ * ring host — is answered here too, the way `containingHost` answers it: the
14
+ * strip carries the members a display reads to draw (`bpToPx`, `pxToBp`, the
15
+ * blocks), and a display drawn there that reaches for a member the strip has
16
+ * not is the display that stays off the circle.
17
+ *
18
+ * Components and structural helpers taking duck-typed model shapes keep calling
19
+ * `getContainingView` — the same carve-out `containingHost` documents.
20
+ */
21
+ export declare function containingLgv(self: IStateTreeNode): LinearGenomeViewModel;
@@ -0,0 +1,23 @@
1
+ import { getContainingView } from '@jbrowse/core/util';
2
+ /**
3
+ * The containing view as the linear genome view itself, for a display that
4
+ * needs `pxToBp`, `showTrack`, `navTo` or the view's own chrome settings.
5
+ *
6
+ * The twin of display-kit's `containingHost`, and deliberately not the same
7
+ * function: `RegionHost` is the region contract display-kit reads, and widening
8
+ * it to carry the LGV's own surface is how the display layer would come to
9
+ * depend on the view plugin. A display that wants the view names the view.
10
+ *
11
+ * A view that lays its displays along a strip of its own — the circular view's
12
+ * ring host — is answered here too, the way `containingHost` answers it: the
13
+ * strip carries the members a display reads to draw (`bpToPx`, `pxToBp`, the
14
+ * blocks), and a display drawn there that reaches for a member the strip has
15
+ * not is the display that stays off the circle.
16
+ *
17
+ * Components and structural helpers taking duck-typed model shapes keep calling
18
+ * `getContainingView` — the same carve-out `containingHost` documents.
19
+ */
20
+ export function containingLgv(self) {
21
+ const view = getContainingView(self);
22
+ return (view.regionHost ?? view);
23
+ }
@@ -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
+ }