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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +17 -12
  6. package/esm/LinearGenomeView/FloatingSvgOverlay.d.ts +5 -0
  7. package/esm/LinearGenomeView/FloatingSvgOverlay.js +25 -0
  8. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  9. package/esm/LinearGenomeView/afterAttach.js +257 -88
  10. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  11. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  12. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  13. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  14. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  15. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  16. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  17. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  18. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  19. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  20. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  21. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  22. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  24. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  25. package/esm/LinearGenomeView/components/Header.js +32 -16
  26. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  27. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  28. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  29. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  30. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  31. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  34. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  35. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  36. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  38. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  39. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  40. package/esm/LinearGenomeView/components/Highlight.d.ts +3 -7
  41. package/esm/LinearGenomeView/components/Highlight.js +30 -82
  42. package/esm/LinearGenomeView/components/HighlightBand.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightBand.js +40 -0
  44. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  45. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  46. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  47. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  48. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  49. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  50. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  52. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  54. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  55. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  56. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  57. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  58. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  59. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  60. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  61. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  62. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  63. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -42
  64. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  65. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  66. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  67. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  68. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  69. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  70. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  71. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  72. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  74. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  75. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  76. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  77. package/esm/LinearGenomeView/components/PaddingBlocks.js +51 -0
  78. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  79. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  80. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  81. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  83. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  87. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +1 -1
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +22 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +33 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  147. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  148. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  149. package/esm/LinearGenomeView/components/util.js +27 -6
  150. package/esm/LinearGenomeView/consts.d.ts +7 -2
  151. package/esm/LinearGenomeView/consts.js +18 -2
  152. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  153. package/esm/LinearGenomeView/flyTo.js +135 -0
  154. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  155. package/esm/LinearGenomeView/headerFit.js +59 -0
  156. package/esm/LinearGenomeView/index.d.ts +32 -2
  157. package/esm/LinearGenomeView/index.js +8 -4
  158. package/esm/LinearGenomeView/initKeys.d.ts +13 -0
  159. package/esm/LinearGenomeView/initKeys.js +104 -0
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +6 -10
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +52 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +1544 -136
  169. package/esm/LinearGenomeView/model.js +2352 -488
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -29
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1263 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +141 -0
  223. package/esm/index.d.ts +112 -1237
  224. package/esm/index.js +102 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +52 -11
  228. package/esm/searchUtils.js +318 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -8
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -17
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -89
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -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,4 +1,34 @@
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 type { LinearGenomeViewModel, LinearGenomeViewStateModel, } from './model.ts';
29
+ export type { BpOffset, ExportSvgOptions, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, VolatileGuide, } from './types.ts';
30
+ export { type SyncableViewAction, installLinkedViewSync, } from './linkedViewSync.ts';
31
+ export { default as HighlightBand } from './components/HighlightBand.tsx';
32
+ export { default as HighlightChip } from './components/HighlightChip.tsx';
33
+ export { default as OverviewHighlightBand } from './components/OverviewHighlightBand.tsx';
34
+ export { default as SVGHighlightBand } from './components/SVGHighlightBand.tsx';
@@ -1,15 +1,19 @@
1
1
  import { lazy } from 'react';
2
2
  import { ViewType } from '@jbrowse/core/pluggableElementTypes';
3
- import { stateModelFactory } from "./model.js";
3
+ import { stateModelFactory } from './model.js';
4
4
  export default function LinearGenomeViewF(pluginManager) {
5
5
  pluginManager.addViewType(() => {
6
6
  return new ViewType({
7
7
  name: 'LinearGenomeView',
8
8
  displayName: 'Linear genome view',
9
9
  stateModel: stateModelFactory(pluginManager),
10
- ReactComponent: lazy(() => import("./components/LinearGenomeView.js")),
10
+ ReactComponent: lazy(() => import('./components/LinearGenomeView.js')),
11
11
  });
12
12
  });
13
13
  }
