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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +202 -71
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +265 -120
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +20 -9
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +142 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +8 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +42 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +18 -8
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +38 -52
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +21 -25
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +13 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -6
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +14 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +25 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +87 -83
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +56 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
  81. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
  83. package/esm/LinearGenomeView/components/Rubberband.js +15 -17
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  87. package/esm/LinearGenomeView/components/Scalebar.js +20 -22
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +61 -68
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
  147. package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
  148. package/esm/LinearGenomeView/components/util.d.ts +24 -6
  149. package/esm/LinearGenomeView/components/util.js +28 -5
  150. package/esm/LinearGenomeView/consts.d.ts +9 -2
  151. package/esm/LinearGenomeView/consts.js +20 -2
  152. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  153. package/esm/LinearGenomeView/containingLgv.js +23 -0
  154. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  155. package/esm/LinearGenomeView/flyTo.js +135 -0
  156. package/esm/LinearGenomeView/headerFit.d.ts +29 -0
  157. package/esm/LinearGenomeView/headerFit.js +72 -0
  158. package/esm/LinearGenomeView/index.d.ts +28 -3
  159. package/esm/LinearGenomeView/index.js +13 -7
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +25 -1
  162. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  163. package/esm/LinearGenomeView/launchKeys.js +27 -0
  164. package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
  165. package/esm/LinearGenomeView/lazyDialogs.js +4 -3
  166. package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
  167. package/esm/LinearGenomeView/linkedViewSync.js +36 -0
  168. package/esm/LinearGenomeView/menuItems.d.ts +25 -2
  169. package/esm/LinearGenomeView/menuItems.js +306 -179
  170. package/esm/LinearGenomeView/model.d.ts +3363 -164
  171. package/esm/LinearGenomeView/model.js +2548 -565
  172. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  173. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  174. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  175. package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
  176. package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
  177. package/esm/LinearGenomeView/stickyChrome.js +26 -0
  178. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  179. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
  180. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
  181. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  185. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  186. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  187. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
  188. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  189. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
  190. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  191. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
  192. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  193. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
  194. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  195. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
  197. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  198. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  199. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
  200. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
  201. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
  202. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  203. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  204. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  205. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  206. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  207. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  208. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  209. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
  210. package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
  211. package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
  212. package/esm/LinearGenomeView/types.d.ts +20 -37
  213. package/esm/LinearGenomeView/types.js +1 -0
  214. package/esm/LinearGenomeView/util.d.ts +347 -12
  215. package/esm/LinearGenomeView/util.js +577 -62
  216. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  217. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
  218. package/esm/MultiLevelRubberband/index.d.ts +4 -0
  219. package/esm/MultiLevelRubberband/index.js +3 -0
  220. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  221. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  222. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  223. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  224. package/esm/MultiLevelRubberband/types.d.ts +7 -0
  225. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
  226. package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
  227. package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
  228. package/esm/displayKitTests/perRegionTestEnv.js +142 -0
  229. package/esm/index.d.ts +50 -1245
  230. package/esm/index.js +88 -33
  231. package/esm/searchUtils.d.ts +62 -12
  232. package/esm/searchUtils.js +335 -48
  233. package/esm/shared/RubberbandSpan.d.ts +15 -0
  234. package/esm/shared/RubberbandSpan.js +34 -0
  235. package/esm/shared/coordLabels.d.ts +47 -0
  236. package/esm/shared/coordLabels.js +133 -0
  237. package/esm/shared/useWindowDrag.d.ts +18 -0
  238. package/esm/shared/useWindowDrag.js +45 -0
  239. package/package.json +18 -19
  240. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  241. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  242. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  243. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  244. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  245. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  246. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  247. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  248. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  249. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  250. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  251. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  252. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  253. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  254. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  255. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  256. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  257. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  258. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  260. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  261. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  262. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  263. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  264. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  265. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  266. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  267. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  268. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  269. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  270. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  271. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  272. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  273. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  274. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  275. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  276. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  277. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  278. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  279. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  280. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  281. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  282. package/esm/BaseLinearDisplay/components/util.js +0 -107
  283. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  284. package/esm/BaseLinearDisplay/index.js +0 -13
  285. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  286. package/esm/BaseLinearDisplay/model.js +0 -432
  287. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  288. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  289. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  290. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  291. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  292. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  293. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  294. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  295. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  296. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  297. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  298. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  299. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  300. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  301. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  302. package/esm/BaseLinearDisplay/models/util.js +0 -43
  303. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  304. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  305. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  306. package/esm/BaseLinearDisplay/types.js +0 -3
  307. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  308. package/esm/BaseLinearDisplay/util.js +0 -71
  309. package/esm/BasicTrack/configSchema.d.ts +0 -85
  310. package/esm/BasicTrack/configSchema.js +0 -8
  311. package/esm/BasicTrack/index.d.ts +0 -2
  312. package/esm/BasicTrack/index.js +0 -12
  313. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  314. package/esm/LinearBareDisplay/configSchema.js +0 -11
  315. package/esm/LinearBareDisplay/index.d.ts +0 -4
  316. package/esm/LinearBareDisplay/index.js +0 -20
  317. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  318. package/esm/LinearBareDisplay/model.js +0 -32
  319. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  320. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  321. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  322. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  323. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  324. package/esm/LinearBasicDisplay/index.js +0 -20
  325. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  326. package/esm/LinearBasicDisplay/model.js +0 -158
  327. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  328. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  329. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  330. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  331. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  332. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  333. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  334. package/esm/LinearFeatureDisplay/index.js +0 -2
  335. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  336. package/esm/LinearFeatureDisplay/model.js +0 -305
  337. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  338. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  339. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  340. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  345. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  346. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  347. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  348. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  349. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  350. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  351. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  352. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  353. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  354. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  355. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  356. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  357. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  358. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  359. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  360. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  361. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  362. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  363. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -0,0 +1,18 @@
