@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,39 +1,62 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { alpha } from '@jbrowse/core/ui/palette';
2
3
  import { getFillProps, getStrokeProps } from '@jbrowse/core/util';
3
- import { alpha, useTheme } from '@mui/material';
4
+ import { regionBlocksPxExtent, transformPxSpan, } from '@jbrowse/core/util/Base1DUtils';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
6
  import { observer } from 'mobx-react';
5
- import { HEADER_BAR_HEIGHT } from "../consts.js";
6
- const OverviewScalebarPolygon = observer(function OverviewScalebarPolygon({ model, overview, useOffset = true, }) {
7
- const theme = useTheme();
8
- const polygonColor = theme.palette.tertiary.light;
9
- const multiplier = Number(useOffset);
10
- const { interRegionPaddingWidth, offsetPx, dynamicBlocks, cytobandOffset } = model;
11
- const { contentBlocks, totalWidthPxWithoutBorders } = dynamicBlocks;
12
- if (!contentBlocks.length) {
7
+ import { HEADER_BAR_HEIGHT } from '../consts.js';
8
+ /**
9
+ * SVG points for a trapezoid with horizontal top and bottom edges, wound as a
10
+ * single non-self-intersecting loop (bottom-left → bottom-right → top-right →
11
+ * top-left).
12
+ */
13
+ function trapezoidPoints(top, bottom, height) {
14
+ return [
15
+ [bottom.leftPx, height],
16
+ [bottom.rightPx, height],
17
+ [top.rightPx, 0],
18
+ [top.leftPx, 0],
19
+ ]
20
+ .map(([x, y]) => `${x},${y}`)
21
+ .join(' ');
22
+ }
23
+ // Fill/stroke are theme-derived and zoom-invariant, so they live in a static
24
+ // class computed once per theme (makeStyles memoizes) — an on-screen zoom frame
25
+ // then does zero color parsing. SVG export can't carry a CSS class, so that path
26
+ // serializes explicit fill/stroke attributes instead (see `exportSvg` below).
27
+ const useStyles = makeStyles()(theme => ({
28
+ polygon: {
29
+ fill: alpha(theme.palette.tertiary.light, 0.3),
30
+ stroke: alpha(theme.palette.tertiary.light, 0.8),
31
+ },
32
+ }));
33
+ /**
34
+ * The "you are here" connector: a trapezoid joining the visible region's extent
35
+ * in the overview (top edge) to that same extent in the main view (bottom
36
+ * edge). Both edges come from one pixel extent, so they always describe the
37
+ * same regions — including elided ones.
38
+ *
39
+ * @param overviewOffsetPx - pixels the overview is shifted right of the main
40
+ * view's origin. In the interactive view the overview clears the chromosome-
41
+ * name gap (cytobandOffset); in SVG export it is flush (0).
42
+ * @param exportSvg - serialize explicit fill/stroke attributes (the split the
43
+ * `getFill/StrokeProps` helpers exist for) instead of the on-screen CSS class,
44
+ * which wouldn't survive into a standalone exported SVG.
45
+ */
46
+ const OverviewScalebarPolygon = observer(function OverviewScalebarPolygon({ model, overview, overviewOffsetPx = 0, exportSvg = false, }) {
47
+ const { classes, theme } = useStyles();
48
+ const { offsetPx, bpPerPx, dynamicBlocks } = model;
49
+ const extent = regionBlocksPxExtent(dynamicBlocks.blocks);
50
+ if (!extent) {
13
51
  return null;
14
52
  }
15
- const first = contentBlocks.at(0);
16
- const last = contentBlocks.at(-1);
17
- const topLeft = (overview.bpToPx({
18
- refName: first.refName,
19
- coord: first.reversed ? first.end : first.start,
20
- }) || 0) +
21
- cytobandOffset * multiplier;
22
- const topRight = (overview.bpToPx({
23
- refName: last.refName,
24
- coord: last.reversed ? last.start : last.end,
25
- }) || 0) +
26
- cytobandOffset * multiplier;
27
- const startPx = Math.max(0, -offsetPx);
28
- const endPx = startPx +
29
- totalWidthPxWithoutBorders +
30
- (contentBlocks.length * interRegionPaddingWidth) / 2;
31
- const points = [
32
- [startPx, HEADER_BAR_HEIGHT],
33
- [endPx, HEADER_BAR_HEIGHT],
34
- [topRight, 0],
35
- [topLeft, 0],
36
- ];
37
- return (_jsx("polygon", { points: points.toString(), ...getFillProps(alpha(polygonColor, 0.3)), ...getStrokeProps(alpha(polygonColor, 0.8)) }));
53
+ // the main view and overview lay out the same regions from cumulative-bp 0,
54
+ // so a main-view pixel maps to the (more zoomed-out) overview by the bpPerPx
55
+ // ratio; the bottom edge is the same extent in main-view space, shifted by
56
+ // the scroll offset
57
+ const top = transformPxSpan(extent, bpPerPx / overview.bpPerPx, overviewOffsetPx);
58
+ const bottom = transformPxSpan(extent, 1, -offsetPx);
59
+ const points = trapezoidPoints(top, bottom, HEADER_BAR_HEIGHT);
60
+ return exportSvg ? (_jsx("polygon", { points: points, ...getFillProps(alpha(theme.palette.tertiary.light, 0.3)), ...getStrokeProps(alpha(theme.palette.tertiary.light, 0.8)) })) : (_jsx("polygon", { points: points, className: classes.polygon }));
38
61
  });
39
62
  export default OverviewScalebarPolygon;
@@ -1,10 +1,9 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
3
2
  import type { ContentBlock } from '@jbrowse/core/util/blockTypes';
4
- declare const OverviewScalebarTickLabels: ({ block, scale, overview, model, }: {
3
+ declare const OverviewScalebarTickLabels: ({ block, model, refNameColor, showRefName, }: {
5
4
  model: LinearGenomeViewModel;
6
- scale: number;
7
5
  block: ContentBlock;
8
- overview: Base1DViewModel;
9
- }) => import("react/jsx-runtime").JSX.Element[];
6
+ refNameColor: string | undefined;
7
+ showRefName: boolean;
8
+ }) => import("react").JSX.Element[];
10
9
  export default OverviewScalebarTickLabels;
@@ -1,35 +1,33 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getSession, getTickDisplayStr } from '@jbrowse/core/util';
3
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
4
3
  import { Typography } from '@mui/material';
5
4
  import { observer } from 'mobx-react';
6
- import { HEADER_OVERVIEW_HEIGHT } from "../consts.js";
7
- import { chooseGridPitch } from "../util.js";
5
+ import { HEADER_OVERVIEW_HEIGHT } from '../consts.js';
6
+ import { TICK_LABEL_FONT_SIZE, makeOverviewTickLabels, overviewRefNameLabelWidth, } from '../util.js';
8
7
  const useStyles = makeStyles()({
9
8
  scalebarLabel: {
10
9
  height: HEADER_OVERVIEW_HEIGHT,
11
10
  position: 'absolute',
12
11
  left: 0,
13
12
  display: 'flex',
14
- justifyContent: 'center',
13
+ // 11px, not body2: makeOverviewTickLabels drops labels too wide for their
14
+ // block using tickLabelWidth, which measures at 11px
15
+ fontSize: TICK_LABEL_FONT_SIZE,
15
16
  pointerEvents: 'none',
16
17
  },
17
18
  });
18
- const OverviewScalebarTickLabels = observer(function OverviewScalebarTickLabels({ block, scale, overview, model, }) {
19
+ const OverviewScalebarTickLabels = observer(function OverviewScalebarTickLabels({ block, model, refNameColor, showRefName, }) {
19
20
  const { classes } = useStyles();
20
- const { start, end, reversed, refName, assemblyName } = block;
21
- const { majorPitch } = chooseGridPitch(scale, 120, 15);
22
- const { assemblyManager } = getSession(model);
23
- const assembly = assemblyManager.get(assemblyName);
24
- const refNameColor = assembly?.getRefNameColor(refName);
25
- const tickLabels = [];
26
- for (let i = 0; i < Math.floor((end - start) / majorPitch); i++) {
27
- const offsetLabel = (i + 1) * majorPitch;
28
- tickLabels.push(reversed ? end - offsetLabel : start + offsetLabel);
29
- }
30
- return tickLabels.map((tickLabel, labelIdx) => (_jsx(Typography, { className: classes.scalebarLabel, variant: "body2", style: {
31
- transform: `translateX(${((labelIdx + 1) * majorPitch) / scale}px)`,
21
+ const { refName } = block;
22
+ const { bpPerPx } = model.overviewLayout;
23
+ return makeOverviewTickLabels({
24
+ block,
25
+ bpPerPx,
26
+ // the bold refName label pinned at the block's left edge takes precedence
27
+ refNameLabelPx: showRefName ? overviewRefNameLabelWidth(refName) : 0,
28
+ }).map(({ genomicCoord, offsetPx, label }) => (_jsx(Typography, { className: classes.scalebarLabel, style: {
29
+ transform: `translateX(${offsetPx}px)`,
32
30
  color: refNameColor,
33
- }, children: getTickDisplayStr(tickLabel, overview.bpPerPx) }, `${JSON.stringify(block)}-${tickLabel}-${labelIdx}`)));
31
+ }, children: label }, genomicCoord)));
34
32
  });
35
33
  export default OverviewScalebarTickLabels;
@@ -0,0 +1,7 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ type LGV = LinearGenomeViewModel;
3
+ declare const PaddingBlocks: ({ model, offset, }: {
4
+ model: LGV;
5
+ offset?: number;
6
+ }) => import("react").JSX.Element | null;
7
+ export default PaddingBlocks;
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cx, makeStyles } from '@jbrowse/core/util/tss-react';
3
+ import { observer } from 'mobx-react';
4
+ import ZoomTransform from './ZoomTransform.js';
5
+ import { elidedBlockStyles } from './util.js';
6
+ const useStyles = makeStyles()(theme => ({
7
+ absoluteFill: {
8
+ position: 'absolute',
9
+ width: '100%',
10
+ height: '100%',
11
+ },
12
+ block: {
13
+ position: 'absolute',
14
+ height: '100%',
15
+ },
16
+ boundaryBlock: {
17
+ background: theme.palette.action.disabledBackground,
18
+ },
19
+ regionSeparator: {
20
+ // opaque (not text.disabled, which is translucent): regions are now laid
21
+ // out contiguously so the separator paints directly over track data on both
22
+ // sides. A translucent fill would tint the data instead of masking it, and
23
+ // would darken unevenly where the container-level and per-track
24
+ // PaddingBlocks overlap. An opaque grey masks cleanly and stays seamless.
25
+ background: theme.palette.mode === 'dark'
26
+ ? theme.palette.grey[500]
27
+ : theme.palette.grey[600],
28
+ },
29
+ elided: {
30
+ ...elidedBlockStyles,
31
+ },
32
+ }));
33
+ // Inter-region padding, elided, and boundary blocks plus region separators.
34
+ // In TracksContainer: renders before children (masks gridlines in inter-track
35
+ // margins at inter-region positions; TrackContainers paint on top).
36
+ // In TrackContainer: renders after TrackRenderingContainer within the Paper
37
+ // stacking context, masking the track canvas at inter-region positions while
38
+ // TrackLabel (zIndex:200) remains above it.
39
+ const PaddingBlocks = observer(function PaddingBlocks({ model, offset = 0, }) {
40
+ const { classes } = useStyles();
41
+ // the geometry is `model.paddingSpans` -- shared with any host drawing this
42
+ // itself, so a seam here and a seam in an embedder's own chrome can't be
43
+ // computed two different ways. This file owns only what the spans look like.
44
+ const spans = model.paddingSpans;
45
+ // Nothing to mask, so no positioned container to hold it — the common case,
46
+ // since a view sitting inside one contig has no seam, elision or boundary.
47
+ // The wrapper is not free: `ZoomTransform` reads `staticBlocks`, so an empty
48
+ // one still re-rendered and rewrote its transform on every gesture frame, per
49
+ // track. The view returns one shared array here, so this bails without even
50
+ // re-rendering.
51
+ if (spans.length === 0) {
52
+ return null;
53
+ }
54
+ const kindClass = {
55
+ seam: classes.regionSeparator,
56
+ elided: classes.elided,
57
+ boundary: classes.boundaryBlock,
58
+ };
59
+ return (_jsx(ZoomTransform, { model: model, offset: offset, children: _jsx("div", { className: classes.absoluteFill, children: spans.map(({ x, width, kind }, i) => (_jsx("div", { className: cx(classes.block, kindClass[kind]), style: { transform: `translateX(${x}px)`, width } }, i))) }) }));
60
+ });
61
+ export default PaddingBlocks;
@@ -0,0 +1,9 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ import type { useRangeSelect } from './useRangeSelect.ts';
3
+ type LGV = LinearGenomeViewModel;
4
+ declare const RangeSelectOverlay: ({ model, range, menuOffsetX, }: {
5
+ model: LGV;
6
+ range: ReturnType<typeof useRangeSelect>;
7
+ menuOffsetX?: number;
8
+ }) => import("react").JSX.Element;
9
+ export default RangeSelectOverlay;
@@ -0,0 +1,20 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense, lazy } from 'react';
3
+ import { Menu } from '@jbrowse/core/ui';
4
+ import { getBpDisplayStr, stringify } from '@jbrowse/core/util';
5
+ import { observer } from 'mobx-react';
6
+ import { stickyChromeTops } from '../stickyChrome.js';
7
+ import VerticalGuide from './VerticalGuide.js';
8
+ const RubberbandSpan = lazy(() => import('../../shared/RubberbandSpan.js'));
9
+ const RangeSelectOverlay = observer(function RangeSelectOverlay({ model, range, menuOffsetX = 0, }) {
10
+ const { stickyViewHeaders, headerHeight, isScalebarRefNameMenuOpen } = model;
11
+ const { scalebar } = stickyChromeTops({ stickyViewHeaders, headerHeight });
12
+ const { guideX, rubberbandOn, rubberband, anchorPosition, open, isClick, clickBpOffset, handleMenuItemClick, handleClose, } = range;
13
+ return (_jsxs(_Fragment, { children: [guideX !== undefined && !isScalebarRefNameMenuOpen ? (_jsx(VerticalGuide, { model: model, coordX: guideX })) : rubberbandOn && rubberband ? (_jsx(Suspense, { fallback: null, children: _jsx(RubberbandSpan, { left: rubberband.left, width: rubberband.width, viewWidth: model.width, stickyTop: scalebar, leftLabel: stringify(rubberband.leftBpOffset), rightLabel: stringify(rubberband.rightBpOffset), size: getBpDisplayStr(rubberband.numOfBpSelected) }) })) : null, anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
14
+ left: anchorPosition.clientX + menuOffsetX,
15
+ top: anchorPosition.clientY,
16
+ }, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: isClick && clickBpOffset
17
+ ? model.rubberbandClickMenuItems(clickBpOffset)
18
+ : model.rubberBandMenuItems() })) : null] }));
19
+ });
20
+ export default RangeSelectOverlay;
@@ -1,6 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../model.ts';
2
- declare const RegionWidthEditorDialog: ({ model, handleClose, }: {
2
+ export default function RegionWidthEditorDialog({ model, handleClose, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  handleClose: () => void;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default RegionWidthEditorDialog;
5
+ }): import("react").JSX.Element;
@@ -1,30 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { Dialog } from '@jbrowse/core/ui';
4
- import { toLocale } from '@jbrowse/core/util';
5
- import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
6
- import { observer } from 'mobx-react';
2
+ import { useState } from 'react';
3
+ import { SubmitDialog } from '@jbrowse/core/ui';
4
+ import { parseBpString, toLocale } from '@jbrowse/core/util';
5
+ import { TextField, Typography } from '@mui/material';
7
6
  function format(n) {
8
7
  return toLocale(Math.floor(n));
9
8
  }
10
- const RegionWidthEditorDialog = observer(function RegionWidthEditorDialog({ model, handleClose, }) {
11
- const { bpPerPx, width } = model;
12
- const [val, setVal] = useState(format(bpPerPx * width));
13
- useEffect(() => {
14
- setVal(format(bpPerPx * width));
15
- }, [bpPerPx, width]);
16
- const val2 = val.replace(/,/g, '');
17
- return (_jsxs(Dialog, { title: "Edit zoom level", open: true, onClose: handleClose, children: [_jsxs(DialogContent, { style: {
18
- display: 'flex',
19
- flexDirection: 'column',
20
- gap: 30,
21
- }, children: [_jsx(Typography, { children: "Enter a specific number of base pairs to change the viewport to show. This is approximate and does not account for padding between regions or off-screen scrolling" }), _jsx(TextField, { helperText: "current zoom level (in bp)", value: val, onChange: event => {
22
- setVal(event.target.value);
23
- } })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
24
- handleClose();
25
- }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", onClick: () => {
26
- model.zoomTo(+val2 / model.width);
27
- handleClose();
28
- }, children: "Submit" })] })] }));
29
- });
30
- export default RegionWidthEditorDialog;
9
+ // not an observer: the initial value is seeded once and the field is
10
+ // user-edited thereafter, so it shouldn't reactively reset if bpPerPx changes
11
+ export default function RegionWidthEditorDialog({ model, handleClose, }) {
12
+ const [val, setVal] = useState(() => format(model.bpPerPx * model.width));
13
+ const bp = parseBpString(val);
14
+ const valid = bp !== undefined && bp > 0;
15
+ return (_jsx(SubmitDialog, { open: true, maxWidth: "xs", fullWidth: true, title: "Edit zoom level", onCancel: handleClose, submitDisabled: !valid, onSubmit: () => {
16
+ if (valid) {
17
+ model.zoomTo(bp / model.width);
18
+ }
19
+ handleClose();
20
+ }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 30 }, children: [_jsx(Typography, { children: "Enter a specific number of base pairs to change the viewport to show, either in full or abbreviated as e.g. 500kb or 1.5Mbp. This is approximate and does not account for padding between regions or off-screen scrolling" }), _jsx(TextField, { label: "Zoom level (bp)", autoFocus: true, fullWidth: true, variant: "outlined", value: val, onChange: event => {
21
+ setVal(event.target.value);
22
+ } })] }) }));
23
+ }
@@ -3,5 +3,5 @@ type LGV = LinearGenomeViewModel;
3
3
  declare const Rubberband: ({ model, ControlComponent, }: {
4
4
  model: LGV;
5
5
  ControlComponent?: React.ReactElement;
6
- }) => import("react/jsx-runtime").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
7
  export default Rubberband;