14
- export * from "./model.js";
15
- export * from "./types.js";
14
+ export { stateModelFactory } from './model.js';
15
+ export { installLinkedViewSync, } from './linkedViewSync.js';
16
+ export { default as HighlightBand } from './components/HighlightBand.js';
17
+ export { default as HighlightChip } from './components/HighlightChip.js';
18
+ export { default as OverviewHighlightBand } from './components/OverviewHighlightBand.js';
19
+ export { default as SVGHighlightBand } from './components/SVGHighlightBand.js';
@@ -0,0 +1,13 @@
1
+ export declare function partitionLaunchKeys(spec: object, viewPropKeys: ReadonlySet<string>): {
2
+ init: Record<string, unknown>;
3
+ viewProps: Record<string, unknown>;
4
+ unknown: Record<string, unknown>;
5
+ };
6
+ export declare function linearGenomeViewPropKeys(pluginManager: {
7
+ getViewType: (name: string) => {
8
+ stateModel: {
9
+ properties: object;
10
+ };
11
+ };
12
+ }): ReadonlySet<string>;
13
+ export declare function warnUnknownLaunchKeys(surface: string, unknown: object): void;
@@ -0,0 +1,104 @@
1
+ // The init keys are derived from their interface so they can't drift: the
2
+ // Record requires exactly one entry per key, so adding a field without listing
3
+ // it here is a compile error rather than a key that silently warns as "unknown".
4
+ //
5
+ // There is no matching list for the plain view props, and there must not be:
6
+ // they are whatever the state model declares, read off it by the caller and
7
+ // passed in as `viewPropKeys`. A hand-written eight is what left `hideHeader`,
8
+ // `showGridlines`, `showCytobands` and five others declared, menu-settable and
9
+ // silently unreachable from any spec — the same failure LinearSyntenyView's
10
+ // `drawLocationMarkers` had.
11
+ //
12
+ // #launchKeys LinearGenomeView — the URL parameters page renders this list
13
+ // rather than restating it; each of these keys has its own `&param=` section
14
+ // there, which is why no description is attached here.
15
+ const knownInitKeyMap = {
16
+ loc: true,
17
+ grow: true,
18
+ assembly: true,
19
+ displayedRegionNames: true,
20
+ tracks: true,
21
+ tracklist: true,
22
+ nav: true,
23
+ highlight: true,
24
+ };
25
+ const knownInitKeys = new Set(Object.keys(knownInitKeyMap));
26
+ // Never settable from a spec, whatever the model declares: `type` picks the
27
+ // view and `id` is passed top-level so MST's optional identifier honors it.
28
+ const RESERVED = new Set(['id', 'type', 'init']);
29
+ // The viewport keys from before it was stored as a window. They are no longer
30
+ // declared properties, so the model's own property list does not contain them
31
+ // and they would partition as typos — reported as unknown and dropped. They are
32
+ // not typos: `preProcessSnapshot` still converts them, so they belong in the
33
+ // snapshot bucket, and a URL or saved spec that names them goes on working.
34
+ //
35
+ // Deletable with `legacyBpPerPx` in the model, and for the same reason.
36
+ const LEGACY_VIEWPORT_PROPS = new Set(['bpPerPx', 'offsetPx']);
37
+ // Partition launch keys three ways, once, for every caller that needs to know
38
+ // which is which:
39
+ //
40
+ // - `init`: resolution keys (loc, tracks, highlight, …) with no direct MST
41
+ // representation, which afterAttach applies on attach and then discards
42
+ // - `viewProps`: plain persisted props MST restores natively, so they belong on
43
+ // the view snapshot rather than in the blob
44
+ // - `unknown`: neither, i.e. a typo. MST silently drops unknown snapshot keys and
45
+ // `init` is a frozen blob, so nothing else would notice
46
+ //
47
+ // The two callers differ only in what they do with each bucket: the launcher
48
+ // spreads a flat spec across the new view's snapshot and warns about the typos,
49
+ // while afterAttach — which only ever sees an already-built blob — warns about
50
+ // both a typo and a view prop that ended up inside it.
51
+ export function partitionLaunchKeys(spec,
52
+ // The view's declared property names. Callers with a live node read it off
53
+ // `getPropertyMembers(self).properties`; callers building a snapshot read it
54
+ // off the registered view type's `stateModel.properties` — see
55
+ // `linearGenomeViewPropKeys`.
56
+ viewPropKeys) {
57
+ const init = {};
58
+ const viewProps = {};
59
+ const unknown = {};
60
+ for (const [key, value] of Object.entries(spec)) {
61
+ const bucket = knownInitKeys.has(key)
62
+ ? init
63
+ : (viewPropKeys.has(key) || LEGACY_VIEWPORT_PROPS.has(key)) &&
64
+ !RESERVED.has(key)
65
+ ? viewProps
66
+ : unknown;
67
+ bucket[key] = value;
68
+ }
69
+ return { init, viewProps, unknown };
70
+ }
71
+ // The registered LinearGenomeView's declared property names, for a caller that
72
+ // has a PluginManager but no view yet (a launcher, or a synteny row being built).
73
+ // A caller holding a live node reads the same thing off
74
+ // `getPropertyMembers(self).properties` instead.
75
+ //
76
+ // `getViewType` THROWS on an unregistered name, and that is left alone: this is
77
+ // only ever called from code that is about to add a LinearGenomeView, so an
78
+ // absent view type is a broken plugin manager rather than a case to degrade
79
+ // through — and degrading would mean silently dropping every property the
80
+ // caller asked for, which is the failure this whole mechanism exists to end.
81
+ //
82
+ // Cached: the set is fixed for the life of the manager, and a launch that opens
83
+ // a stack of rows would otherwise rebuild it per row.
84
+ const propKeyCache = new WeakMap();
85
+ export function linearGenomeViewPropKeys(pluginManager) {
86
+ const cached = propKeyCache.get(pluginManager);
87
+ if (cached) {
88
+ return cached;
89
+ }
90
+ const { stateModel } = pluginManager.getViewType('LinearGenomeView');
91
+ const keys = new Set(Object.keys(stateModel.properties));
92
+ propKeyCache.set(pluginManager, keys);
93
+ return keys;
94
+ }
95
+ // Report the `unknown` bucket. Both callers say the same thing about the same
96
+ // mistake and differ only in which surface they name, so the wording lives next
97
+ // to the partition that produces the bucket rather than in two hand-written
98
+ // copies that drift.
99
+ export function warnUnknownLaunchKeys(surface, unknown) {
100
+ const keys = Object.keys(unknown);
101
+ if (keys.length) {
102
+ console.warn(`${surface} ignored unknown key(s): ${keys.join(', ')}`);
103
+ }
104
+ }
@@ -1,2 +1,9 @@
1
1
  import type { LinearGenomeViewModel } from './model.ts';
