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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +250 -121
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +32 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  81. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  82. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  83. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  84. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  85. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  86. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  87. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  88. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  90. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  91. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  92. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  93. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  94. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  95. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  96. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  97. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  98. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  99. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  102. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  103. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  104. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  105. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  106. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  107. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  108. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  109. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  110. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  111. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  112. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  113. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  114. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  115. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  116. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  117. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  118. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  119. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  120. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  121. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  122. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  124. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  126. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  127. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  128. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  129. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  130. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  131. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  132. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  133. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  134. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  135. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  136. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  137. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  138. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  139. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  140. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  141. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  142. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  143. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  144. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  146. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  147. package/esm/LinearGenomeView/components/util.js +27 -6
  148. package/esm/LinearGenomeView/consts.d.ts +7 -2
  149. package/esm/LinearGenomeView/consts.js +18 -2
  150. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  151. package/esm/LinearGenomeView/flyTo.js +135 -0
  152. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  153. package/esm/LinearGenomeView/headerFit.js +59 -0
  154. package/esm/LinearGenomeView/index.d.ts +32 -2
  155. package/esm/LinearGenomeView/index.js +16 -6
  156. package/esm/LinearGenomeView/initKeys.d.ts +12 -0
  157. package/esm/LinearGenomeView/initKeys.js +68 -0
  158. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  159. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  160. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  161. package/esm/LinearGenomeView/launchKeys.js +23 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +58 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +3238 -136
  169. package/esm/LinearGenomeView/model.js +2425 -528
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +138 -0
  223. package/esm/index.d.ts +122 -1235
  224. package/esm/index.js +101 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +55 -11
  228. package/esm/searchUtils.js +342 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,26 +1,27 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { getFillProps } from '@jbrowse/core/util';
3
+ import { layoutBpToPx } from '@jbrowse/core/util/Base1DUtils';
3
4
  import { observer } from 'mobx-react';
4
- import { getCytobands } from "./util.js";
5
- import { HEADER_OVERVIEW_HEIGHT } from "../consts.js";
5
+ import { HEADER_OVERVIEW_HEIGHT } from '../consts.js';
6
+ // rounded rect from https://stackoverflow.com/a/45889603/2129219
6
7
  function rightRoundedRect(x, y, width, height, radius) {
7
8
  return `M${x},${y}h${width - radius}a${radius},${radius} 0 0 1 ${radius},${radius}v${height - 2 * radius}a${radius},${radius} 0 0 1 ${-radius},${radius}h${radius - width}z`;
8
9
  }
9
10
  function leftRoundedRect(x, y, width, height, radius) {
10
11
  return `M${x + radius},${y}h${width - radius}v${height}h${radius - width}a${radius},${radius} 0 0 1 ${-radius},${-radius}v${2 * radius - height}a${radius},${radius} 0 0 1 ${radius},${-radius}z`;
11
12
  }
