@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
@@ -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
+ * `LinearComparativeView/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,44 @@
1
+ import { getNotificationSink } from '@jbrowse/core/util';
2
+ /**
3
+ * Replace a view's displayed regions with a set someone asked for, frame them,
4
+ * and offer an Undo that puts the view back exactly as it was.
5
+ *
6
+ * This is the "navigate the view you are looking at" half of a launcher, as
7
+ * against `session.addView`, which opens a second one. Two features do it —
8
+ * plugin-canvas's collapsed introns and plugin-alignments' "view mate region" —
9
+ * and both had their own copy of the same fifteen lines, including the same two
10
+ * decisions worth stating once:
11
+ *
12
+ * - **`fitAllRegions`, not `showAllRegions`.** The caller named the regions it
13
+ * wants, so it gets the width. `showAllRegions` goes to the zoom-out LIMIT,
14
+ * whose 10% margin is a framing choice for "show me everything" and dead frame
15
+ * here — and both of these callers already padded their regions by the context
16
+ * they wanted, so a second margin is one nothing asked for.
17
+ * - **The captured viewport is a bp WINDOW, not a pixel pair.** A capture and its
18
+ * Undo can be a window resize apart, and pixels mean nothing without the width
19
+ * they were measured at. Both copies captured `{bpPerPx, offsetPx}` and
20
+ * restored through `setNewView`, so undoing after a resize landed somewhere
21
+ * else. `displayedRegions` rides along by reference: it is a `types.frozen`,
22
+ * so the array is already immutable and `getSnapshot` would refuse it anyway.
23
+ *
24
+ * `alsoUndo` is for state the caller changed that is not the view's location —
25
+ * the collapsed-intron launch isolates the track to one gene, and an Undo that
26
+ * restored the regions and left the isolation on would be a worse lie than not
27
+ * offering one.
28
+ */
29
+ export function showRegionsWithUndo({ view, regions, message, alsoUndo, }) {
30
+ const previous = {
31
+ displayedRegions: view.displayedRegions,
32
+ windowWidthBp: view.windowWidthBp,
33
+ windowStartBp: view.windowStartBp,
34
+ };
35
+ view.showRegions(regions);
36
+ getNotificationSink(view).notify(message, 'info', {
37
+ name: 'Undo',
38
+ onClick: () => {
39
+ view.setDisplayedRegions(previous.displayedRegions);
40
+ view.setWindow(previous.windowWidthBp, previous.windowStartBp);
41
+ alsoUndo?.();
42
+ },
43
+ });
44
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Where the sticky boxes below the view's chrome pin, as CSS rather than as a
3
+ * pixel sum.
4
+ *
5
+ * The model's `rubberbandTop` / `pinnedTracksTop` answer the same question in
6
+ * numbers, and still have to — `height`, `getTrackYOffset` and the SVG export
7
+ * have no DOM to read. But the numbers are nominal. Both boxes above are now
8
+ * minimum-height, since pinning them to their constants clipped their content
9
+ * at a larger root font size, and one of them is briefly absent during a slow
10
+ * load. Anything positioning against them in the DOM reads what they publish
11
+ * and keeps the constant only as the fallback for the first frame.
12
+ */
13
+ export declare function stickyChromeTops({ stickyViewHeaders, headerHeight, }: {
14
+ stickyViewHeaders: boolean;
15
+ headerHeight: number;
16
+ }): {
17
+ scalebar: string | undefined;
18
+ pinnedTracks: string;
19
+ };
@@ -0,0 +1,30 @@
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.
7
+ *
8
+ * The model's `rubberbandTop` / `pinnedTracksTop` answer the same question in
9
+ * numbers, and still have to — `height`, `getTrackYOffset` and the SVG export
10
+ * have no DOM to read. But the numbers are nominal. Both boxes above are now
11
+ * minimum-height, since pinning them to their constants clipped their content
12
+ * at a larger root font size, and one of them is briefly absent during a slow
13
+ * load. Anything positioning against them in the DOM reads what they publish
14
+ * and keeps the constant only as the fallback for the first frame.
15
+ */
16
+ export function stickyChromeTops({ stickyViewHeaders, headerHeight, }) {
17
+ // `scalebar` is undefined rather than 0 when the chrome does not pin: its
18
+ // readers use that to stay in flow. A pinned *track* block pins either way —
19
+ // pinning tracks is its own feature — so it always has a top, and with no
20
+ // chrome above it that top is the container's own edge.
21
+ const scalebar = stickyViewHeaders
22
+ ? `calc(var(${VIEW_HEADER_HEIGHT_VAR}, ${VIEW_HEADER_HEIGHT}px) + var(${LGV_HEADER_HEIGHT_VAR}, ${headerHeight}px))`
23
+ : undefined;
24
+ return {
25
+ scalebar,
26
+ pinnedTracks: scalebar
27
+ ? `calc(${scalebar} + ${SCALE_BAR_HEIGHT}px)`
28
+ : '0px',
29
+ };
30
+ }
@@ -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';
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 { getStrokeProps } from '@jbrowse/core/util';
3
5
  import { useTheme } from '@mui/material';
4
- import { makeTicks } from "../util.js";
6
+ import { gridlineTickXs, vlinePath } from './util.js';
5
7
  export default function SVGGridlines({ model, height, }) {
6
- const { dynamicBlocks: { contentBlocks }, offsetPx: viewOffsetPx, bpPerPx, } = model;
8
+ const { width } = model;
7
9
  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
- }) }));
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(theme.palette.gridlineMinor);
13
+ const majorProps = getStrokeProps(theme.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,6 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
- export default function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }: {
2
+ export default function SVGHeader({ model, fontSize, rulerHeight, }: {
3
3
  model: LinearGenomeViewModel;
4
4
  rulerHeight: number;
5
5
  fontSize: number;
6
- cytobandHeight: number;
7
- }): import("react/jsx-runtime").JSX.Element | null;
6
+ }): import("react").JSX.Element | null;
@@ -1,41 +1,53 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getSession, stripAlpha } from '@jbrowse/core/util';
3
- import Base1DView from '@jbrowse/core/util/Base1DViewModel';
3
+ import { createOverviewLayout, getOverviewRegionPxSpan, } from '@jbrowse/core/util/Base1DUtils';
4
+ import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
4
5
  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;
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
+ import { getHeaderLayout } from './util.js';
13
+ // "you are here" cytoband overview rendered above the ruler. Self-contained so
14
+ // the overview-layout work only runs when cytobands are actually shown.
15
+ function CytobandOverview({ model, assembly, y, }) {
16
+ const { width, displayedRegions, minimumBlockWidth, bpPerPx } = model;
17
+ const overview = createOverviewLayout({
18
+ displayedRegions,
19
+ width,
20
+ minimumBlockWidth,
21
+ });
22
+ const block = calculateDynamicBlocks(overview).contentBlocks[0];
23
+ // same span the polygon below draws its top edge from, so the rectangle and
24
+ // the trapezoid under it always cover the same regions
25
+ const span = getOverviewRegionPxSpan({
26
+ overview,
27
+ bpPerPx,
28
+ blocks: model.dynamicBlocks.blocks,
29
+ });
30
+ return block && span ? (_jsxs("g", { transform: `translate(0 ${y})`, children: [_jsx(Cytobands, { overview: overview, cytobands: getCytobands(assembly, 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;
31
+ }
32
+ export default function SVGHeader({ model, fontSize, rulerHeight, }) {
33
+ const { assemblyNames, effectiveShowCytobands } = model;
12
34
  const { assemblyManager } = getSession(model);
13
- const assemblyName = assemblyNames.length > 1 ? '' : assemblyNames[0];
14
- const assembly = assemblyManager.get(assemblyName);
35
+ // cytobands need a single unambiguous assembly, but the header label names
36
+ // every assembly in the view
37
+ const cytobandAssemblyName = assemblyNames.length === 1 ? assemblyNames[0] : undefined;
38
+ const assembly = cytobandAssemblyName
39
+ ? assemblyManager.get(cytobandAssemblyName)
40
+ : undefined;
15
41
  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,
21
- });
22
- const visibleRegions = model.dynamicBlocks.contentBlocks;
23
- if (!visibleRegions.length) {
42
+ const fill = stripAlpha(theme.palette.text.primary);
43
+ // nothing on screen to label: no assembly name, scalebar or ruler
44
+ if (!model.hasVisibleContent) {
24
45
  return null;
25
46
  }
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 }) })] }));
47
+ const { assemblyLabelBaselineY, cytobandTop, scalebarLineY, rulerTop } = getHeaderLayout({
48
+ fontSize,
49
+ showCytobands: effectiveShowCytobands,
50
+ rulerHeight,
51
+ });
52
+ return (_jsxs("g", { id: "header", children: [_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: fill, children: assemblyNames.join(', ') }), effectiveShowCytobands ? (_jsx(CytobandOverview, { model: model, assembly: assembly, 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
53
  }
@@ -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 { getSession } from '@jbrowse/core/util';
3
+ import { useTheme } from '@mui/material';
4
+ import SVGHighlightBand from '../components/SVGHighlightBand.js';
5
+ import { getHighlightColor, highlightKey } from '../components/util.js';
6
+ // Native LGV highlights (model.highlight) drawn as full-height bands over the
7
+ // tracks area, with an optional label at the top. Bookmark highlights are added
8
+ // separately via the LinearGenomeView-HighlightSVGComponent extension point.
9
+ //
10
+ // Deliberately NOT an observer, and that is the whole of what keeps a live
11
+ // figure coherent. `useViewSvgFigure` freezes a figure by memoizing it against
12
+ // its snapshot, which stops a parent render from advancing the drawing — but a
13
+ // `memo` cannot stop an observer inside it from re-rendering itself, and an
14
+ // observer here reads `getHighlightCoords`, i.e. `offsetPx`. A pan then slid the
15
+ // bands across track bodies that were still drawn where the snapshot left them.
16
+ // The file export renders the whole document in one synchronous pass, so it
17
+ // never needed the subscription either.
18
+ export default function SVGHighlights({ model, height, }) {
19
+ const theme = useTheme();
20
+ return getSession(model).highlightsVisible
21
+ ? model.highlight.map((h, idx) => {
22
+ const coords = model.getHighlightCoords(h);
23
+ return coords ? (_jsx(SVGHighlightBand, { coords: coords, height: height, color: getHighlightColor(h, theme).toRgbString(), label: model.labelsVisible ? 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: native LGV highlights plus
8
+ // whatever plugins contribute (bookmarks), clipped to the view width. Callers
9
+ // translate 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,81 @@
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 = 'default', 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
+ // The view geometry is read *after* the displays' waits, never before —
47
+ // SVGHeader re-reads both of these when it renders (later still, inside
48
+ // wrapSvgExport) and lays itself out with the same getHeaderLayout call, so a
49
+ // value that moved during the awaits would leave the reserved `tracksTop` and
50
+ // the drawn header describing different rows. Same rule the dotplot, circular
51
+ // and synteny exports each shipped a violation of.
52
+ const { width, effectiveShowCytobands } = model;
53
+ const { tracksTop } = getHeaderLayout({
54
+ fontSize,
55
+ showCytobands: effectiveShowCytobands,
56
+ rulerHeight,
57
+ });
58
+ const height = tracksHeight + tracksTop + exportMargin;
59
+ const trackLabelOffset = trackLabelLeftOffset({
60
+ tracks,
61
+ trackLabels,
62
+ fontSize,
63
+ fontFamily,
64
+ session,
65
+ });
39
66
  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 }) })] })] }) }) }));
67
+ // the xlink namespace is used for rendering <image> tag
68
+ return wrapSvgExport({
69
+ theme,
70
+ width: w,
71
+ height,
72
+ fontFamily,
73
+ Wrapper,
74
+ children: (_jsx("g", { transform: `translate(${exportMargin} 0)`, children: _jsx(SVGView, { view: model, displayResults: displayResults,
75
+ // the standalone export is the one with room above the tracks, so its
76
+ // header is the full one: cytoband overview and total-bp scalebar as
77
+ // well as the assembly name and ruler. `tracksTop` is the height
78
+ // getHeaderLayout gave it.
79
+ header: _jsx(SVGHeader, { model: model, fontSize: fontSize, rulerHeight: rulerHeight }), fontSize: fontSize, textHeight: textHeight, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset, contentTop: tracksTop, tracksHeight: tracksHeight, showGridlines: showGridlines, leftBuffer: exportMargin, legendWidth: legendWidth }) })),
80
+ });
42
81
  }
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,25 @@
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 { useTheme } from '@mui/material';
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 theme = useTheme();
19
+ const fill = theme.palette.mode === 'dark'
20
+ ? theme.palette.grey[500]
21
+ : theme.palette.grey[600];
22
+ return (_jsx(_Fragment, { children: dynamicBlocks.contentBlocks
23
+ .filter(block => block.isRightEndOfDisplayedRegion)
24
+ .map(block => (_jsx("rect", { x: block.offsetPx + block.widthPx - offsetPx - 1, width: 3, y: 0, height: height, fill: fill }, block.key))) }));
5
25
  }
@@ -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,37 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { stripAlpha } from '@jbrowse/core/util';
3
+ import { useTheme } from '@mui/material';
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
+ // Must be the height the caller also passes SVGView as `contentTop`: the
14
+ // ruler hangs its ticks off the bottom of this budget so they meet the
15
+ // tracks, and the tracks start at `contentTop`.
16
+ rulerHeight,
17
+ // Whether this row draws its assembly name. Default true, which is what a
18
+ // stack of DIFFERENT assemblies wants — a synteny export names each row
19
+ // because each row is a different genome. A breakpoint split view is usually
20
+ // one assembly seen at several loci, and there the name is the same string
21
+ // printed once per panel, so that caller passes false on every row after the
22
+ // first whose assembly matches the row above it. The reserved band above the
23
+ // ruler is unchanged either way: it is the caller's offset, not this
24
+ // component's.
25
+ showAssemblyName = true,
26
+ // Whether this row draws the capped bar labelled with its span. Off by
27
+ // default, since it costs `getRowHeaderLayout().bandHeight` of the caller's
28
+ // band and every caller has to reserve that much before asking for it. See
29
+ // getRowHeaderLayout for what it is for.
30
+ showScalebar = false, }) {
31
+ const theme = useTheme();
32
+ const { assemblyLabelBaselineY, scalebarLineY } = getRowHeaderLayout({
33
+ fontSize,
34
+ showScalebar,
35
+ });
36
+ return (_jsxs(_Fragment, { children: [showAssemblyName ? (_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: stripAlpha(theme.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 })] }));
37
+ }
@@ -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 {};