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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +250 -121
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +32 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  81. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  82. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  83. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  84. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  85. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  86. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  87. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  88. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  90. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  91. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  92. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  93. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  94. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  95. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  96. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  97. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  98. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  99. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  102. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  103. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  104. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  105. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  106. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  107. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  108. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  109. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  110. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  111. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  112. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  113. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  114. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  115. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  116. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  117. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  118. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  119. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  120. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  121. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  122. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  124. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  126. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  127. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  128. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  129. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  130. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  131. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  132. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  133. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  134. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  135. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  136. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  137. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  138. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  139. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  140. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  141. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  142. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  143. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  144. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  146. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  147. package/esm/LinearGenomeView/components/util.js +27 -6
  148. package/esm/LinearGenomeView/consts.d.ts +7 -2
  149. package/esm/LinearGenomeView/consts.js +18 -2
  150. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  151. package/esm/LinearGenomeView/flyTo.js +135 -0
  152. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  153. package/esm/LinearGenomeView/headerFit.js +59 -0
  154. package/esm/LinearGenomeView/index.d.ts +32 -2
  155. package/esm/LinearGenomeView/index.js +16 -6
  156. package/esm/LinearGenomeView/initKeys.d.ts +12 -0
  157. package/esm/LinearGenomeView/initKeys.js +68 -0
  158. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  159. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  160. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  161. package/esm/LinearGenomeView/launchKeys.js +23 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +58 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +3238 -136
  169. package/esm/LinearGenomeView/model.js +2425 -528
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +138 -0
  223. package/esm/index.d.ts +122 -1235
  224. package/esm/index.js +101 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +55 -11
  228. package/esm/searchUtils.js +342 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,5 +1,238 @@