2
+ /**
3
+ * Sets up keyboard shortcuts for the LinearGenomeView
4
+ * - Ctrl/Cmd + ArrowLeft: slide left
5
+ * - Ctrl/Cmd + ArrowRight: slide right
6
+ * - Ctrl/Cmd + ArrowUp: zoom in
7
+ * - Ctrl/Cmd + ArrowDown: zoom out
8
+ */
2
9
  export declare function setupKeyboardHandler(self: LinearGenomeViewModel): void;
@@ -1,6 +1,16 @@
1
1
  import { getSession } from '@jbrowse/core/util';
2
2
  import { addDisposer } from '@jbrowse/mobx-state-tree';
3
+ /**
4
+ * Sets up keyboard shortcuts for the LinearGenomeView
5
+ * - Ctrl/Cmd + ArrowLeft: slide left
6
+ * - Ctrl/Cmd + ArrowRight: slide right
7
+ * - Ctrl/Cmd + ArrowUp: zoom in
8
+ * - Ctrl/Cmd + ArrowDown: zoom out
9
+ */
3
10
  export function setupKeyboardHandler(self) {
11
+ if (typeof document === 'undefined') {
12
+ return;
13
+ }
4
14
  function handler(e) {
5
15
  const session = getSession(self);
6
16
  if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
@@ -3,21 +3,17 @@ export declare const ReturnToImportFormDialog: import("react").LazyExoticCompone
3
3
  clearView: () => void;
4
4
  };
5
5
  handleClose: () => void;
6
- }) => import("react/jsx-runtime").JSX.Element>;
6
+ }) => import("react").JSX.Element>;
7
7
  export declare const SequenceSearchDialog: import("react").LazyExoticComponent<({ model, handleClose, }: {
8
8
  model: {
9
9
  assemblyNames: string[];
10
10
  showTrack: (trackId: string) => void;
11
11
  };
12
12
  handleClose: () => void;
13
- }) => import("react/jsx-runtime").JSX.Element>;
13
+ }) => import("react").JSX.Element>;
14
14
  export declare const ExportSvgDialog: import("react").LazyExoticComponent<typeof import("./components/ExportSvgDialog.tsx").default>;