@@ -1,11 +1,10 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef } from 'react';
3
- import { Menu } from '@jbrowse/core/ui';
4
3
  import { makeStyles } from '@jbrowse/core/util/tss-react';
5
4
  import { observer } from 'mobx-react';
6
- import RubberbandSpan from "./RubberbandSpan.js";
7
- import VerticalGuide from "./VerticalGuide.js";
8
- import { useRangeSelect } from "./useRangeSelect.js";
5
+ import { stickyChromeTops } from '../stickyChrome.js';
6
+ import RangeSelectOverlay from './RangeSelectOverlay.js';
7
+ import { useRangeSelect } from './useRangeSelect.js';
9
8
  const useStyles = makeStyles()({
10
9
  rubberbandControl: {
11
10
  cursor: 'crosshair',
@@ -17,16 +16,14 @@ const useStyles = makeStyles()({
17
16
  const Rubberband = observer(function Rubberband({ model, ControlComponent = _jsx("div", {}), }) {
18
17
  const ref = useRef(null);
19
18
  const { classes } = useStyles();
20
- const { stickyViewHeaders, rubberbandTop, isScalebarRefNameMenuOpen } = model;
21
- const { guideX, rubberbandOn, leftBpOffset, rightBpOffset, numOfBpSelected, width, left, anchorPosition, open, isClick, clickBpOffset, handleMenuItemClick, handleClose, mouseMove, mouseDown, mouseOut, } = useRangeSelect(ref, model);
22
- return (_jsxs(_Fragment, { children: [guideX !== undefined && !isScalebarRefNameMenuOpen ? (_jsx(VerticalGuide, { model: model, coordX: guideX })) : rubberbandOn ? (_jsx(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, numOfBpSelected: numOfBpSelected, width: width, left: left, top: rubberbandTop, sticky: stickyViewHeaders })) : null, anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
23
- left: anchorPosition.clientX + 10,
24
- top: anchorPosition.clientY,
25
- }, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: isClick && clickBpOffset
26
- ? model.rubberbandClickMenuItems(clickBpOffset)
27
- : model.rubberBandMenuItems() })) : null, _jsx("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, style: {
28
- top: rubberbandTop,
29
- position: stickyViewHeaders ? 'sticky' : undefined,
30
- }, ref: ref, onMouseDown: mouseDown, onMouseMove: mouseMove, onMouseOut: mouseOut, children: ControlComponent })] }));
19
+ const { stickyViewHeaders, headerHeight } = model;
20
+ const { scalebar } = stickyChromeTops({ stickyViewHeaders, headerHeight });
21
+ const range = useRangeSelect(ref, model);
22
+ return (_jsxs(_Fragment, { children: [_jsx(RangeSelectOverlay, { model: model, range: range, menuOffsetX: 10 }), _jsx("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, style: scalebar ? { top: scalebar, position: 'sticky' } : undefined, ref: ref, onMouseDown: range.mouseDown, onMouseMove: range.mouseMove,
23
+ // mouseleave, not mouseout, matching the other useRangeSelect instance
24
+ // (TracksContainer): mouseout bubbles from every child, so crossing a
25
+ // refName or coordinate label inside the scalebar cleared the guide and
26
+ // the next mousemove put it straight back
27
+ onMouseLeave: range.mouseOut, children: ControlComponent })] }));
31
28
  });