1
- import { sum } from '@jbrowse/core/util';
1
+ import { svgTrackName } from '@jbrowse/core/svg/trackNames';
2
+ import { max, measureText, sum } from '@jbrowse/core/util';
3
+ import { HEADER_BAR_HEIGHT, HEADER_OVERVIEW_HEIGHT, SVG_SCALEBAR_CAP, } from '../consts.js';
4
+ import { REF_NAME_LABEL_FONT_SIZE } from '../util.js';
5
+ export const trackSpacing = 2;
6
+ // Major and minor gridline tick x-positions, shifted from the staticBlocks
7
+ // frame (which `gridlineTicks`/`scalebarLabels` are computed in, and which
8
+ // overhangs the viewport on both sides) into the view frame. Shared by the SVG
9
+ // gridlines and ruler so their tick pitch can't drift. `dx` is returned too
10
+ // since the ruler reuses it to place its coordinate labels.
11
+ //
12
+ // The shift is the view's own `staticBlocksTranslateX`, so the export and
13
+ // ZoomTransform cannot disagree about the frame.
14
+ export function gridlineTickXs(model) {
15
+ const dx = model.staticBlocksTranslateX;
16
+ const major = [];
17
+ const minor = [];
18
+ for (const tick of model.gridlineTicks) {
19
+ ;
20
+ (tick.major ? major : minor).push(dx + tick.x);
21
+ }
22
+ return { dx, major, minor };
23
+ }
24
+ // `d` for a run of vertical tick lines, collapsed into one <path> rather than a
25
+ // <line> each — as the on-screen Gridlines does. Ticks are anonymous positions
26
+ // with no natural React key, and a few hundred of them per export is a lot of
27
+ // nodes to spend on that.
28
+ export function vlinePath(xs, y1, y2) {
29
+ return xs.map(x => `M${x} ${y1}V${y2}`).join('');
30
+ }
31
+ // Vertical gap between stacked header rows.
32
+ const ROW_GAP = 4;
33
+ // Vertical ink extents of a text label, as a fraction of its font size: Chrome
34
+ // reports a 13px Latin string as 15px tall with ~3px of that below the
35
+ // baseline. `fontSize` alone undercounts the box (it ignores the descenders),
36
+ // which is what used to let an 'offset' label's descenders land on the first
37
+ // pixel row of the track body.
38
+ const LABEL_INK_EM = 1.16;
39
+ const LABEL_DESCENT_EM = 0.22;
40
+ export function labelInkHeight(fontSize) {
41
+ return Math.ceil(fontSize * LABEL_INK_EM);
42
+ }
43
+ function labelDescent(fontSize) {
44
+ return Math.ceil(fontSize * LABEL_DESCENT_EM);
45
+ }
46
+ /**
47
+ * Baseline y for a label whose ink box should start at `topY` — roughly what
48
+ * `dominantBaseline="hanging"` asks the renderer for, but resolved here.
49
+ *
50
+ * Not a renderer-compatibility workaround (`dominant-baseline` is well
51
+ * supported, and SvgCanvas emits it on every feature label it writes). The
52
+ * point is that this file already *models* the ink box, in LABEL_INK_EM /
53
+ * LABEL_DESCENT_EM, and reserves vertical space from that model —
54
+ * `getHeaderLayout` budgets `labelInkHeight(fontSize)` for the scalebar's bp
55
+ * label, `defaultTextHeight` for an offset track label. A label placed with
56
+ * `hanging` is instead positioned by the renderer's own notion of the font's
57
+ * ascent, so the space reserved and the space used come from two different
58
+ * models that merely happen to agree closely at the sizes we ship. Resolving
59
+ * the baseline from the same constants makes them one model, which is what lets
60
+ * util.test.ts check placement against reservation at all.
61
+ */
62
+ export function labelBaselineFromTop(topY, fontSize) {
63
+ return topY + labelInkHeight(fontSize) - labelDescent(fontSize);
64
+ }
65
+ // clearance an 'offset' label keeps above its ascenders and below its
66
+ // descenders. The bottom gap is the wider of the two: it separates text from
67
+ // the features, where the top gap only separates it from the track above.
68
+ const LABEL_PAD_TOP = 1;
69
+ const LABEL_PAD_BOTTOM = 3;
70
+ // Default `textHeight`: the band an 'offset' label occupies above its track,
71
+ // i.e. its full ink box plus that clearance. 20px at the default 13px font,
72
+ // where the old fixed 18 left the descenders 0.4px shy of the features.
73
+ export function defaultTextHeight(fontSize) {
74
+ return labelInkHeight(fontSize) + LABEL_PAD_TOP + LABEL_PAD_BOTTOM;
75
+ }
76
+ // Baseline for an 'offset' label sitting in a `textHeight`-tall band. Measured
77
+ // up from the bottom of the band rather than down from the top, so a
78
+ // caller-supplied textHeight still clears the features (it eats into the gap
79
+ // above the label instead).
80
+ export function offsetLabelBaselineY(textHeight, fontSize) {
81
+ return textHeight - LABEL_PAD_BOTTOM - labelDescent(fontSize);
82
+ }
83
+ // Baseline for a label inset into the top of the box it draws over ('overlay'
84
+ // mode), measured down from that top edge so the ascenders stay inside it.
85
+ export function insetLabelBaselineY(fontSize) {
86
+ return labelBaselineFromTop(LABEL_PAD_TOP, fontSize);
87
+ }
88
+ // The same layout for a STACKED row's header (SVGRowHeader), which differs from
89
+ // the standalone one in direction: its origin is the top of the ruler, and what
90
+ // sits above the ruler is drawn at negative y, into a band the caller reserves
91
+ // between this row and the one above. `bandHeight` is that reservation.
92
+ //
93
+ // A row with no scalebar keeps the layout it has always had — the assembly label
94
+ // on the alphabetic baseline at the origin, its ink box in the caller's band —
95
+ // so the height of a synteny stack does not move.
96
+ //
97
+ // With one, the bar and its bp label go between the assembly name and the ruler.
98
+ // A stacked export is several loci a reader is asked to compare, and without a
99
+ // scale in each row the only thing saying whether two rows are at the same zoom
100
+ // is their ruler coordinates, which are unreadable at the size a figure is
101
+ // published at. The standalone LGV export has drawn this bar all along.
102
+ export function getRowHeaderLayout({ fontSize, showScalebar, }) {
103
+ const label = labelInkHeight(fontSize);
104
+ // the bp label hangs a cap below the bar's line and its own ink box ends a gap
105
+ // above the ruler at y=0
106
+ const scalebarLineY = showScalebar
107
+ ? -(ROW_GAP + label + SVG_SCALEBAR_CAP)
108
+ : undefined;
109
+ // the assembly name's ink box ends a gap above the bar's top cap, which is a
110
+ // vertical line at the same x the name starts at. Everything here is placed by
111
+ // ink box rather than by baseline, because the gaps are fixed while a font's
112
+ // descent is not: laying the label out from its baseline instead put its
113
+ // descenders through that cap at the larger export fonts.
114
+ const assemblyInkTop = scalebarLineY === undefined
115
+ ? -label
116
+ : scalebarLineY - SVG_SCALEBAR_CAP - ROW_GAP - label;
117
+ return {
118
+ // undefined rather than an unused number: a row without a scalebar has no
119
+ // line to place, and the caller draws nothing
120
+ scalebarLineY,
121
+ // 0 is the pre-scalebar placement, kept exactly so a synteny stack doesn't
122
+ // move
123
+ assemblyLabelBaselineY: showScalebar
124
+ ? labelBaselineFromTop(assemblyInkTop, fontSize)
125
+ : 0,
126
+ // up from the ruler to the top of the topmost ink box — the assembly
127
+ // label's, in both cases
128
+ bandHeight: -assemblyInkTop,
129
+ };
130
+ }
131
+ // Compact vertical layout for the exported header: rows (assembly name,
132
+ // cytoband overview, "you are here" polygon, total-bp scalebar, ruler) are
133
+ // stacked with a small fixed gap rather than reserving loose fixed-height
134
+ // bands, so nothing is separated by dead space. `tracksTop` is where the track
135
+ // bodies begin (renderToSvg's `offset`). Shared by SVGHeader and renderToSvg so
136
+ // the header height and the track origin can't drift.
137
+ export function getHeaderLayout({ fontSize, showCytobands, rulerHeight, }) {
138
+ // the assembly name is drawn on its ink box, not on `fontSize`: at y=0 with a
139
+ // hanging baseline its ascenders rose above the export's top edge and got
140
+ // clipped, so the label now hangs from its own baseline inside this band
141
+ const assemblyLabelHeight = labelInkHeight(fontSize);
142
+ const cytobandTop = assemblyLabelHeight + ROW_GAP;
143
+ const polygonTop = cytobandTop + HEADER_OVERVIEW_HEIGHT;
144
+ // scalebar line sits at the bottom tip of the "you are here" polygon (with
145
+ // cytobands) or just below the assembly name (without); the cap clears the
146
+ // assembly label in the latter case
147
+ const scalebarLineY = showCytobands
148
+ ? polygonTop + HEADER_BAR_HEIGHT
149
+ : cytobandTop + SVG_SCALEBAR_CAP;
150
+ // the bp label hangs below the scalebar line (a cap's clearance, then the
151
+ // label's ink box), and the ruler starts a gap below that
152
+ const rulerTop = scalebarLineY + SVG_SCALEBAR_CAP + labelInkHeight(fontSize) + ROW_GAP;
153
+ return {
154
+ assemblyLabelBaselineY: labelBaselineFromTop(0, fontSize),
155
+ cytobandTop,
156
+ scalebarLineY,
157
+ rulerTop,
158
+ tracksTop: rulerTop + rulerHeight,
159
+ };
160
+ }
161
+ // Ruler tick geometry, shared by the tick marks and their number labels.
162
+ export const RULER_MAJOR_TICK = 5;
163
+ export const RULER_MINOR_TICK = 3;
164
+ export const RULER_TICK_FONT_SIZE = 11;
165
+ // clearance between the tick-number baseline and the marks below it
166
+ const RULER_TICK_LABEL_GAP = 2;
167
+ // Vertical positions within a ruler of the given budget: tick marks hang just
168
+ // above the tracks (bottom of the budget) and the numbers sit above the marks,
169
+ // so the two never overprint.
170
+ export function getRulerLayout(rulerHeight) {
171
+ const tickTopY = rulerHeight - 2 - RULER_MAJOR_TICK;
172
+ return { tickTopY, numbersBaselineY: tickTopY - RULER_TICK_LABEL_GAP };
173
+ }
174
+ // Ink box of the bold refName label drawn at the top of the ruler, keyed to the
175
+ // size its glyphs are actually drawn at rather than to the export's general
176
+ // `fontSize`. The two are independent: the fit tests upstream (refNameLabelWidth
177
+ // via getScalebarRefNameLabels / refNameLabelFitsInView) all measure at
178
+ // REF_NAME_LABEL_FONT_SIZE, so sizing the label's clip box off `fontSize`
179
+ // instead clipped the descenders of a name like `chrUn_gl000220` at the default
180
+ // 13, and both ends of the glyphs at any smaller export font.
181
+ export const refNameLabelBoxHeight = labelInkHeight(REF_NAME_LABEL_FONT_SIZE);
182
+ export const refNameLabelBaselineY = labelBaselineFromTop(0, REF_NAME_LABEL_FONT_SIZE);
183
+ // space the label pushes a track down by; only 'offset' mode does
184
+ export function labelOffset(trackLabels, textHeight) {
185
+ return trackLabels === 'offset' ? textHeight : 0;
186
+ }
187
+ // Gap between a 'left' track label's right edge and the track body.
188
+ // SVGTrackLabel right-aligns its text at `trackLabelOffset - TRACK_LABEL_GAP`,
189
+ // so it and trackLabelLeftOffset must agree or the widest name overflows the
190
+ // gutter it was measured for.
191
+ export const TRACK_LABEL_GAP = 40;
192
+ // Horizontal gutter reserved for 'left' track labels (0 in every other mode).
193
+ // Takes an already-minimized-filtered track list, so the reserved width matches
194
+ // the labels that actually get drawn.
195
+ //
196
+ // `fontFamily` is the export's own font option, and it has to reach the ruler
197
+ // here: the labels are drawn in it (wrapSvgExport puts it on the root <svg>,
198
+ // where every <text> inherits it), so measuring them in another font reserves
199
+ // the wrong gutter — and this is the one measurement whose being wrong shows up
200
+ // as ink outside its box rather than as a label dropped at an edge. Monospace
201
+ // is the family that breaks it; see measureText.
202
+ //
203
+ // The export's other fit tests (tickLabelWidth for the ruler coordinates,
204
+ // refNameLabelWidth for the chromosome names) still measure at the app font,
205
+ // deliberately: they feed *drop* rules whose worst case is a label at the
206
+ // viewport edge kept instead of dropped, and every one of them is drawn inside
207
+ // a clip that bounds it either way. Their region-fit half also lives in
208
+ // `getScalebarRefNameLabels`, an on-screen model getter, so making them
209
+ // family-aware means threading an export option through screen state.
210
+ export function trackLabelLeftOffset({ tracks, trackLabels, fontSize, fontFamily, session, }) {
211
+ // no labels means no gutter, and that includes having no tracks to label: the
212
+ // gap alone would push the whole figure right of a margin nothing is drawn in
213
+ return trackLabels === 'left' && tracks.length > 0
214
+ ? max(tracks.map(t => measureText(svgTrackName(t, session), fontSize, fontFamily)), 0) + TRACK_LABEL_GAP
215
+ : 0;
216
+ }
217
+ // vertical box a single track occupies. Shared by totalHeight (sum) and
218
+ // trackBoxOffsets (prefix-sum) so the two can't drift.
219
+ export function trackBoxHeight(track, textOffset) {
220
+ return track.displays[0].height + textOffset + trackSpacing;
221
+ }
222
+ // Top y of each track's box within a stack of them. SVGTracks lays the bodies
223
+ // out with it and the breakpoint-split export anchors its overlay ribbons with
224
+ // it, so one implementation rather than two prefix-sums that must agree —
225
+ // they drifted by trackSpacing per track when they didn't.
226
+ export function trackBoxOffsets(tracks, textOffset) {
227
+ const offsets = [];
228
+ let total = 0;
229
+ for (const track of tracks) {
230
+ offsets.push(total);
231
+ total += trackBoxHeight(track, textOffset);
232
+ }
233
+ return offsets;
234
+ }
2
235
  export function totalHeight(tracks, textHeight, trackLabels) {
3
- return sum(tracks.map(t => t.displays[0].height +
4
- (['none', 'left'].includes(trackLabels) ? 0 : textHeight)));
236
+ const textOffset = labelOffset(trackLabels, textHeight);
237
+ return sum(tracks.map(t => trackBoxHeight(t, textOffset)));
5
238
  }