1
+ import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
2
+ /**
3
+ * A container's zoom-out ceiling for the rows it stacks. Unanswered is its own
4
+ * state rather than a zero: a row that has not been laid out yet cannot supply
5
+ * a fit, and reading that as "no shared ceiling" is a different claim. See
6
+ * `LinearSyntenyView/sharedFit.ts`.
7
+ */
8
+ export type SharedFit = {
9
+ answered: false;
10
+ } | {
11
+ answered: true;
12
+ bpPerPx: number;
13
+ };
14
+ export interface SharedScaleContainer {
15
+ sharedFit: SharedFit;
16
+ }
17
+ export declare function isSharedScaleContainer(thing: unknown): thing is SharedScaleContainer;
18
+ export declare function sharedScaleContainerOf(node: IAnyStateTreeNode): SharedScaleContainer | undefined;
@@ -0,0 +1,17 @@
1
+ import { getParent, hasParent, isAlive } from '@jbrowse/mobx-state-tree';
2
+ export function isSharedScaleContainer(thing) {
3
+ return typeof thing === 'object' && thing !== null && 'sharedFit' in thing;
4
+ }
5
+ // Walks rather than using findParentThatIs because having no such container is
6
+ // the ordinary standalone case here, not the error that helper reports.
7
+ export function sharedScaleContainerOf(node) {
8
+ let current = node;
9
+ let found;
10
+ while (!found && hasParent(current) && isAlive(current)) {
11
+ current = getParent(current);
12
+ if (isSharedScaleContainer(current)) {
13
+ found = current;
14
+ }
15
+ }
16
+ return found;
17
+ }
@@ -0,0 +1,35 @@
1
+ import type { LinearGenomeViewModel } from './model.ts';
2
+ import type { Region } from '@jbrowse/core/util/types';
3
+ /**
4
+ * Replace a view's displayed regions with a set someone asked for, frame them,
5
+ * and offer an Undo that puts the view back exactly as it was.
6
+ *
7
+ * This is the "navigate the view you are looking at" half of a launcher, as
8
+ * against `session.addView`, which opens a second one. Two features do it —
9
+ * plugin-canvas's collapsed introns and plugin-alignments' "view mate region" —
10
+ * and both had their own copy of the same fifteen lines, including the same two
11
+ * decisions worth stating once:
12
+ *
13
+ * - **`fitAllRegions`, not `showAllRegions`.** The caller named the regions it
14
+ * wants, so it gets the width. `showAllRegions` goes to the zoom-out LIMIT,
15
+ * whose 10% margin is a framing choice for "show me everything" and dead frame
16
+ * here — and both of these callers already padded their regions by the context
17
+ * they wanted, so a second margin is one nothing asked for.
18
+ * - **The captured viewport is a bp WINDOW, not a pixel pair.** A capture and its
19
+ * Undo can be a window resize apart, and pixels mean nothing without the width
20
+ * they were measured at. Both copies captured `{bpPerPx, offsetPx}` and
21
+ * restored through `setNewView`, so undoing after a resize landed somewhere
22
+ * else. `displayedRegions` rides along by reference: it is a `types.frozen`,
23
+ * so the array is already immutable and `getSnapshot` would refuse it anyway.
24
+ *
25
+ * `alsoUndo` is for state the caller changed that is not the view's location —
26
+ * the collapsed-intron launch isolates the track to one gene, and an Undo that
27
+ * restored the regions and left the isolation on would be a worse lie than not
28
+ * offering one.
29
+ */
30
+ export declare function showRegionsWithUndo({ view, regions, message, alsoUndo, }: {
31
+ view: LinearGenomeViewModel;
32
+ regions: Region[];
33
+ message: string;
34
+ alsoUndo?: () => void;
35
+ }): void;
@@ -0,0 +1,50 @@
1
+ import { getNotificationSink } from '@jbrowse/core/util';
2
+ import { transaction } from 'mobx';
3
+ /**
4
+ * Replace a view's displayed regions with a set someone asked for, frame them,
5
+ * and offer an Undo that puts the view back exactly as it was.
6
+ *
7
+ * This is the "navigate the view you are looking at" half of a launcher, as
8
+ * against `session.addView`, which opens a second one. Two features do it —
9
+ * plugin-canvas's collapsed introns and plugin-alignments' "view mate region" —
10
+ * and both had their own copy of the same fifteen lines, including the same two
11
+ * decisions worth stating once:
12
+ *
13
+ * - **`fitAllRegions`, not `showAllRegions`.** The caller named the regions it
14
+ * wants, so it gets the width. `showAllRegions` goes to the zoom-out LIMIT,
15
+ * whose 10% margin is a framing choice for "show me everything" and dead frame
16
+ * here — and both of these callers already padded their regions by the context
17
+ * they wanted, so a second margin is one nothing asked for.
18
+ * - **The captured viewport is a bp WINDOW, not a pixel pair.** A capture and its
19
+ * Undo can be a window resize apart, and pixels mean nothing without the width
20
+ * they were measured at. Both copies captured `{bpPerPx, offsetPx}` and
21
+ * restored through `setNewView`, so undoing after a resize landed somewhere
22
+ * else. `displayedRegions` rides along by reference: it is a `types.frozen`,
23
+ * so the array is already immutable and `getSnapshot` would refuse it anyway.
24
+ *
25
+ * `alsoUndo` is for state the caller changed that is not the view's location —
26
+ * the collapsed-intron launch isolates the track to one gene, and an Undo that
27
+ * restored the regions and left the isolation on would be a worse lie than not
28
+ * offering one.
29
+ */
30
+ export function showRegionsWithUndo({ view, regions, message, alsoUndo, }) {
31
+ const previous = {
32
+ displayedRegions: view.displayedRegions,
33
+ windowWidthBp: view.windowWidthBp,
34
+ windowStartBp: view.windowStartBp,
35
+ };
36
+ // two root actions in one transaction: `fitAllRegions` reads as the reader's
37
+ // own gesture to a synteny follow, which `showRegions` does not
38
+ transaction(() => {
39
+ view.setDisplayedRegions(regions);
40
+ view.fitAllRegions();
41
+ });
42
+ getNotificationSink(view).notify(message, 'info', {
43
+ name: 'Undo',
44
+ onClick: () => {
45
+ view.setDisplayedRegions(previous.displayedRegions);
46
+ view.setWindow(previous.windowWidthBp, previous.windowStartBp);
47
+ alsoUndo?.();
48
+ },
49
+ });
50
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Where the sticky boxes below the view's chrome pin, as CSS rather than as a
3
+ * pixel sum. Both boxes above are minimum-height, since pinning them to their
4
+ * constants clipped their content at a larger root font size, and one of them
5
+ * is briefly absent during a slow load, so a sum of their constants is only
6
+ * nominal. Anything positioning against them reads what they publish and keeps
7
+ * the constant only as the fallback for the first frame.
8
+ */
9
+ export declare function stickyChromeTops({ stickyViewHeaders, headerHeight, }: {
10
+ stickyViewHeaders: boolean;
11
+ headerHeight: number;
12
+ }): {
13
+ scalebar: string | undefined;
14
+ pinnedTracks: string;
15
+ };
@@ -0,0 +1,26 @@
1
+ import { VIEW_HEADER_HEIGHT } from '@jbrowse/core/ui';
2
+ import { LGV_HEADER_HEIGHT_VAR, VIEW_HEADER_HEIGHT_VAR, } from '@jbrowse/core/util/hooks';
3
+ import { SCALE_BAR_HEIGHT } from './consts.js';
4
+ /**
5
+ * Where the sticky boxes below the view's chrome pin, as CSS rather than as a
6
+ * pixel sum. Both boxes above are minimum-height, since pinning them to their
7
+ * constants clipped their content at a larger root font size, and one of them
8
+ * is briefly absent during a slow load, so a sum of their constants is only
9
+ * nominal. Anything positioning against them reads what they publish and keeps
10
+ * the constant only as the fallback for the first frame.
11
+ */
12
+ export function stickyChromeTops({ stickyViewHeaders, headerHeight, }) {
13
+ // `scalebar` is undefined rather than 0 when the chrome does not pin: its
14
+ // readers use that to stay in flow. A pinned *track* block pins either way —
15
+ // pinning tracks is its own feature — so it always has a top, and with no
16
+ // chrome above it that top is the container's own edge.
17
+ const scalebar = stickyViewHeaders
18
+ ? `calc(var(${VIEW_HEADER_HEIGHT_VAR}, ${VIEW_HEADER_HEIGHT}px) + var(${LGV_HEADER_HEIGHT_VAR}, ${headerHeight}px))`
19
+ : undefined;
20
+ return {
21
+ scalebar,
22
+ pinnedTracks: scalebar
23
+ ? `calc(${scalebar} + ${SCALE_BAR_HEIGHT}px)`
24
+ : '0px',
25
+ };
26
+ }
@@ -3,5 +3,5 @@ type LGV = LinearGenomeViewModel;
3
3
  export default function SVGGridlines({ model, height, }: {
4
4
  model: LGV;
5
5
  height: number;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): import("react").JSX.Element;
7
7
  export {};
@@ -1,20 +1,19 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { stripAlpha } from '@jbrowse/core/util';
3
- import { useTheme } from '@mui/material';
4
- import { makeTicks } from "../util.js";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
3
+ import { svgNodeId } from '@jbrowse/core/svg/svgId';
4
+ import { usePalette } from '@jbrowse/core/ui/PaletteContext';
5
+ import { getStrokeProps } from '@jbrowse/core/util';
6
+ import { gridlineTickXs, vlinePath } from './util.js';
5
7
  export default function SVGGridlines({ model, height, }) {
6
- const { dynamicBlocks: { contentBlocks }, offsetPx: viewOffsetPx, bpPerPx, } = model;
7
- const theme = useTheme();
8
- const c = stripAlpha(theme.palette.divider);
9
- return (_jsx(_Fragment, { children: contentBlocks.map(block => {
10
- const { start, end, key, reversed, offsetPx, widthPx } = block;
11
- const offset = offsetPx - viewOffsetPx;
12
- const ticks = makeTicks(start, end, bpPerPx, true, true);
13
- const clipid = `gridline-clip-${key}`;
14
- return (_jsxs("g", { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: widthPx, height: height }) }) }), _jsx("g", { transform: `translate(${offset} 0)`, clipPath: `url(#${clipid})`, children: ticks.map(tick => {
15
- const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
16
- const isMajor = tick.type === 'major';
17
- return (_jsx("line", { x1: x, x2: x, y1: 0, y2: height, strokeWidth: 1, stroke: c, strokeOpacity: isMajor ? 0.3 : 0.15 }, `gridline-${tick.base}`));
18
- }) })] }, key));
19
- }) }));
8
+ const { width } = model;
9
+ const palette = usePalette();
10
+ // share the on-screen gridline colors; getStrokeProps splits the rgba alpha
11
+ // into strokeOpacity so the exported SVG stays renderer-safe
12
+ const minorProps = getStrokeProps(palette.gridlineMinor);
13
+ const majorProps = getStrokeProps(palette.gridlineMajor);
14
+ const { major, minor } = gridlineTickXs(model);
15
+ // gridlineTicks spans the whole staticBlocks frame, which overhangs the
16
+ // viewport on both sides, so clip to the view width rather than letting ticks
17
+ // bleed into the export margin
18
+ return (_jsxs(SvgClipRect, { id: `gridline-clip-${svgNodeId(model)}`, width: width, height: height, children: [_jsx("path", { d: vlinePath(minor, 0, height), strokeWidth: 1, fill: "none", ...minorProps }), _jsx("path", { d: vlinePath(major, 0, height), strokeWidth: 1, fill: "none", ...majorProps })] }));
20
19
  }