32
29
  export default Rubberband;
@@ -0,0 +1,10 @@
1
+ export default function SVGHighlightBand({ coords, height, color, label, labelColor, }: {
2
+ coords: {
3
+ left: number;
4
+ width: number;
5
+ };
6
+ height: number;
7
+ color: string;
8
+ label?: string;
9
+ labelColor: string;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getFillProps } from '@jbrowse/core/util';
3
+ // One full-height SVG highlight band with an optional label at the top,
4
+ // mirroring the on-screen HighlightBand div. Shared by the LGV native-highlight
5
+ // export (SVGHighlights) and the grid-bookmark export (LGVHighlightSVG). The
6
+ // label is hidden on bands too narrow to fit it.
7
+ export default function SVGHighlightBand({ coords, height, color, label, labelColor, }) {
8
+ return (_jsxs(_Fragment, { children: [_jsx("rect", { x: coords.left, y: 0, width: coords.width, height: height, ...getFillProps(color) }), label && coords.width > 3 ? (_jsx("text", { x: coords.left + 3, y: 2, fontSize: 11, dominantBaseline: "hanging", ...getFillProps(labelColor), children: label })) : null] }));
9
+ }
@@ -1,10 +1,10 @@
1
- import type React from 'react';
2
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
+ import type React from 'react';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  interface ScalebarProps {
5
5
  model: LGV;
6
6
  style?: React.CSSProperties;
7
7
  className?: string;
8
8
  }
9
- declare const Scalebar: ({ model, style, className, ...other }: ScalebarProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const Scalebar: ({ model, style, className, }: ScalebarProps) => React.JSX.Element;
10
10
  export default Scalebar;
@@ -2,32 +2,27 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cx, makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import { Paper } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
- import Gridlines from "./Gridlines.js";
6
- import ScalebarCoordinateLabels from "./ScalebarCoordinateLabels.js";
7
- import ScalebarRefNameLabels from "./ScalebarRefNameLabels.js";
5
+ import Gridlines from './Gridlines.js';
6
+ import PaddingBlocks from './PaddingBlocks.js';
7
+ import ScalebarCoordinateLabels from './ScalebarCoordinateLabels.js';
8
+ import ScalebarRefNameLabels from './ScalebarRefNameLabels.js';
8
9
  const useStyles = makeStyles()({
10
+ // clip, not hidden: this holds a staticBlocks-width strip of labels, and a
11
+ // scroll container here can be scrolled by the browser (focus,
12
+ // scrollIntoView) with no scrollbar to show it, sliding the coordinates out
13
+ // of register with the tracks. clip cannot be scrolled at all
9
14
  container: {
10
- overflow: 'hidden',
15
+ overflow: 'clip',
11
16
  position: 'relative',
12
17
  },
13
- zoomContainer: {
14
- position: 'relative',
15
- },
16
- scalebar: {
17
- position: 'absolute',
18
- display: 'flex',
19
- pointerEvents: 'none',
20
- },
21
18
  });
22
- const Scalebar = observer(function Scalebar({ model, style, className, ...other }) {
19
+ const Scalebar = observer(function Scalebar({ model, style, className, }) {
23
20
  const { classes } = useStyles();
24
- const { scaleFactor, staticBlocks, offsetPx } = model;
25
- const offsetLeft = Math.round(staticBlocks.offsetPx - offsetPx);
26
- return (_jsxs(Paper, { "data-resizer": "true", className: cx(classes.container, className), variant: "outlined", style: style, ...other, children: [_jsx(Gridlines, { model: model, offset: 1 }), _jsx("div", { className: classes.zoomContainer, style: {
27
- transform: scaleFactor !== 1 ? `scaleX(${scaleFactor})` : undefined,
28
- }, children: _jsx("div", { className: classes.scalebar, style: {
29
- transform: `translateX(${offsetLeft - 1}px)`,
30
- width: staticBlocks.totalWidthPx,
31
- }, children: _jsx(ScalebarCoordinateLabels, { model: model }) }) }), _jsx(ScalebarRefNameLabels, { model: model })] }));
21
+ return (_jsxs(Paper
22
+ // The rubberband owns presses on the scalebar (it wraps this as its
23
+ // ControlComponent), so the view's click-drag pan must not also start one
24
+ // on the paths where the rubberband doesn't stopPropagation — a press with
25
+ // the refName menu already open. See ResizeHandle for the marker contract.
26
+ , { "data-gesture-owner": "true", className: cx(classes.container, className), variant: "outlined", style: style, children: [_jsx(Gridlines, { model: model, offset: 1 }), _jsx(PaddingBlocks, { model: model, offset: 1 }), _jsx(ScalebarCoordinateLabels, { model: model }), _jsx(ScalebarRefNameLabels, { model: model })] }));
32
27
  });
33
28
  export default Scalebar;
@@ -2,5 +2,5 @@ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const ScalebarCoordinateLabels: ({ model, }: {
4
4
  model: LGV;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ }) => import("react").JSX.Element;
6
6
  export default ScalebarCoordinateLabels;
@@ -1,18 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getTickDisplayStr } from '@jbrowse/core/util';
3
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
4
3
  import { observer } from 'mobx-react';
5
- import { makeTicks } from "../util.js";
4
+ import { TICK_LABEL_FONT_SIZE, refNameLabelSpanPx, tickLabelWidth, } from '../util.js';
6
5
  const useStyles = makeStyles()(theme => ({
7
- block: {
8
- position: 'relative',
9
- flexShrink: 0,
10
- overflow: 'hidden',
6
+ // spans the full staticBlocks width; labels are absolutely positioned within
7
+ // it so a label on an internal (~800px) block boundary is no longer clipped.
8
+ // Absolute (with top/left left at their static position, i.e. the top-left of
9
+ // the scalebar Paper) so a strip wider than the viewport adds no flow width
10
+ container: {
11
+ position: 'absolute',
11
12
  height: 13,
12
- },
13
- elidedBlock: {
14
- backgroundColor: '#999',
15
- backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)',
13
+ pointerEvents: 'none',
14
+ // clip rather than hidden so this never becomes a scroll container (see
15
+ // Scalebar)
16
+ overflow: 'clip',
16
17
  },
17
18
  tick: {
18
19
  position: 'absolute',
@@ -21,37 +22,55 @@ const useStyles = makeStyles()(theme => ({
21
22
  justifyContent: 'center',
22
23
  pointerEvents: 'none',
23
24
  },
24
- label: {
25
- fontSize: 11,
25
+ tickLabel: {
26
+ fontSize: TICK_LABEL_FONT_SIZE,
26
27
  zIndex: 1,
27
- background: theme.palette.background.paper,
28
28
  lineHeight: 'normal',
29
29
  pointerEvents: 'none',
30
+ // paper backing so the number stays readable over the gridline behind it
31
+ background: theme.palette.background.paper,
32
+ padding: '0 2px',
30
33
  },
31
34
  }));
32
- function ContentBlockLabels({ block, bpPerPx, }) {
33
- const { classes } = useStyles();
34
- const ticks = makeTicks(block.start, block.end, bpPerPx, true, false);
35
- return (_jsx("div", { className: classes.block, style: { width: block.widthPx }, children: ticks.map(({ type, base }) => {
36
- if (type !== 'major') {
37
- return null;
38
- }
39
- const x = (block.reversed ? block.end - base : base - block.start) / bpPerPx;
40
- return (_jsx("div", { className: classes.tick, style: { left: x }, children: _jsx("div", { className: classes.label, children: getTickDisplayStr(base + 1, bpPerPx) }) }, base));
41
- }) }));
42
- }
43
35
  const ScalebarCoordinateLabels = observer(function ScalebarCoordinateLabels({ model, }) {
44
- const { classes, cx } = useStyles();
45
- const { staticBlocks, bpPerPx } = model;
46
- return (_jsx("div", { style: { display: 'flex' }, children: staticBlocks.map((block, index) => {
47
- const key = `${block.key}-${index}`;
48
- if (block.type === 'ContentBlock') {
49
- return (_jsx(ContentBlockLabels, { block: block, bpPerPx: bpPerPx }, key));
50
- }
51
- else if (block.type === 'ElidedBlock') {
52
- return (_jsx("div", { className: cx(classes.block, classes.elidedBlock), style: { width: block.widthPx } }, key));
53
- }
54
- return (_jsx("div", { className: classes.block, style: { width: block.widthPx } }, key));
36
+ const { classes } = useStyles();
37
+ const { scalebarLabels, staticBlocks, staticBlocksTranslateX } = model;
38
+ // labels are laid out in the staticBlocks frame, which overhangs the
39
+ // viewport; shift it into view (the -1 clears the left track border, as
40
+ // Gridlines/PaddingBlocks do with their `offset` prop). Rounded, unlike
41
+ // ZoomTransform: these children are text, and a fractional offset blurs it.
42
+ const offsetLeft = Math.round(staticBlocksTranslateX);
43
+ // `runRefNameLabelPx` keeps the numbers out from under a refName label at its
44
+ // run's left edge, in this frame, which is what lets scalebarLabels stay
45
+ // stable across a scroll. It cannot reach the label pinned to the VIEWPORT's
46
+ // left edge, whose x is a function of the scroll — and that one is drawn over
47
+ // a run whose own left edge is off screen, so nothing reserved for it. The
48
+ // number underneath came out with its leading digits painted over: "22,000"
49
+ // showing as ",000" reads as a coordinate, just not the right one. Hide it
50
+ // instead, the same call the run-start reservation makes, and hide rather
51
+ // than drop so the node count this list pools stays put.
52
+ //
53
+ // The row's caption chip is the other one: it sits at x=0, outside the block
54
+ // frame for the same reason, and now draws on a plain LGV too whenever the
55
+ // row is flipped.
56
+ const { labels, caption, captionSpanPx } = model.scalebarRefNameLabels;
57
+ const sticky = labels.find(l => l.sticky);
58
+ const covered = [
59
+ ...(sticky ? [refNameLabelSpanPx(sticky)] : []),
60
+ ...(caption === undefined ? [] : [{ left: 0, right: captionSpanPx }]),
61
+ ];
62
+ return (_jsx("div", { className: classes.container, style: {
63
+ width: staticBlocks.totalWidthPx,
64
+ transform: `translateX(${offsetLeft - 1}px)`,
65
+ }, children: scalebarLabels.map(({ x, label }, i) => {
66
+ const halfWidth = tickLabelWidth(label) / 2;
67
+ const centerPx = offsetLeft - 1 + x;
68
+ const hidden = covered.some(span => centerPx - halfWidth < span.right &&
69
+ centerPx + halfWidth > span.left);
70
+ return (_jsx("div", { className: classes.tick, style: {
71
+ transform: `translateX(${x}px)`,
72
+ visibility: hidden ? 'hidden' : undefined,
73
+ }, children: _jsx("div", { className: classes.tickLabel, children: label }) }, i));
55
74
  }) }));
56
75
  });
57
76
  export default ScalebarCoordinateLabels;
@@ -2,5 +2,5 @@ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const ScalebarRefNameLabels: ({ model, }: {
4
4
  model: LGV;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ }) => import("react").JSX.Element;
6
6
  export default ScalebarRefNameLabels;