12
- function leftTriangle(x, _y, width, height) {
13
+ function triangleRight(x, y, width, height) {
13
14
  return [
14
- [x, 0],
15
- [x + width, height / 2],
16
- [x, height],
15
+ [x, y],
16
+ [x + width, y + height / 2],
17
+ [x, y + height],
17
18
  ].toString();
18
19
  }
19
- function rightTriangle(x, _y, width, height) {
20
+ function triangleLeft(x, y, width, height) {
20
21
  return [
21
- [x, height / 2],
22
- [x + width, 0],
23
- [x + width, height],
22
+ [x, y + height / 2],
23
+ [x + width, y],
24
+ [x + width, y + height],
24
25
  ].toString();
25
26
  }
26
27
  const colorMap = {
@@ -35,53 +36,75 @@ const colorMap = {
35
36
  stalk: 'rgb(127,127,127)',
36
37
  acen: '#800',
37
38
  };
38
- const Cytobands = observer(function Cytobands({ overview, block, assembly, }) {
39
+ // assemblies without Giemsa stains (e.g. dm6's numbered polytene divisions)
40
+ // arrive as 'n/a'; alternate two greys per numbered group so adjacent divisions
41
+ // stay distinguishable without painting a distracting colored block
42
+ function bandColors(cytobands) {
43
+ let prevKey = '';
44
+ let group = 0;
45
+ return cytobands.map(({ name, type }) => {
46
+ if (type !== 'n/a') {
47
+ return colorMap[type] ?? 'black';
48
+ }
49
+ const [, digits, letter] = name?.match(/^(\d+)([A-Za-z])/) ?? [];
50
+ const key = digits && letter ? digits + letter : '';
51
+ if (key && key !== prevKey) {
52
+ prevKey = key;
53
+ group++;
54
+ }
55
+ return group % 2 ? 'rgb(120,120,120)' : 'rgb(190,190,190)';
56
+ });
57
+ }
58
+ // A block covers a single displayed region, which can be a slice of the
59
+ // chromosome, so clip each band to it and drop the ones that fall outside.
60
+ // Projecting an out-of-block coord returns undefined, and treating that as px 0
61
+ // used to draw runaway triangles and duplicate the centromere in every block.
62
+ function layoutBands(cytobands, overview, block) {
63
+ const { displayedRegionIndex, reversed } = block;
64
+ const firstAcenIdx = cytobands.findIndex(({ type }) => type === 'acen');
65
+ const colors = bandColors(cytobands);
66
+ return cytobands
67
+ .map((band, index) => {
68
+ const { refName, type } = band;
69
+ const start = Math.max(band.start, block.start);
70
+ const end = Math.min(band.end, block.end);
71
+ const toPx = (coord) => layoutBpToPx(overview, { refName, coord, displayedRegionIndex });
72
+ const s = toPx(start);
73
+ const e = toPx(end);
74
+ return start < end && s !== undefined && e !== undefined
75
+ ? {
76
+ // name can be missing or duplicated; start/end uniquely identify it
77
+ key: `${band.start}-${band.end}`,
78
+ color: colors[index],
79
+ left: Math.min(s, e),
80
+ width: Math.abs(e - s),
81
+ isAcen: type === 'acen',
82
+ // the two acen bands always point at each other, meeting at the
83
+ // centromere: the p arm points right and the q arm left, and both
84
+ // flip when reversed puts the p arm on the right
85
+ // eslint-disable-next-line unicorn/no-chained-comparison -- parenthesised XOR, not `a === b !== c`
86
+ pointsRight: (index === firstAcenIdx) !== reversed,
87
+ }
88
+ : undefined;
89
+ })
90
+ .filter(f => f !== undefined);
91
+ }
92
+ const Cytobands = observer(function Cytobands({ overview, block, cytobands, }) {
39
93
  const { offsetPx, reversed } = block;
40
- const cytobands = getCytobands(assembly, block.refName);
41
- const lcap = reversed ? cytobands.length - 1 : 0;
42
- const rcap = reversed ? 0 : cytobands.length - 1;
43
94
  const h = HEADER_OVERVIEW_HEIGHT;
44
- let centromereSeen = false;
45
- let curr = '';
46
- let idx = 0;
47
- return (_jsx("g", { transform: `translate(-${offsetPx})`, children: cytobands.map((args, index) => {
48
- const k = JSON.stringify(args);
49
- const { refName, name, type, start, end } = args;
50
- const s = overview.bpToPx({ refName, coord: start }) || 0;
51
- const e = overview.bpToPx({ refName, coord: end }) || 0;
52
- const l = Math.min(s, e);
53
- const w = Math.abs(e - s);
54
- if (type === 'n/a') {
55
- const match = name?.match(/^(\d+)([A-Za-z])/);
56
- const ret = match[1] + match[2];
57
- if (ret && ret !== curr) {
58
- curr = ret;
59
- idx++;
60
- }
61
- }
62
- const c = type === 'n/a'
63
- ? idx % 2
64
- ? 'black'
65
- : '#a77'
66
- : colorMap[type] || 'black';
67
- if (type === 'acen' && !centromereSeen) {
68
- centromereSeen = true;
69
- return (_jsx("polygon", { points: reversed
70
- ? rightTriangle(s - w, 0, w, h)
71
- : leftTriangle(s, 0, w, h), ...getFillProps(c) }, k));
72
- }
73
- if (type === 'acen' && centromereSeen) {
74
- return (_jsx("polygon", { points: reversed
75
- ? leftTriangle(s - w, 0, w, h)
76
- : rightTriangle(s, 0, w, h), ...getFillProps(c) }, k));
77
- }
78
- if (lcap === index) {
79
- return (_jsx("path", { d: leftRoundedRect(l, 0, w, h, 8), ...getFillProps(c) }, k));
95
+ const bands = layoutBands(cytobands, overview, block);
96
+ const lcap = reversed ? bands.length - 1 : 0;
97
+ const rcap = reversed ? 0 : bands.length - 1;
98
+ return (_jsx("g", { transform: `translate(-${offsetPx})`, children: bands.map(({ key, color, left, width, isAcen, pointsRight }, index) => {
99
+ if (isAcen) {
100
+ const triangle = pointsRight ? triangleRight : triangleLeft;
101
+ return (_jsx("polygon", { points: triangle(left, 0, width, h), ...getFillProps(color) }, key));
80
102
  }
81
- if (rcap === index) {
82
- return (_jsx("path", { d: rightRoundedRect(l, 0, w, h, 8), ...getFillProps(c) }, k));
103
+ if (index === lcap || index === rcap) {
104
+ const rect = index === lcap ? leftRoundedRect : rightRoundedRect;
105
+ return (_jsx("path", { d: rect(left, 0, width, h, 8), ...getFillProps(color) }, key));
83
106
  }
84
- return (_jsx("rect", { x: l, y: 0, width: w, height: h, ...getFillProps(c) }, k));
107
+ return (_jsx("rect", { x: left, y: 0, width: width, height: h, ...getFillProps(color) }, key));
85
108
  }) }));
86
109
  });
87
110
  export default Cytobands;
@@ -1,7 +1,11 @@
1
- import type { ExportSvgOptions } from '../types.ts';
1
+ import type { TrackLabelMode } from '../types.ts';
2
+ import type { BaseExportSvgOptions } from '@jbrowse/core/ui';
2
3
  export default function ExportSvgDialog({ model, handleClose, }: {
3
4
  model: {
4
- exportSvg(opts: ExportSvgOptions): Promise<void>;
5
+ exportSvg(opts: BaseExportSvgOptions & {
6
+ trackLabels: TrackLabelMode;
7
+ showGridlines: boolean;
8
+ }): Promise<void>;
5
9
  };
6
10
  handleClose: () => void;
7
- }): import("react/jsx-runtime").JSX.Element;
11
+ }): import("react").JSX.Element;
@@ -1,70 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
4
- import { getSession, useLocalStorage } from '@jbrowse/core/util';
5
- import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, ToggleButton, ToggleButtonGroup, Typography, } from '@mui/material';
6
- function LoadingMessage({ format }) {
7
- return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsxs(Typography, { display: "inline", children: ["Creating ", format.toUpperCase()] })] }));
8
- }
9
- function useSvgLocal(key, val) {
10
- return useLocalStorage(`svg-${key}`, val);
11
- }
12
- function TextField2({ children, ...rest }) {
13
- return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
14
- }
2
+ import { BaseExportSvgDialog, LabeledCheckbox, useExportSvgPreference, } from '@jbrowse/core/ui';
3
+ import { MenuItem, TextField } from '@mui/material';
4
+ // Shared track-label + gridlines export dialog. Used by LGV, linear-synteny and
5
+ // breakpoint-split views (their lazyDialogs re-export this).
15
6
  export default function ExportSvgDialog({ model, handleClose, }) {
16
- const session = getSession(model);
17
- const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
18
- const [rasterizeLayers, setRasterizeLayers] = useState(offscreenCanvas);
19
- const [showGridlines, setShowGridlines] = useSvgLocal('gridlines', false);
20
- const [loading, setLoading] = useState(false);
21
- const [error, setError] = useState();
22
- const [format, setFormat] = useSvgLocal('format', 'svg');
23
- const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
24
- const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
25
- const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
26
- return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Export image", children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingMessage, { format: format })) : null, _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [_jsx(TextField, { helperText: "filename", value: filename, onChange: event => {
27
- setFilename(event.target.value);
28
- } }), _jsxs(ToggleButtonGroup, { value: format, exclusive: true, onChange: (_event, value) => {
29
- if (value) {
30
- setFormat(value);
31
- if (filename.endsWith('.svg') && value === 'png') {
32
- setFilename(filename.replace(/\.svg$/, '.png'));
33
- }
34
- else if (filename.endsWith('.png') && value === 'svg') {
35
- setFilename(filename.replace(/\.png$/, '.svg'));
36
- }
37
- }
38
- }, size: "small", children: [_jsx(ToggleButton, { value: "svg", children: "SVG" }), _jsx(ToggleButton, { value: "png", children: "PNG" })] })] }), _jsxs(TextField2, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => {
39
- setTrackLabels(event.target.value);
40
- }, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
41
- setThemeName(event.target.value);
42
- }, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: showGridlines, onChange: () => {
43
- setShowGridlines(val => !val);
44
- } }), label: "Show gridlines" }), offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
45
- setRasterizeLayers(val => !val);
46
- } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (_jsx(Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
47
- handleClose();
48
- }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
49
- setLoading(true);
50
- setError(undefined);
51
- try {
52
- await model.exportSvg({
53
- rasterizeLayers,
54
- format,
55
- filename,
56
- trackLabels,
57
- themeName,
58
- showGridlines,
59
- });
60
- handleClose();
61
- }
62
- catch (e) {
63
- console.error(e);
64
- setError(e);
65
- }
66
- finally {
67
- setLoading(false);
68
- }
69
- }, children: "Submit" })] })] }));
7
+ const [trackLabels, setTrackLabels] = useExportSvgPreference('tracklabels', 'offset');
8
+ const [showGridlines, setShowGridlines] = useExportSvgPreference('gridlines', false);
9
+ return (_jsx(BaseExportSvgDialog, { model: model, handleClose: handleClose, exportSvg: opts => model.exportSvg({ ...opts, trackLabels, showGridlines }), checkboxes: _jsx(LabeledCheckbox, { checked: showGridlines, onChange: val => {
10
+ setShowGridlines(val);
11
+ }, label: "Show gridlines" }), children: _jsxs(TextField, { select: true, label: "Track label positioning", variant: "outlined", style: { minWidth: 200 }, value: trackLabels, onChange: event => {
12
+ setTrackLabels(event.target.value);
13
+ }, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }) }));
70
14
  }