15
- export declare const GetSequenceDialog: import("react").LazyExoticComponent<({ model, handleClose, }: {
16
- model: {
17
- leftOffset?: import("./types.ts").BpOffset;
18
- rightOffset?: import("./types.ts").BpOffset;
19
- getSelectedRegions: (left?: import("./types.ts").BpOffset, right?: import("./types.ts").BpOffset) => import("@jbrowse/core/util").Region[];
20
- setOffsets: (left?: import("./types.ts").BpOffset, right?: import("./types.ts").BpOffset) => void;
21
- };
15
+ export declare const GetSequenceDialog: import("react").LazyExoticComponent<({ model, regions, handleClose, }: {
16
+ model: import("@jbrowse/mobx-state-tree").IAnyStateTreeNode;
17
+ regions: import("@jbrowse/core/util").Region[];
22
18
  handleClose: () => void;
23
- }) => import("react/jsx-runtime").JSX.Element>;
19
+ }) => import("react").JSX.Element>;
@@ -1,5 +1,5 @@
1
1
  import { lazy } from 'react';
2
2
  export const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
3
- export const SequenceSearchDialog = lazy(() => import("./components/SequenceSearchDialog.js"));
4
- export const ExportSvgDialog = lazy(() => import("./components/ExportSvgDialog.js"));
5
- export const GetSequenceDialog = lazy(() => import("./components/GetSequenceDialog.js"));
3
+ export const SequenceSearchDialog = lazy(() => import('./components/SequenceSearchDialog.js'));
4
+ export const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog.js'));
5
+ export const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog.js'));
@@ -0,0 +1,20 @@
1
+ import type { LinearGenomeViewModel } from './model.ts';
2
+ import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
3
+ /**
4
+ * The single source of truth for which LinearGenomeView actions can be
5
+ * replayed across linked views. Keeping it here (rather than as loose string
6
+ * arrays in each parent view) means the dispatch below stays exhaustive and a
7
+ * typo can't silently produce a no-op sync.
8
+ */
9
+ export type SyncableViewAction = 'horizontalScroll' | 'zoomTo' | 'showTrack' | 'toggleTrack' | 'hideTrack' | 'setTrackLabels' | 'setShowCenterLine';
10
+ interface LinkableViews {
11
+ linkViews: boolean;
12
+ views: LinearGenomeViewModel[];
13
+ }
14
+ /**
15
+ * Install a middleware that, while `linkViews` is on, replays each listed
16
+ * action onto every other sub-view so panning/zooming/track-toggling stays in
17
+ * sync. Used by linear-comparative-view and breakpoint-split-view.
18
+ */
19
+ export declare function installLinkedViewSync(self: IStateTreeNode & LinkableViews, syncActions: readonly SyncableViewAction[]): void;
20
+ export {};
@@ -0,0 +1,52 @@
1
+ import { addDisposer, addMiddleware, getPath } from '@jbrowse/mobx-state-tree';
2
+ function applyViewAction(view, name, args) {
3
+ switch (name) {
4
+ case 'horizontalScroll':
5
+ view.horizontalScroll(args[0]);
6
+ break;
7
+ case 'zoomTo':
8
+ view.zoomTo(args[0]);
9
+ break;
10
+ case 'showTrack':
11
+ view.showTrack(args[0]);
12
+ break;
13
+ case 'toggleTrack':
14
+ view.toggleTrack(args[0]);
15
+ break;
16
+ case 'hideTrack':
17
+ view.hideTrack(args[0]);
18
+ break;
19
+ case 'setTrackLabels':
20
+ view.setTrackLabels(args[0]);
21
+ break;
22
+ case 'setShowCenterLine':
23
+ view.setShowCenterLine(args[0]);
24
+ break;
25
+ }
26
+ }
27
+ /**
28
+ * Install a middleware that, while `linkViews` is on, replays each listed
29
+ * action onto every other sub-view so panning/zooming/track-toggling stays in
30
+ * sync. Used by linear-comparative-view and breakpoint-split-view.
31
+ */
32
+ export function installLinkedViewSync(self, syncActions) {
33
+ addDisposer(self, addMiddleware(self, (rawCall, next) => {
34
+ const handler = rawCall.type === 'action' &&
35
+ rawCall.id === rawCall.rootId &&
36
+ self.linkViews
37
+ ? syncActions.find(action => action === rawCall.name)
38
+ : undefined;
39
+ if (handler) {
40
+ const sourcePath = getPath(rawCall.context);
41
+ next(rawCall);
42
+ for (const view of self.views) {
43
+ if (getPath(view) !== sourcePath) {
44
+ applyViewAction(view, handler, rawCall.args);
45
+ }
46
+ }
47
+ }
48
+ else {
49
+ next(rawCall);
50
+ }
51
+ }));
52
+ }
@@ -1,7 +1,32 @@
1
1
  import type { LinearGenomeViewModel } from './model.ts';