@@ -1,7 +1,9 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }: {
2
+ import type { HeaderLayout } from './util.ts';
3
+ export default function SVGHeader({ model, fontSize, rulerHeight, layout, showCytobands, }: {
3
4
  model: LinearGenomeViewModel;
4
5
  rulerHeight: number;
5
6
  fontSize: number;
6
- cytobandHeight: number;
7
- }): import("react/jsx-runtime").JSX.Element | null;
7
+ layout: HeaderLayout;
8
+ showCytobands: boolean;
9
+ }): import("react").JSX.Element | null;
@@ -1,41 +1,40 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { usePalette } from '@jbrowse/core/ui/PaletteContext';
2
3
  import { getSession, stripAlpha } from '@jbrowse/core/util';
3
- import Base1DView from '@jbrowse/core/util/Base1DViewModel';
4
- import { useTheme } from '@mui/material';
5
- import SVGRuler from "./SVGRuler.js";
6
- import SVGScalebar from "./SVGScalebar.js";
7
- import Cytobands from "../components/Cytobands.js";
8
- import OverviewScalebarPolygon from "../components/OverviewScalebarPolygon.js";
9
- import { HEADER_OVERVIEW_HEIGHT } from "../consts.js";
10
- export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }) {
11
- const { width, assemblyNames, showCytobands, displayedRegions } = model;
12
- const { assemblyManager } = getSession(model);
13
- const assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
14
- const assembly = assemblyManager.get(assemblyName);
15
- const theme = useTheme();
16
- const c = stripAlpha(theme.palette.text.primary);
17
- const overview = Base1DView.create({
18
- displayedRegions: JSON.parse(JSON.stringify(displayedRegions)),
19
- interRegionPaddingWidth: 0,
20
- minimumBlockWidth: model.minimumBlockWidth,
4
+ import { createOverviewLayout, getOverviewRegionPxSpan, } from '@jbrowse/core/util/Base1DUtils';
5
+ import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
6
+ import Cytobands from '../components/Cytobands.js';
7
+ import OverviewScalebarPolygon from '../components/OverviewScalebarPolygon.js';
8
+ import { getCytobands } from '../components/util.js';
9
+ import { HEADER_OVERVIEW_HEIGHT } from '../consts.js';
10
+ import SVGRuler from './SVGRuler.js';
11
+ import SVGScalebar from './SVGScalebar.js';
12
+ // "you are here" cytoband overview rendered above the ruler. Self-contained so
13
+ // the overview-layout work only runs when cytobands are actually shown.
14
+ function CytobandOverview({ model, y, }) {
15
+ const { width, displayedRegions, minimumBlockWidth, bpPerPx } = model;
16
+ const overview = createOverviewLayout({
17
+ displayedRegions,
18
+ width,
19
+ minimumBlockWidth,
21
20
  });
22
- const visibleRegions = model.dynamicBlocks.contentBlocks;
23
- if (!visibleRegions.length) {
21
+ const block = calculateDynamicBlocks(overview).contentBlocks[0];
22
+ // same span the polygon below draws its top edge from, so the rectangle and
23
+ // the trapezoid under it always cover the same regions
24
+ const span = getOverviewRegionPxSpan({
25
+ overview,
26
+ bpPerPx,
27
+ blocks: model.dynamicBlocks.blocks,
28
+ });
29
+ return block && span ? (_jsxs("g", { transform: `translate(0 ${y})`, children: [_jsx(Cytobands, { overview: overview, cytobands: getCytobands(getSession(model).assemblyManager.get(block.assemblyName), block.refName), block: block }), _jsx("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(span.rightPx - span.leftPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: span.leftPx, y: 0.5 }), _jsx("g", { transform: `translate(0,${HEADER_OVERVIEW_HEIGHT})`, children: _jsx(OverviewScalebarPolygon, { overview: overview, model: model, exportSvg: true }) })] })) : null;
30
+ }
31
+ export default function SVGHeader({ model, fontSize, rulerHeight, layout, showCytobands, }) {
32
+ const palette = usePalette();
33
+ const fill = stripAlpha(palette.text.primary);
34
+ // nothing on screen to label: no assembly name, scalebar or ruler
35
+ if (!model.hasVisibleContent) {
24
36
  return null;
25
37
  }
26
- overview.setVolatileWidth(width);
27
- overview.showAllRegions();
28
- const block = overview.dynamicBlocks.contentBlocks[0];
29
- const first = visibleRegions.at(0);
30
- const last = visibleRegions.at(-1);
31
- const firstOverviewPx = overview.bpToPx({
32
- ...first,
33
- coord: first.reversed ? first.end : first.start,
34
- }) || 0;
35
- const lastOverviewPx = overview.bpToPx({
36
- ...last,
37
- coord: last.reversed ? last.start : last.end,
38
- }) || 0;
39
- const y = +showCytobands * cytobandHeight;
40
- return (_jsxs("g", { id: "header", children: [_jsx("text", { x: 0, y: 0, dominantBaseline: "hanging", fontSize: fontSize, fill: c, children: assemblyName }), showCytobands ? (_jsxs("g", { transform: `translate(0 ${rulerHeight})`, children: [_jsx(Cytobands, { overview: overview, assembly: assembly, block: block }), _jsx("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }), _jsx("g", { transform: `translate(0,${HEADER_OVERVIEW_HEIGHT})`, children: _jsx(OverviewScalebarPolygon, { overview: overview, model: model, useOffset: false }) })] })) : null, _jsx("g", { transform: `translate(0 ${fontSize + y})`, children: _jsx(SVGScalebar, { model: model, fontSize: fontSize }) }), _jsx("g", { transform: `translate(0 ${rulerHeight + y})`, children: _jsx(SVGRuler, { model: model, fontSize: fontSize }) })] }));
38
+ const { assemblyLabelBaselineY, cytobandTop, scalebarLineY, rulerTop } = layout;
39
+ return (_jsxs("g", { id: "header", children: [_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: fill, children: model.assemblyNames.join(', ') }), showCytobands ? (_jsx(CytobandOverview, { model: model, y: cytobandTop })) : null, _jsx("g", { transform: `translate(0 ${scalebarLineY})`, children: _jsx(SVGScalebar, { model: model, fontSize: fontSize }) }), _jsx("g", { transform: `translate(0 ${rulerTop})`, children: _jsx(SVGRuler, { model: model, rulerHeight: rulerHeight }) })] }));
41
40
  }
@@ -0,0 +1,5 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ export default function SVGHighlights({ model, height, }: {
3
+ model: LinearGenomeViewModel;
4
+ height: number;
5
+ }): (import("react").JSX.Element | null)[] | null;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useStyleTheme } from '@jbrowse/core/ui/PaletteContext';
3
+ import { getSession } from '@jbrowse/core/util';
4
+ import SVGHighlightBand from '../components/SVGHighlightBand.js';
5
+ import { getHighlightColor, highlightKey } from '../components/util.js';
6
+ // The view's highlights drawn as full-height bands over the tracks area, with
7
+ // an optional label at the top.
8
+ //
9
+ // Deliberately NOT an observer, and that is the whole of what keeps a live
10
+ // figure coherent. `useViewSvgFigure` freezes a figure by memoizing it against
11
+ // its snapshot, which stops a parent render from advancing the drawing — but a
12
+ // `memo` cannot stop an observer inside it from re-rendering itself, and an
13
+ // observer here reads `getHighlightCoords`, i.e. `offsetPx`. A pan then slid the
14
+ // bands across track bodies that were still drawn where the snapshot left them.
15
+ // The file export renders the whole document in one synchronous pass, so it
16
+ // never needed the subscription either.
17
+ export default function SVGHighlights({ model, height, }) {
18
+ const theme = useStyleTheme();
19
+ const session = getSession(model);
20
+ return session.highlightsVisible
21
+ ? model.highlights.map((h, idx) => {
22
+ const coords = model.getHighlightCoords(h);
23
+ return coords ? (_jsx(SVGHighlightBand, { coords: coords, height: height, color: getHighlightColor(h, theme).toRgbString(), label: session.highlightLabelsVisible ? h.label : undefined, labelColor: theme.palette.text.primary }, highlightKey(h, idx))) : null;
24
+ })
25
+ : null;
26
+ }
@@ -0,0 +1,5 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ export default function SVGHighlightsOverlay({ model, tracksHeight, }: {
3
+ model: LinearGenomeViewModel;
4
+ tracksHeight: number;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
3
+ import { svgNodeId } from '@jbrowse/core/svg/svgId';
4
+ import { PluggableElements } from '@jbrowse/core/ui';
5
+ import { getEnv } from '@jbrowse/core/util';
6
+ import SVGHighlights from './SVGHighlights.js';
7
+ // The highlight layer over one view's tracks area: the view's highlights plus
8
+ // whatever plugins contribute, clipped to the view width. Callers translate
9
+ // this to the top-left of the tracks area.
10
+ export default function SVGHighlightsOverlay({ model, tracksHeight, }) {
11
+ const { pluginManager } = getEnv(model);
12
+ return (_jsxs(SvgClipRect, { id: `highlight-clip-${svgNodeId(model)}`, width: model.width, height: tracksHeight, children: [_jsx(SVGHighlights, { model: model, height: tracksHeight }), _jsx(PluggableElements, { pluginManager: pluginManager, name: "LinearGenomeView-HighlightSVGComponent", props: { model, height: tracksHeight } })] }));
13
+ }
@@ -2,6 +2,4 @@ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  import type { ExportSvgOptions } from '../types.ts';
3
3
  type LGV = LinearGenomeViewModel;
4
4
  export declare function renderToSvg(model: LGV, opts: ExportSvgOptions): Promise<string>;
5
- export { default as SVGGridlines } from './SVGGridlines.tsx';
6
- export { default as SVGRuler } from './SVGRuler.tsx';
7
- export { default as SVGTracks } from './SVGTracks.tsx';
5
+ export {};
@@ -1,45 +1,77 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createJBrowseTheme } from '@jbrowse/core/ui';
3
- import { getSession, max, measureText, renderToStaticMarkup, } from '@jbrowse/core/util';
4
- import { getTrackName } from '@jbrowse/core/util/tracks';
5
- import { ThemeProvider } from '@mui/material';
6
- import { when } from 'mobx';
7
- import { isReadyOrHasError } from "../svgExportUtil.js";
8
- import SVGBackground from "./SVGBackground.js";
9
- import SVGGridlines from "./SVGGridlines.js";
10
- import SVGHeader from "./SVGHeader.js";
11
- import SVGTracks from "./SVGTracks.js";
12
- import { totalHeight } from "./util.js";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { exportMargin } from '@jbrowse/core/svg/constants';
3
+ import { awaitViewInitialized } from '@jbrowse/core/svg/svgReady';
4
+ import { notifySkippedSvgTracks } from '@jbrowse/core/svg/trackNames';
5
+ import { wrapSvgExport } from '@jbrowse/core/svg/wrapSvgExport';
6
+ import { getSession } from '@jbrowse/core/util';
7
+ import SVGHeader from './SVGHeader.js';
8
+ import SVGView from './SVGView.js';
9
+ import { renderViewTracks } from './renderViewTracks.js';
10
+ import { defaultTextHeight, getHeaderLayout, trackLabelLeftOffset, } from './util.js';
13
11
  export async function renderToSvg(model, opts) {
14
- await when(() => model.initialized);
15
- const { textHeight = 18, headerHeight = 40, rulerHeight = 50, fontSize = 13, cytobandHeight = 100, trackLabels = 'offset', themeName = 'default', showGridlines = false, Wrapper = ({ children }) => children, } = opts;
12
+ await awaitViewInitialized(model);
13
+ // `initialized` only answers "have the assemblies loaded" — navigating is the
14
+ // second async step, so an initialized view can still hold no regions: one
15
+ // sitting on its import form, or one a `clearView` emptied. There is no
16
+ // ruler, no scalebar and no track content to draw there, and the export used
17
+ // to save the header's reserved height as a blank themed rectangle. Say why
18
+ // instead, which the dialog shows as an error banner and a headless caller
19
+ // (jbrowse-img) gets as a nonzero exit rather than a blank image. Same guard,
20
+ // and the same reason, as the circular view's import-form export.
21
+ if (!model.hasDisplayedRegions) {
22
+ throw new Error('Cannot export: no regions are displayed');
23
+ }
24
+ const { fontSize = 13,
25
+ // the label band scales with the font it holds; destructured after
26
+ // fontSize so the default can read it
27
+ textHeight = defaultTextHeight(fontSize), rulerHeight = 34, trackLabels = 'offset', themeName, fontFamily, showGridlines = false, Wrapper, } = opts;
16
28
  const session = getSession(model);
17
- const { allThemes } = session;
18
- const theme = allThemes?.()[themeName];
19
- const jbrowseTheme = createJBrowseTheme(theme);
20
- const { width, pinnedTracks, unpinnedTracks, tracks, showCytobands } = model;
21
- const shift = 50;
22
- const c = +showCytobands * cytobandHeight;
23
- const offset = headerHeight + rulerHeight + c + 10;
24
- const height = totalHeight(tracks, textHeight, trackLabels) + offset + 100;
25
- const legendWidth = max([...pinnedTracks, ...unpinnedTracks].map(track => {
26
- const display = track.displays[0];
27
- return display?.svgLegendWidth?.(jbrowseTheme) ?? 0;
28
- }), 0);
29
- const displayResults = await Promise.all([...pinnedTracks, ...unpinnedTracks].map(async (track) => {
30
- const display = track.displays[0];
31
- await when(() => isReadyOrHasError(display));
32
- return {
33
- track,
34
- result: await display.renderSvg({ ...opts, theme, legendWidth }),
35
- };
36
- }));
37
- const trackLabelMaxLen = max(tracks.map(t => measureText(getTrackName(t.configuration, session), fontSize)), 0) + 40;
38
- const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
29
+ const theme = session.getActiveThemeOptions?.(themeName);
30
+ // owns the two orderings this used to spell out by hand: legendWidth before
31
+ // the awaits, tracksHeight after them. Every display's `renderSvg` owns its
32
+ // own readiness wait — an LGV display through `renderDisplaySvg`'s
33
+ // `awaitSvgReady`, a non-LGV one (dotplot, synteny, circular) by calling that
34
+ // itself.
35
+ const { tracks, displayResults, tracksHeight, legendWidth, skippedTracks } = await renderViewTracks({
36
+ view: model,
37
+ opts,
38
+ theme,
39
+ textHeight,
40
+ trackLabels,
41
+ // the standalone export is the one with room to give: it widens its
42
+ // canvas below so a legend sits beside the plot rather than over it
43
+ reserveLegendWidth: true,
44
+ });
45
+ notifySkippedSvgTracks(session, skippedTracks);
46
+ // read after the displays' waits, and handed to SVGHeader rather than read
47
+ // again, so the reserved `tracksTop` and the drawn header are one layout
48
+ const { width, effectiveShowCytobands } = model;
49
+ const headerLayout = getHeaderLayout({
50
+ fontSize,
51
+ showCytobands: effectiveShowCytobands,
52
+ rulerHeight,
53
+ });
54
+ const { tracksTop } = headerLayout;
55
+ const trackLabelOffset = trackLabelLeftOffset({
56
+ tracks,
57
+ trackLabels,
58
+ fontSize,
59
+ fontFamily,
60
+ session,
61
+ });
39
62
  const w = width + trackLabelOffset + legendWidth;
40
- const tracksHeight = totalHeight(tracks, textHeight, trackLabels);
41
- return renderToStaticMarkup(_jsx(ThemeProvider, { theme: createJBrowseTheme(theme), children: _jsx(Wrapper, { children: _jsxs("svg", { width: w, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, height].toString(), children: [_jsx(SVGBackground, { width: w, height: height, shift: shift }), _jsxs("g", { transform: `translate(${shift} 0)`, children: [_jsx("g", { transform: `translate(${trackLabelOffset})`, children: _jsx(SVGHeader, { model: model, fontSize: fontSize, rulerHeight: rulerHeight, cytobandHeight: cytobandHeight }) }), showGridlines ? (_jsx("g", { transform: `translate(${trackLabelOffset} ${offset})`, children: _jsx(SVGGridlines, { model: model, height: tracksHeight }) })) : null, _jsx("g", { transform: `translate(0 ${offset})`, children: _jsx(SVGTracks, { textHeight: textHeight, fontSize: fontSize, model: model, displayResults: displayResults, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset }) })] })] }) }) }));
63
+ // the xlink namespace is used for rendering <image> tag
64
+ return wrapSvgExport({
65
+ theme,
66
+ width: w,
67
+ height: tracksTop + tracksHeight + exportMargin,
68
+ fontFamily,
69
+ Wrapper,
70
+ children: (_jsx("g", { transform: `translate(${exportMargin} 0)`, children: _jsx(SVGView, { view: model, displayResults: displayResults,
71
+ // the standalone export is the one with room above the tracks, so its
72
+ // header is the full one: cytoband overview and total-bp scalebar as
73
+ // well as the assembly name and ruler. `tracksTop` is the height
74
+ // getHeaderLayout gave it.
75
+ header: _jsx(SVGHeader, { model: model, fontSize: fontSize, rulerHeight: rulerHeight, layout: headerLayout, showCytobands: effectiveShowCytobands }), fontSize: fontSize, textHeight: textHeight, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset, contentTop: tracksTop, tracksHeight: tracksHeight, showGridlines: showGridlines, leftBuffer: exportMargin, legendWidth: legendWidth }) })),
76
+ });
42
77
  }
43
- export { default as SVGGridlines } from "./SVGGridlines.js";
44
- export { default as SVGRuler } from "./SVGRuler.js";
45
- export { default as SVGTracks } from "./SVGTracks.js";
@@ -3,5 +3,5 @@ type LGV = LinearGenomeViewModel;
3
3
  export default function SVGRegionSeparators({ model, height, }: {
4
4
  height: number;
5
5
  model: LGV;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): import("react").JSX.Element;
7
7
  export {};
@@ -1,5 +1,22 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { usePalette } from '@jbrowse/core/ui/PaletteContext';
3
+ // SVG counterpart of the on-screen PaddingBlocks region separators: an opaque
4
+ // 3px bar at the right edge of every displayed region, in the same per-mode grey
5
+ // (a translucent fill would tint the track data it masks rather than hide it).
6
+ // Keyed off isRightEndOfDisplayedRegion like PaddingBlocks, so the bar at the
7
+ // last region's right edge isn't dropped.
8
+ //
9
+ // The seam is ALL of PaddingBlocks this draws, which is why it walks
10
+ // dynamicBlocks itself rather than reading `model.paddingSpans` like the
11
+ // on-screen component. The other two span kinds are chrome for an interactive
12
+ // row, not information a figure carries: `elided`'s striped grey says "regions
13
+ // here are too narrow to draw", which in a static image is noise, and at
14
+ // whole-genome zoom it is most of the row. Don't put this on paddingSpans to
15
+ // close the "divergence".
2
16
  export default function SVGRegionSeparators({ model, height, }) {
3
- const { dynamicBlocks, offsetPx, interRegionPaddingWidth } = model;
4
- return (_jsx(_Fragment, { children: dynamicBlocks.contentBlocks.slice(1).map(block => (_jsx("rect", { x: block.offsetPx - offsetPx - interRegionPaddingWidth, width: interRegionPaddingWidth, y: 0, height: height, fill: "grey" }, block.key))) }));
17
+ const { dynamicBlocks, offsetPx } = model;
18
+ const fill = usePalette().regionSeparator;
19
+ return (_jsx(_Fragment, { children: dynamicBlocks.contentBlocks
20
+ .filter(block => block.isRightEndOfDisplayedRegion)
21
+ .map(block => (_jsx("rect", { x: block.offsetPx + block.widthPx - offsetPx - 1, width: 3, y: 0, height: height, fill: fill }, block.key))) }));
5
22
  }
@@ -0,0 +1,8 @@
1
+ import type { LinearGenomeViewModel } from '../index.ts';
2
+ export default function SVGRowHeader({ view, fontSize, rulerHeight, showAssemblyName, showScalebar, }: {
3
+ view: LinearGenomeViewModel;
4
+ fontSize: number;
5
+ rulerHeight: number;
6
+ showAssemblyName?: boolean;
7
+ showScalebar?: boolean;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { usePalette } from '@jbrowse/core/ui/PaletteContext';
3
+ import { stripAlpha } from '@jbrowse/core/util';
4
+ import SVGRuler from './SVGRuler.js';
5
+ import SVGScalebar from './SVGScalebar.js';
6
+ import { getRowHeaderLayout } from './util.js';
7
+ // The compact header a *stacked* export gives each of its rows: the assembly
8
+ // name, optionally the total-bp scalebar, and the ruler. The standalone LGV
9
+ // export fills the same slot in SVGView with SVGHeader, which additionally
10
+ // draws the cytoband overview — there is room for that above a single view, and
11
+ // none between two rows of a synteny stack.
12
+ export default function SVGRowHeader({ view, fontSize,
13
+ // SVGStackedRow passes the same value as SVGView's `contentTop`, so the
14
+ // ticks hanging off this budget meet the tracks
15
+ rulerHeight,
16
+ // Whether this row draws its assembly name. Default true, which is what a
17
+ // stack of DIFFERENT assemblies wants — a synteny export names each row
18
+ // because each row is a different genome. A breakpoint split view is usually
19
+ // one assembly seen at several loci, and there the name is the same string
20
+ // printed once per panel, so that caller passes false on every row after the
21
+ // first whose assembly matches the row above it. The reserved band above the
22
+ // ruler is unchanged either way: it is the caller's offset, not this
23
+ // component's.
24
+ showAssemblyName = true,
25
+ // Whether this row draws the capped bar labelled with its span. Off by
26
+ // default, since it costs `getRowHeaderLayout().bandHeight` of the caller's
27
+ // band and every caller has to reserve that much before asking for it. See
28
+ // getRowHeaderLayout for what it is for.
29
+ showScalebar = false, }) {
30
+ const palette = usePalette();
31
+ const { assemblyLabelBaselineY, scalebarLineY } = getRowHeaderLayout({
32
+ fontSize,
33
+ showScalebar,
34
+ });
35
+ return (_jsxs(_Fragment, { children: [showAssemblyName ? (_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: stripAlpha(palette.text.primary), children: view.assemblyNames.join(', ') })) : null, scalebarLineY === undefined ? null : (_jsx("g", { transform: `translate(0 ${scalebarLineY})`, children: _jsx(SVGScalebar, { model: view, fontSize: fontSize }) })), _jsx(SVGRuler, { model: view, rulerHeight: rulerHeight })] }));
36
+ }
@@ -1,7 +1,7 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
- export default function SVGRuler({ model, fontSize, }: {
3
+ export default function SVGRuler({ model, rulerHeight, }: {
4
4
  model: LGV;
5
- fontSize: number;
6
- }): import("react/jsx-runtime").JSX.Element;
5
+ rulerHeight: number;
6
+ }): import("react").JSX.Element;
7
7
  export {};