@@ -1,12 +1,8 @@
1
- import type { BpOffset } from '../types.ts';
2
1
  import type { Region } from '@jbrowse/core/util';
3
- declare const GetSequenceDialog: ({ model, handleClose, }: {
4
- model: {
5
- leftOffset?: BpOffset;
6
- rightOffset?: BpOffset;
7
- getSelectedRegions: (left?: BpOffset, right?: BpOffset) => Region[];
8
- setOffsets: (left?: BpOffset, right?: BpOffset) => void;
9
- };
2
+ import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
3
+ declare const GetSequenceDialog: ({ model, regions, handleClose, }: {
4
+ model: IAnyStateTreeNode;
5
+ regions: Region[];
10
6
  handleClose: () => void;
11
- }) => import("react/jsx-runtime").JSX.Element;
7
+ }) => import("react").JSX.Element;
12
8
  export default GetSequenceDialog;
@@ -1,101 +1,97 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
4
- import { complement, reverse, toLocale } from '@jbrowse/core/util';
2
+ import { useState } from 'react';
3
+ import { CopyToClipboardButton, Dialog, ErrorBanner, LabeledCheckbox, LoadingEllipses, MonospaceTextField, } from '@jbrowse/core/ui';
4
+ import { complement, reverse, statusProgressLabel, toLocale, } from '@jbrowse/core/util';
5
5
  import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings';