@@ -1,3 +1,7 @@
1
+ import type { LinearGenomeViewStateModel } from './model.ts';
2
+ import type { HighlightType } from '@jbrowse/core/util/highlights';
3
+ import type { TrackInit } from '@jbrowse/core/util/tracks';
4
+ import type { SnapshotIn } from '@jbrowse/mobx-state-tree';
1
5
  export interface BpOffset {
2
6
  refName?: string;
3
7
  index: number;
@@ -9,31 +13,8 @@ export interface BpOffset {
9
13
  assemblyName?: string;
10
14
  oob?: boolean;
11
15
  }
12
- export interface ExportSvgOptions {
13
- rasterizeLayers?: boolean;
14
- format?: 'svg' | 'png';
15
- filename?: string;
16
- Wrapper?: React.FC<{
17
- children: React.ReactNode;
18
- }>;
19
- fontSize?: number;
20
- rulerHeight?: number;
21
- textHeight?: number;
22
- paddingHeight?: number;
23
- headerHeight?: number;
24
- cytobandHeight?: number;
25
- trackLabels?: string;
26
- themeName?: string;
27
- showGridlines?: boolean;
28
- }
29
- export interface HighlightType {
30
- start: number;
31
- end: number;
32
- assemblyName?: string;
33
- refName: string;
34
- color?: string;
35
- label?: string;
36
- }
16
+ export type { ExportSvgOptions, TrackLabelMode, } from '@jbrowse/display-kit/types';
17
+ export type { HighlightType };
37
18
  export interface NavLocation {
38
19
  refName: string;
39
20
  start?: number;
@@ -43,16 +24,21 @@ export interface NavLocation {
43
24
  export interface VolatileGuide {
44
25
  xPos: number;
45
26
  }
46
- export type TrackInit = string | {
47
- trackId: string;
48
- displaySnapshot?: Record<string, unknown>;
49
- trackSnapshot?: Record<string, unknown>;
50
- };
51
27
  export interface InitState {
28
+ /**
29
+ * A locstring, or several separated by spaces to open a discontinuous view:
30
+ * `'chr3:25,325,000-25,361,000 chr10:58,716,500-58,718,500'`. Multiple
31
+ * regions are the only declarative way to frame something spread across loci
32
+ * (a derivative allele against its sources, a gene's partners in a fusion) --
33
+ * `displayedRegionNames` takes whole chromosomes, not intervals.
34
+ */
52
35
  loc?: string;
36
+ grow?: number;
53
37
  assembly: string;
38
+ displayedRegionNames?: string[];
54
39
  tracks?: TrackInit[];
55
40
  tracklist?: boolean;
56
41
  nav?: boolean;
57
- highlight?: string[];
42
+ highlight?: (string | HighlightType)[];
58
43
  }
44
+ export type LinearGenomeViewLaunchProps = Partial<Omit<SnapshotIn<LinearGenomeViewStateModel>, keyof InitState | 'id' | 'type' | 'launch'>>;
@@ -1 +1,2 @@
1
1
  export {};
2
+ // #endregion
@@ -1,30 +1,350 @@
1
1
  import type { AssemblyManager, ParsedLocString } from '@jbrowse/core/util';
2
- import type { BaseBlock } from '@jbrowse/core/util/blockTypes';
2
+ import type { BaseBlock, ContentBlock } from '@jbrowse/core/util/blockTypes';
3
+ import type { Region } from '@jbrowse/core/util/types';
4
+ /**
5
+ * The stored viewport of a view showing `totalBp` of displayed regions fitted to
6
+ * `width` — the regions filling it edge to edge, and centered in it only where
7
+ * they are too narrow to fill it.
8
+ *
9
+ * **This is where the fit-to-width rule is written.** `fitAllRegions` takes its
10
+ * scale from here rather than restating it, so the two cannot drift; a second
11
+ * spelling of `max(minBpPerPx * width, totalBp)` reading `MIN_BP_PER_PX` where
12
+ * the action reads the `minBpPerPx` GETTER would agree only for as long as
13
+ * nothing overrides it.
14
+ *
15
+ * The reason it is a function at all is `windowStartBp`, which `fitAllRegions`
16
+ * does not need (it centers in pixels, through `scrollTo`, which also clamps).
17
+ * A caller building a view SNAPSHOT does: it has no model to call
18
+ * `fitAllRegions()` on, and naming `bpPerPx`/`offsetPx` instead is dropped
19
+ * whenever the snapshot also carries a `windowWidthBp` — which one copied off an
20
+ * existing view always does. plugin-canvas's collapsed-intron launch is that
21
+ * caller. A live view calls `fitAllRegions()`.
22
+ *
23
+ * `width` enters only through the zoom-in floor, which bites for a region set
24
+ * narrower than `width * minBpPerPx`; the window itself is in bp and needs no
25
+ * width, which is why a snapshot can carry it at all.
26
+ */
27
+ export declare function fitAllRegionsWindow(totalBp: number, width: number, minBpPerPx: number): {
28
+ windowWidthBp: number;
29
+ windowStartBp: number;
30
+ };
31
+ /**
32
+ * Expand a region by a grow factor, adding padding on each side.
33
+ *
34
+ * @param start - region start coordinate
35
+ * @param end - region end coordinate
36
+ * @param grow - multiplier for expansion (e.g., 0.2 adds 20% padding on each
37
+ * side)
38
+ * @param minBound - minimum bound to clamp start to (default 0)
39
+ * @param maxBound - maximum bound to clamp end to (default Infinity)
40
+ * @returns object with expanded start and end coordinates
41
+ */
3
42
  export declare function expandRegion(start: number, end: number, grow: number, minBound?: number, maxBound?: number): {
4
43
  start: number;
5
44
  end: number;
6
45
  };
7
- export declare function chooseGridPitch(scale: number, minMajorPitchPx: number, minMinorPitchPx: number): {
8
- majorPitch: number;
9
- minorPitch: number;
46
+ /**
47
+ * Generate tick positions for the overview scalebar. Anchors at the first neat
48
+ * majorPitch multiple strictly inside the block so ticks land on round numbers
49
+ * regardless of where the block starts/ends.
50
+ */
51
+ export declare function makeOverviewTicks(start: number, end: number, bpPerPx: number, reversed?: boolean): {
52
+ genomicCoord: number;
53
+ offsetPx: number;
54
+ }[];
55
+ export interface Tick {
56
+ type: 'major' | 'minor';
57
+ base: number;
58
+ }
59
+ /**
60
+ * Ticks for one span of the ruler. Not the dotplot's same-named function, which
61
+ * walks static blocks into a single continuous axis and therefore has to dedupe
62
+ * the shared block seam and carry each tick's px. Here every block draws its own
63
+ * clipped ruler, so this overscans its span instead of deduping and leaves px to
64
+ * `makeBlockTicks`. What the two do share is already shared: `chooseGridPitch`,
65
+ * and `base` as the 0-based coordinate that `getTickDisplayStr` labels `base+1`.
66
+ */
67
+ export declare function makeTicks(start: number, end: number, bpPerPx: number, emitMajor?: boolean, emitMinor?: boolean): Tick[];
68
+ /** A block's refName, or undefined for non-content (elided/padding) blocks. */
69
+ export declare function getBlockRefName(block: BaseBlock): string | undefined;
70
+ /**
71
+ * For blocks in display order, returns whether each block's refName should be
72
+ * labeled: true only for the first block of each run of same-refName regions,
73
+ * so a refName is shown once instead of repeated at every region boundary (e.g.
74
+ * collapsed introns produce many adjacent same-refName regions).
75
+ *
76
+ * A block with no refName ends the run. What an elided block hides is *other
77
+ * chromosomes*, so the same name reappearing on its far side starts a region the
78
+ * reader needs named again, not a continuation of the one before it. Regions lay
79
+ * out contiguously, so an elided run is the only nameless block that can fall
80
+ * between two content blocks — the boundary pads only bracket the whole set,
81
+ * where ending a run changes nothing.
82
+ */
83
+ export declare function showRefNameLabels<T>(blocks: T[], getRefName: (block: T) => string | undefined): boolean[];
84
+ /**
85
+ * Whether the displayed regions are laid out left-to-right, right-to-left, or
86
+ * some of each. `horizontallyFlip` reverses the order and flips every region at
87
+ * once, so a flipped row is uniformly `reversed`; `mixed` takes going out of
88
+ * your way, through the scalebar label menu's per-region "Reverse region".
89
+ */
90
+ export type RegionsOrientation = 'forward' | 'reversed' | 'mixed';
91
+ export declare function regionsOrientation(regions: {
92
+ reversed?: boolean;
93
+ }[]): RegionsOrientation;
94
+ export interface ScalebarRefNameLabel {
95
+ key: string;
96
+ refName: string;
97
+ displayedRegionIndex: number;
98
+ lastDisplayedRegionIndex: number;
99
+ sticky: boolean;
100
+ transform: number;
101
+ maxWidth: number;
102
+ paddingLeft: number;
103
+ text: string;
104
+ }
105
+ /**
106
+ * Builds the refName labels drawn along the scalebar as plain data (no JSX): one
107
+ * label per run of same-refName regions (deduped so collapsed introns don't
108
+ * repeat the name) plus a "sticky" label pinned to the left edge naming the
109
+ * refName under the viewport's left border.
110
+ *
111
+ * `caption` is the row-level chip at the viewport's left edge, and it says two
112
+ * things: which assembly this row is (`prefix`, an assembly name, synteny only)
113
+ * and whether the row is flipped. Without it a row of stacked genomes would
114
+ * label some rows with the assembly name and some without, depending only on
115
+ * how wide their leftmost chromosome happens to be.
116
+ *
117
+ * The assembly name alone folds into the sticky label instead — "prefix:refName"
118
+ * — whenever the two would collide at the left edge, and stands alone when the
119
+ * sticky label sits far enough right not to (a view scrolled left of its first
120
+ * region, so the row's data starts mid-viewport) or when there is no sticky
121
+ * label at all.
122
+ *
123
+ * `orientation` decides the ` [rev]` marker, and it is the row's
124
+ * (`displayedRegionsOrientation`) rather than anything read off the blocks —
125
+ * blocks cover the window, and a row is flipped or not whatever part of it you
126
+ * are looking at. The rule is `assembleLocStrings`': say it where it
127
+ * distinguishes, once where it does not.
128
+ *
129
+ * - `reversed`: the whole row is flipped, which is a fact about the row, so the
130
+ * caption carries it and NO name does. The caption cannot fold in this state
131
+ * — the sticky label is pushed clear of it instead — because a marker sitting
132
+ * on a chromosome name is how the mixed case spells a fact about that one
133
+ * region. `chr1 [rev] | chr2` would otherwise mean both "the row is flipped,
134
+ * said once" and "chr1 is flipped and chr2 is not", in identical pixels.
135
+ * - `mixed`: only some regions are flipped — reachable through the label menu's
136
+ * per-region "Reverse region" — so every reversed run is marked and the
137
+ * forward ones are left alone. Here the marker on a name is the only thing
138
+ * telling two labels apart.
139
+ * - `forward`: no marker.
140
+ *
141
+ * Saying it once is the point: a flipped whole-genome row would otherwise
142
+ * repeat `[rev]` after all 24 chromosomes to say a single thing about the row.
143
+ *
144
+ * Under `mixed` the marker never costs a name: a suffixed label that fails the
145
+ * fit test falls back to the bare name rather than being dropped. Widening the
146
+ * text moves the region width a name needs from ~30px to ~56px at 11px bold,
147
+ * and a feature meant to surface information should not be deleting chromosome
148
+ * names in the narrow half of that gap.
149
+ */
150
+ export declare function getScalebarRefNameLabels({ blocks, offsetPx, prefix, orientation, }: {
151
+ blocks: BaseBlock[];
152
+ offsetPx: number;
153
+ prefix: string | undefined;
154
+ orientation?: RegionsOrientation;
155
+ }): {
156
+ labels: ScalebarRefNameLabel[];
157
+ caption: string | undefined;
158
+ captionSpanPx: number;
159
+ };
160
+ /**
161
+ * Screen-x span a refName label paints over: its padding and its glyphs, which
162
+ * is the whole of it, since the box shrinks to its text rather than filling the
163
+ * `maxWidth` it was fitted against. Anything drawn under this span is hidden by
164
+ * the label's opaque backing, so the coordinate numbers use it to stay out from
165
+ * under the sticky label the way `runRefNameLabelPx` keeps them out from under
166
+ * the others.
167
+ */
168
+ export declare function refNameLabelSpanPx(label: ScalebarRefNameLabel): {
169
+ left: number;
170
+ right: number;
10
171
  };
11
- export declare function makeTicks(start: number, end: number, bpPerPx: number, emitMajor?: boolean, emitMinor?: boolean): {
12
- type: string;
172
+ /**
173
+ * Whether a label from getScalebarRefNameLabels is drawn whole within a
174
+ * viewport `widthPx` wide. The labels themselves are only fitted to their own
175
+ * *run of regions*, which routinely runs past the right edge of the view, so
176
+ * one starting a few px before that edge passes the run fit and is then cut by
177
+ * the viewport clip. On screen that reads as a name scrolled partly out of
178
+ * frame, but a static SVG export has no frame to scroll — there a cut "LG2"
179
+ * just names a chromosome that doesn't exist, so the export drops it instead,
180
+ * as it already does for tick numbers at the same edge.
181
+ */
182
+ export declare function refNameLabelFitsInView(label: ScalebarRefNameLabel, widthPx: number): boolean;
183
+ /**
184
+ * The reorder entries the refName-label menu offers for the region at `idx` of
185
+ * `numRegions`, each already carrying the index it moves to. The "far" moves
186
+ * need a gap of more than one between `idx` and the end — otherwise "Move to
187
+ * far left/right" targets the same index as "Move left/right" and duplicates
188
+ * the entry.
189
+ */
190
+ export declare function regionMoveActions(idx: number, numRegions: number): {
191
+ label: string;
192
+ to: number;
193
+ }[];
194
+ /**
195
+ * The region reorderings offered by the refName-label menu, as pure list
196
+ * transforms feeding setDisplayedRegions (which re-clamps bpPerPx/offsetPx for
197
+ * the new region set).
198
+ */
199
+ export declare function withRegionMoved(regions: Region[], from: number, to: number): Region[];
200
+ export declare function withRegionRemoved(regions: Region[], index: number): Region[];
201
+ export declare function withRegionReversed(regions: Region[], index: number): Region[];
202
+ /**
203
+ * Whether a label occupying [leftPx, leftPx + labelWidth] fits within a block
204
+ * of the given pixel width, used to skip tick labels that would be clipped at a
205
+ * region edge (common with small collapsed-intron regions).
206
+ */
207
+ export declare function labelFitsInBlock(leftPx: number, labelWidth: number, widthPx: number): boolean;
208
+ /** Font size of coordinate tick labels on the scalebar and overview scalebar. */
209
+ export declare const TICK_LABEL_FONT_SIZE = 11;
210
+ /**
211
+ * On-screen width of a coordinate tick label: the text plus 2px of horizontal
212
+ * padding on each side. Single-sourced so the HTML scalebar and the SVG export
213
+ * agree on when a label is too wide to fit inside its block.
214
+ */
215
+ export declare function tickLabelWidth(label: string): number;
216
+ /** Font size of the bold refName label drawn at the left edge of its block, on
217
+ * the scalebar and the overview scalebar alike. */
218
+ export declare const REF_NAME_LABEL_FONT_SIZE = 11;
219
+ /**
220
+ * Horizontal space the overview refName label occupies at a block's left edge.
221
+ * Overview tick labels use this to avoid drawing underneath the refName, which
222
+ * otherwise collide when zoomed far out (ticks bunch up near the block start).
223
+ */
224
+ export declare function overviewRefNameLabelWidth(refName: string): number;
225
+ /**
226
+ * How far right the ideogram starts, i.e. the gutter the chromosome name drawn
227
+ * to its left gets to itself. Shares overviewRefNameLabelWidth with the tick
228
+ * labels that dodge the same name, rather than measuring it again at a font size
229
+ * (12) the label is not actually drawn at (REF_NAME_LABEL_FONT_SIZE).
230
+ */
231
+ export declare function cytobandLabelGutterWidth(refName: string): number;
232
+ /**
233
+ * Coordinate labels drawn inside one overview-scalebar block: tick text plus its
234
+ * x within the block. Labels that can't be drawn whole between the block's bold
235
+ * refName label and its right edge are dropped by the same
236
+ * tickLabelWidth/labelFitsInBlock test the main scalebar and SVG export use; if
237
+ * too few survive to make a ruler, the block goes unnumbered.
238
+ */
239
+ export declare function makeOverviewTickLabels({ block, bpPerPx, refNameLabelPx, }: {
240
+ block: {
241
+ start: number;
242
+ end: number;
243
+ reversed?: boolean;
244
+ widthPx: number;
245
+ };
246
+ bpPerPx: number;
247
+ refNameLabelPx: number;
248
+ }): {
249
+ genomicCoord: number;
250
+ offsetPx: number;
251
+ label: string;
252
+ }[];
253
+ /**
254
+ * A maximal run of adjacent staticBlocks that belong to one contiguous
255
+ * displayed region. staticBlocks chop a region into ~800px chunks; merging them
256
+ * back means a coordinate label sitting on an internal chunk boundary is no
257
+ * longer clipped away by both neighbors (only genuine region edges clip).
258
+ */
259
+ export interface BlockRun {
260
+ offsetPx: number;
261
+ widthPx: number;
262
+ start: number;
263
+ end: number;
264
+ reversed: boolean;
265
+ refName: string;
266
+ isLeftEndOfDisplayedRegion: boolean;
267
+ }
268
+ export declare function groupContiguousBlocks(blocks: BaseBlock[]): BlockRun[];
269
+ /**
270
+ * Horizontal space reserved at each run's left edge for the bold refName label
271
+ * drawn there, or 0 for runs that get none. Coordinate labels use this to stay
272
+ * out from under the name, the way the overview scalebar's already do via
273
+ * overviewRefNameLabelWidth: the refName label is opaque and painted after the
274
+ * numbers, so one underneath it isn't merely crowded but invisible — and since
275
+ * both sit in the block frame and scroll together, invisible at every scroll
276
+ * position rather than only while passing behind.
277
+ *
278
+ * Which runs get a label follows getScalebarRefNameLabels: only where a region
279
+ * genuinely begins, and only the first of a run of one refName (collapsed
280
+ * introns make many adjacent regions of the same name). It deliberately drops
281
+ * that function's offsetPx term so the reservation — and with it scalebarLabels
282
+ * — stays stable while scrolling; a run scrolled off the left reserves space
283
+ * that is off-screen anyway. Where the two disagree the reservation is the
284
+ * conservative side: at worst a coordinate is dropped from a region too narrow
285
+ * to have kept MIN_TICK_LABELS_PER_BLOCK of them.
286
+ *
287
+ * `orientation` enters because under `mixed` a reversed run's label carries the
288
+ * ` [rev]` marker and so is wider than its name. Under a uniformly `reversed`
289
+ * row only the sticky label is marked, and that one is dodged on screen instead
290
+ * (`refNameLabelSpanPx`), its x being a function of the scroll rather than of
291
+ * this frame.
292
+ */
293
+ export declare function runRefNameLabelPx(runs: BlockRun[], orientation?: RegionsOrientation): number[];
294
+ /**
295
+ * makeTicks plus each tick's pixel x within its block, accounting for reversed
296
+ * regions. Single source of the tick→px formula shared by gridlines, the
297
+ * scalebar coordinate labels, and SVG export so their positions can't drift.
298
+ */
299
+ export declare function makeBlockTicks({ start, end, reversed, }: {
300
+ start: number;
301
+ end: number;
302
+ reversed?: boolean;
303
+ }, bpPerPx: number, emitMajor?: boolean, emitMinor?: boolean): {
304
+ type: 'major' | 'minor';
13
305
  base: number;
14
- index: number;
306
+ x: number;
15
307
  }[];
308
+ /**
309
+ * Generate location objects for a set of parsed locstrings, which includes
310
+ * translating the refNames to assembly-canonical refNames and adding the
311
+ * 'parentRegion'
312
+ *
313
+ * Used by navToLocations and navToLocString
314
+ *
315
+ * @param regions - array of parsed location strings to generate locations for
316
+ * @param assemblyManager - the assembly manager instance
317
+ * @param assemblyName - optional assembly name to use for regions that don't
318
+ * specify one
319
+ * @param grow - optional multiplier to expand regions by (e.g., 0.2 adds 20%
320
+ * padding on each side of the region). Useful for adding visual padding when
321
+ * navigating to a feature
322
+ */
16
323
  export declare function generateLocations({ regions, assemblyManager, assemblyName, grow, }: {
17
324
  regions: ParsedLocString[];
18
325
  assemblyManager: AssemblyManager;
19
326
  assemblyName?: string;
20
327
  grow?: number;
21
328
  }): Promise<{
22
- assemblyName: string;
23
- parentRegion: import("@jbrowse/core/assemblyManager/assembly").BasicRegion;
329
+ refName: string;
24
330
  start?: number;
25
331
  end?: number;
26
- refName: string;
27
- reversed?: boolean | undefined;
332
+ reversed?: boolean;
333
+ assemblyName: string;
334
+ parentRegion: import("@jbrowse/core/assemblyManager/assembly").BasicRegion;
28
335
  }[]>;
336
+ /**
337
+ * Parses locString or space separated set of locStrings into location objects
338
+ * Example inputs:
339
+ * "chr1"
340
+ * "chr1:1-100"
341
+ * "chr1:1..100"
342
+ * "chr1 chr2"
343
+ * "chr1:1-100 chr2:1-100"
344
+ * "chr1 100 200" equivalent to "chr1:100-200"
345
+ * "chr1:34M-35M" equivalent to "chr1:34000000-35000000"
346
+ *
347
+ * Used by navToLocString
348
+ */
29
349
  export declare function parseLocStrings(input: string, assemblyName: string, isValidRefName: (str: string, assemblyName: string) => boolean): ParsedLocString[];
30
- export declare function calculateVisibleLocStrings(contentBlocks: BaseBlock[]): string;
350
+ export declare function calculateVisibleLocStrings(contentBlocks: ContentBlock[]): string;