2
2
  import type { BpOffset } from './types.ts';
3
3
  import type { MenuItem } from '@jbrowse/core/ui';
4
- export declare function rewriteOnClicks(self: LinearGenomeViewModel, trackType: string, viewMenuActions: MenuItem[]): void;
4
+ /**
5
+ * Zoom all the way out, shared by the view menu and the header's zoom menu —
6
+ * one definition so the two cannot drift in label, and the view menu is the
7
+ * only one of the two that survives `hideHeader`.
8
+ *
9
+ * The zoom menu earns it on the merits: this is the bottom of the same "Zoom
10
+ * out 100x" ladder, and it is where someone already zooming looks.
11
+ *
12
+ * The label is the import form's button text verbatim (`ImportForm.tsx`), which
13
+ * is where most people meet the phrase. No icon: the four-arrows glyph it
14
+ * carried reads as "fullscreen", and nothing else names the same gesture, so a
15
+ * substitute would be decoration rather than a distinction.
16
+ */
17
+ export declare function showAllRegionsMenuItem(self: LinearGenomeViewModel): MenuItem;
18
+ /**
19
+ * Build the main view menu items
20
+ */
5
21
  export declare function buildMenuItems(self: LinearGenomeViewModel): MenuItem[];
6
- export declare function buildRubberBandMenuItems(self: LinearGenomeViewModel): MenuItem[];
22
+ /**
23
+ * Build rubberband selection menu items. `launchItems` are the plugin-supplied
24
+ * things a selection can start (`rubberBandLaunchMenuItems()`); they collect
25
+ * under one "Launch" submenu so the menu stays three actions plus a group
26
+ * however many plugins are loaded, and vanish entirely when none apply.
27
+ */
28
+ export declare function buildRubberBandMenuItems(self: LinearGenomeViewModel, launchItems: MenuItem[]): MenuItem[];
29
+ /**
30
+ * Build rubberband click menu items (single click on rubberband area)
31
+ */
7
32
  export declare function buildRubberbandClickMenuItems(self: LinearGenomeViewModel, clickOffset: BpOffset): MenuItem[];