6
- import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { useFetch } from '@jbrowse/core/util/useFetch';
7
7
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
8
8
  import GetAppIcon from '@mui/icons-material/GetApp';
9
- import { Button, Checkbox, DialogActions, DialogContent, FormControlLabel, FormGroup, TextField, Typography, } from '@mui/material';
9
+ import { Button, DialogActions, DialogContent, FormGroup, Typography, } from '@mui/material';
10
10
  import { observer } from 'mobx-react';
11
- import { fetchSequence } from "./fetchSequence.js";
12
- const useStyles = makeStyles()({
13
- dialogContent: {
14
- width: '80em',
15
- },
16
- textAreaFont: {
17
- fontFamily: 'Courier New',
18
- },
19
- });
20
- const GetSequenceDialog = observer(function GetSequenceDialog({ model, handleClose, }) {
21
- const { classes } = useStyles();
22
- const [error, setError] = useState();
23
- const [sequenceChunks, setSequenceChunks] = useState();
24
- const [rev, setReverse] = useState(false);
25
- const [copied, setCopied] = useState(false);
26
- const [comp, setComplement] = useState(false);
27
- const { leftOffset, rightOffset } = model;
28
- const loading = sequenceChunks === undefined;
29
- useEffect(() => {
30
- const controller = new AbortController();
31
- (async () => {
32
- try {
33
- const selection = model.getSelectedRegions(leftOffset, rightOffset);
34
- if (selection.length === 0) {
35
- throw new Error('Selected region is out of bounds');
36
- }
37
- setSequenceChunks(await fetchSequence(model, selection));
38
- }
39
- catch (e) {
40
- console.error(e);
41
- setError(e);
11
+ import { fetchSequence } from './fetchSequence.js';
12
+ // Guard on the requested span, before fetching, so a whole-chromosome request
13
+ // (easy to trigger now that features/regions can open this) never round-trips
14
+ // megabases just to be display-blocked. Above the display limit the sequence is
15
+ // still downloadable; above the fetch limit it is refused outright.
16
+ //
17
+ // The display limit is in FASTA characters, not bp — it caps what goes into the
18
+ // textarea, which is the formatted output including headers and line breaks.
19
+ const MAX_DISPLAY_CHARS = 1_000_000;
20
+ const MAX_FETCH_BP = 10_000_000;
21
+ const GetSequenceDialog = observer(function GetSequenceDialog({ model, regions, handleClose, }) {
22
+ const [rev, setRev] = useState(false);
23
+ const [comp, setComp] = useState(false);
24
+ const totalBp = regions.reduce((a, r) => a + (r.end - r.start), 0);
25
+ const tooLargeToFetch = totalBp > MAX_FETCH_BP;
26
+ const { data: sequenceChunks, error, isLoading: loading, status, } = useFetch(tooLargeToFetch
27
+ ? false
28
+ : [
29
+ 'fetchSequence',
30
+ regions.map(r => `${r.refName}:${r.start}-${r.end}`),
31
+ ],
32
+ // a selection this dialog will happily take is a whole chromosome of
33
+ // sequence, so both handles are forwarded: closing the dialog stops the
34
+ // read rather than leaving the worker on it, and the wait is named
35
+ async (_name, _locs, stopToken, statusCallback) => {
36
+ if (regions.length === 0) {
37
+ throw new Error('Selected region is out of bounds');
38
+ }
39
+ const chunks = await fetchSequence(model, regions, {
40
+ stopToken,
41
+ statusCallback,
42
+ });
43
+ // validate here (in the async path) so a length mismatch surfaces via the
44
+ // dialog's own ErrorBanner rather than throwing during render
45
+ return chunks.map(chunk => {
46
+ const seq = chunk.get('seq');
47
+ const start = chunk.get('start') + 1;
48
+ const end = chunk.get('end');
49
+ const loc = `${chunk.get('refName')}:${start}-${end}`;
50
+ if (seq.length !== end - start + 1) {
51
+ throw new Error(`${loc} returned ${toLocale(seq.length)} bases, but should have returned ${toLocale(end - start + 1)}`);
42
52
  }
43
- })();
44
- return () => {
45
- controller.abort();
53
+ return { loc, seq };
54
+ });
55
+ });
56
+ const entries = sequenceChunks?.map(({ loc, seq }) => {
57
+ const revSeq = rev ? reverse(seq) : seq;
58
+ return {
59
+ header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
60
+ seq: comp ? complement(revSeq) : revSeq,
46
61
  };
47
- }, [model, leftOffset, rightOffset]);
48
- const sequence = sequenceChunks
49
- ? formatSeqFasta(sequenceChunks.map(chunk => {
50
- let chunkSeq = chunk.get('seq');
51
- const chunkRefName = chunk.get('refName');
52
- const chunkStart = chunk.get('start') + 1;
53
- const chunkEnd = chunk.get('end');
54
- const loc = `${chunkRefName}:${chunkStart}-${chunkEnd}`;
55
- if (chunkSeq?.length !== chunkEnd - chunkStart + 1) {
56
- throw new Error(`${loc} returned ${toLocale(chunkSeq.length)} bases, but should have returned ${toLocale(chunkEnd - chunkStart)}`);
57
- }
58
- if (rev) {
59
- chunkSeq = reverse(chunkSeq);
60
- }
61
- if (comp) {
62
- chunkSeq = complement(chunkSeq);
63
- }
64
- return {
65
- header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
66
- seq: chunkSeq,
67
- };
68
- }))
69
- : '';
70
- const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false;
62
+ }) ?? [];
63
+ const sequence = formatSeqFasta(entries);
64
+ const plainSequence = entries.map(e => e.seq).join('\n');
65
+ const sequenceTooLarge = sequence.length > MAX_DISPLAY_CHARS;
66
+ // What the textarea says instead of a sequence. `tooLargeToFetch` disables the
67
+ // fetch, so without this branch it left an empty box with no loading state, no
68
+ // error and no explanation — and a Download FASTA button that wrote 0 bytes.
69
+ const notice = tooLargeToFetch
70
+ ? `Selected region is ${toLocale(totalBp)}bp, over the ${toLocale(MAX_FETCH_BP)}bp limit for fetching a reference sequence. Zoom in or select a smaller region.`
71
+ : sequenceTooLarge
72
+ ? 'Reference sequence too large to display, use the download FASTA button'
73
+ : undefined;
71
74
  return (_jsxs(Dialog, { maxWidth: "xl", open: true, title: "Reference sequence", onClose: () => {
72
75
  handleClose();
73
- model.setOffsets();
74
- }, children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: "Retrieving sequences" })) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, disabled: sequenceTooLarge, className: classes.dialogContent, fullWidth: true, value: sequenceTooLarge
75
- ? 'Reference sequence too large to display, use the download FASTA button'
76
- : sequence, slotProps: {
77
- input: {
78
- readOnly: true,
79
- classes: {
80
- input: classes.textAreaFont,
81
- },
82
- },
83
- } }), _jsxs(FormGroup, { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { value: rev, onChange: event => {
84
- setReverse(event.target.checked);
85
- } }), label: "Reverse sequence" }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { value: comp, onChange: event => {
86
- setComplement(event.target.checked);
87
- } }), label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: async () => {
88
- const { default: copy } = await import('copy-to-clipboard');
89
- copy(sequence);
90
- setCopied(true);
91
- setTimeout(() => {
92
- setCopied(false);
93
- }, 500);
94
- }, disabled: loading || !!error || sequenceTooLarge, color: "primary", startIcon: _jsx(ContentCopyIcon, {}), children: copied ? 'Copied' : 'Copy to clipboard' }), _jsx(Button, { onClick: async () => {
95
- const { saveAs } = await import('file-saver-es');
96
- saveAs(new Blob([sequence || ''], {
76
+ }, children: [_jsxs(DialogContent, { style: { width: '80em' }, children: [error ? (_jsx(ErrorBanner, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: statusProgressLabel(status) || 'Retrieving sequences' })) : null, _jsxs("div", { style: {
77
+ display: 'flex',
78
+ justifyContent: 'flex-end',
79
+ gap: 8,
80
+ marginBottom: 4,
81
+ }, children: [_jsx(CopyToClipboardButton, { value: plainSequence, copiedLabel: "Copied", disabled: !plainSequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy plain text" }), _jsx(CopyToClipboardButton, { value: sequence, copiedLabel: "Copied", disabled: !sequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy FASTA" })] }), _jsx(MonospaceTextField, { fullWidth: true, readOnly: true, minRows: 5, maxRows: 10, disabled: notice !== undefined, value: notice ?? sequence }), _jsxs(FormGroup, { children: [_jsx(LabeledCheckbox, { checked: rev, onChange: val => {
82
+ setRev(val);
83
+ }, label: "Reverse sequence" }), _jsx(LabeledCheckbox, { checked: comp, onChange: val => {
84
+ setComp(val);
85
+ }, label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", onClick: async () => {
86
+ const { saveAs } = await import('@jbrowse/core/util/FileSaver');
87
+ saveAs(new Blob([sequence], {
97
88
  type: 'text/x-fasta;charset=utf-8',
98
89
  }), 'jbrowse_ref_seq.fa');
99
- }, disabled: loading || !!error, color: "primary", startIcon: _jsx(GetAppIcon, {}), children: "Download FASTA" }), _jsx(Button, { onClick: handleClose, variant: "contained", children: "Close" })] })] }));
90
+ },
91
+ // `!sequence` covers every path with nothing to write: still loading,
92
+ // errored, and the over-fetch-limit refusal
93
+ disabled: !sequence, color: "primary", startIcon: _jsx(GetAppIcon, {}), children: "Download FASTA" }), _jsx(Button, { onClick: () => {
94
+ handleClose();
95
+ }, variant: "contained", children: "Close" })] })] }));
100
96
  });
101
97
  export default GetSequenceDialog;
@@ -3,5 +3,5 @@ type LGV = LinearGenomeViewModel;
3
3
  declare const Gridlines: ({ model, offset, }: {
4
4
  model: LGV;
5
5
  offset?: number;
6
- }) => import("react/jsx-runtime").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
7
  export default Gridlines;
@@ -1,72 +1,43 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  import { observer } from 'mobx-react';
4
- import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from "../../BaseLinearDisplay/components/Block.js";
5
- import { makeTicks } from "../util.js";
4
+ import ZoomTransform from './ZoomTransform.js';
6
5
  const useStyles = makeStyles()(theme => ({
7
- verticalGuidesZoomContainer: {
6
+ // top/left stay unset: as an inline-level box the svg takes its static
7
+ // position on a line box, and pinning it to 0 shifts the ticks off the
8
+ // canvas's own grid
9
+ absoluteFill: {
8
10
  position: 'absolute',
9
- top: 0,
10
- height: '100%',
11
11
  width: '100%',
12
- pointerEvents: 'none',
13
- },
14
- verticalGuidesContainer: {
15
- position: 'absolute',
16
- height: '100%',
17
- pointerEvents: 'none',
18
- display: 'flex',
19
- },
20
- tick: {
21
- position: 'absolute',
22
12
  height: '100%',
23
- width: 1,
24
13
  },
25
- majorTick: {
26
- background: theme.palette.action.disabled,
14
+ minorLine: {
15
+ stroke: theme.palette.gridlineMinor,
27
16
  },
28
- minorTick: {
29
- background: theme.palette.divider,
17
+ majorLine: {
18
+ stroke: theme.palette.gridlineMajor,
30
19
  },
31
20
  }));
32
- function RenderedBlockLines({ block, bpPerPx, }) {
33
- const { classes } = useStyles();
34
- const { start, end, reversed } = block;
35
- const ticks = makeTicks(start, end, bpPerPx);
36
- const majorTickClass = `${classes.tick} ${classes.majorTick}`;
37
- const minorTickClass = `${classes.tick} ${classes.minorTick}`;
38
- return (_jsx(ContentBlockComponent, { block: block, children: ticks.map(({ type, base }) => {
39
- const x = (reversed ? end - base : base - start) / bpPerPx;
40
- return (_jsx("div", { className: type === 'major' || type === 'labeledMajor'
41
- ? majorTickClass
42
- : minorTickClass, style: { left: x } }, base));
43
- }) }));
44
- }
45
- const RenderedVerticalGuides = observer(function RenderedVerticalGuides({ model, }) {
46
- const { staticBlocks, bpPerPx } = model;
47
- return (_jsx(_Fragment, { children: staticBlocks.map((block, index) => {
48
- const k = `${block.key}-${index}`;
49
- if (block.type === 'ContentBlock') {
50
- return _jsx(RenderedBlockLines, { block: block, bpPerPx: bpPerPx }, k);
51
- }
52
- else if (block.type === 'ElidedBlock') {
53
- return _jsx(ElidedBlockComponent, { width: block.widthPx }, k);
54
- }
55
- else if (block.type === 'InterRegionPaddingBlock') {
56
- return (_jsx(InterRegionPaddingBlockComponent, { width: block.widthPx, boundary: block.variant === 'boundary' }, k));
57
- }
58
- return null;
59
- }) }));
60
- });
21
+ // Background gridline ticks; render UNDER track content. Tick marks collapse
22
+ // into two <path>s (minor + major) rather than one div each: zoom rebuilds two
23
+ // `d` strings and patches two attributes instead of reconciling ~150 nodes per
24
+ // frame. Vector stays crisp at any DPR with no canvas pixel-buffer size cap;
25
+ // +0.5 centers the 1px stroke on a pixel column to match the old divs; lines
26
+ // run to y=100000 and are clipped by the svg box, so we never measure height.
61
27
  const Gridlines = observer(function Gridlines({ model, offset = 0, }) {
62
28
  const { classes } = useStyles();
63
- const { staticBlocks, scaleFactor, offsetPx } = model;
64
- const offsetLeft = staticBlocks.offsetPx - offsetPx;
65
- return (_jsx("div", { className: classes.verticalGuidesZoomContainer, style: {
66
- transform: scaleFactor !== 1 ? `scaleX(${scaleFactor})` : undefined,
67
- }, children: _jsx("div", { className: classes.verticalGuidesContainer, style: {
68
- left: offsetLeft - offset,
69
- width: staticBlocks.totalWidthPx,
70
- }, children: _jsx(RenderedVerticalGuides, { model: model }) }) }));
29
+ const { gridlineTicks } = model;
30
+ let minorD = '';
31
+ let majorD = '';
32
+ for (const { x, major } of gridlineTicks) {
33
+ const seg = `M${x + 0.5} 0V100000`;
34
+ if (major) {
35
+ majorD += seg;
36
+ }
37
+ else {
38
+ minorD += seg;
39
+ }
40
+ }
41
+ return (_jsx(ZoomTransform, { model: model, offset: offset, children: _jsxs("svg", { className: classes.absoluteFill, children: [_jsx("path", { d: minorD, className: classes.minorLine, strokeWidth: 1 }), _jsx("path", { d: majorD, className: classes.majorLine, strokeWidth: 1 })] }) }));
71
42
  });
72
43
  export default Gridlines;
@@ -1,5 +1,5 @@
1
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
2
  declare const LinearGenomeViewHeader: ({ model, }: {
3
3
  model: LinearGenomeViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
4
+ }) => import("react").JSX.Element | null;
5
5
  export default LinearGenomeViewHeader;